AnsweredAssumed Answered

recieveTask with boundaryEvent that expires after defined time does not finish execution with cancelActivity = true

Question asked by aman1 on Aug 8, 2013
Latest reply on Aug 12, 2013 by aman1
I am using a recieveTask with boundaryEvent that has a timerEventDefinition of 10 seconds.

      <receiveTask id="waitForDispatchUpdate"/>
      <boundaryEvent attachedToRef="waitForDispatchUpdate" cancelActivity="true"
         id="setDefaultIfNoDispatchUpdate">
         <timerEventDefinition>
            <timeDuration>PT1S</timeDuration>
         </timerEventDefinition>
      </boundaryEvent>

In the BPMN file , the sequence flow is such that we send a request out and it for the response , if the timer expires then there is a service task that does some processing. The problem i am facing is that the flow waits on the recieveTask for 10 seconds. Suppose the response doesn't come in the intended time , then the flow continues to proceed with the negative flow. when the response comes now , then i try to check the execution based on activiti id. It should return null because the bpmn flow execution has passed the recieve task after the timer has expired but it doesnt.

runtimeService.createExecutionQuery()
            .processInstanceId(processId).activityId("waitForDispatchUpdate")
            .singleResult()  is not null.

Please can you suggest. My requirement is not to process the response if it comes back after the timer has expired.

Outcomes