Time-limited process execution


#1

I have basically in the need of the same functionality depicted in this entry terminate-long-running-process.

The solution given by Niall looks very clean however I could not make it work for our process. Our process looks like the following simplified model

The subprocess XML definition is follwing:

<bpmn:subProcess id="SubProcess_0nuqv0k" name="Timer Subprocess" triggeredByEvent="true">
  <bpmn:endEvent id="EndEvent_0pkuw91">
    <bpmn:incoming>SequenceFlow_1ett7tf</bpmn:incoming>
  </bpmn:endEvent>
  <bpmn:sequenceFlow id="SequenceFlow_1ett7tf" sourceRef="IntermediateThrowEvent_18iuwaz" targetRef="EndEvent_0pkuw91" />
  <bpmn:intermediateCatchEvent id="IntermediateThrowEvent_18iuwaz" name="GlobalTimerCatch">
    <bpmn:outgoing>SequenceFlow_1ett7tf</bpmn:outgoing>
    <bpmn:timerEventDefinition>
      <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">PT3M</bpmn:timeDuration>
    </bpmn:timerEventDefinition>
  </bpmn:intermediateCatchEvent>
</bpmn:subProcess>

The problem is the event subprocess does not catch any timer event and finish process. I tried with terminate end event but it did not bring anything. The process can stay indefinitely long in a user task and also after a transition the subprocess timer is not kicked.

Can it be the case that we start the process upon a message triggered from our rest controller or do I miss something else?

Thanks in advance for any help or hint.


#2

Can you explain this in more detail? there is no way the process should still be running after the timer has fired


#3

Hi @tunch,

I see that you are using “Timer Intermediate Catching Event” where you should use a "Timer Start Event"


#4

Thanks @hassang for pointing to the problem. That was really it.

I did not know that we need a timer start event in this sub-process. Hence I even tried to put the whole model part in a sub-process including the timer event sub-process but it also did not work.

Now I know why and with the change it does work as I expect.


#5

Well spotted @hassang ! :slight_smile: