AnsweredAssumed Answered

End event triggered on non-canceling boundary timer?

Question asked by jhahn on Apr 7, 2015
Latest reply on Apr 14, 2015 by jhahn
If there's a boundary timer with execution listener for event end, is it expected behavior that a non-canceling boundary timer will trigger the event end? So I have a receive task with a non-canceling timer with 30s timer. After 30s, it will execute the

<activiti:executionListener event="end" expression="${execution.setVariable(&quot;test&quot;, true)}"></activiti:executionListener>

Is this expected behavior? I expected it to not trigger since non-canceling timer doesn't really end the receive task?




Also, I'm a little confused on the documentation for execution listener. It says for event="start", it will NOTIFY the execution listener when it starts but only EXECUTE/CALL the notify function when an end event occurs. Then it says the 3rd execution listener (event="end") in that example will be CALLED when it "ends".

http://i.imgur.com/sVihR0B.png

Is notify and call different? If event="start" and event="end" will both only be actually called when end event occurs, what's the difference?




Anyway, here is the test process for the first question.

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="myProcess" name="My process" isExecutable="true">
    <startEvent id="startevent1" name="Start"></startEvent>
    <receiveTask id="receivetask1" name="Receive Task">
      <extensionElements>
        <activiti:executionListener event="end" expression="${execution.setVariable(&quot;test&quot;, true)}"></activiti:executionListener>
      </extensionElements>
    </receiveTask>
    <boundaryEvent id="boundarytimer1" name="Timer" attachedToRef="receivetask1" cancelActivity="false">
      <timerEventDefinition>
        <timeDuration>PT30S</timeDuration>
      </timerEventDefinition>
    </boundaryEvent>
    <userTask id="usertask1" name="User Task"></userTask>
    <sequenceFlow id="flow1" sourceRef="boundarytimer1" targetRef="usertask1"></sequenceFlow>
    <sequenceFlow id="flow2" sourceRef="startevent1" targetRef="receivetask1"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow3" sourceRef="receivetask1" targetRef="endevent1"></sequenceFlow>
  </process>
</definitions>

Outcomes