cancel
Showing results for 
Search instead for 
Did you mean: 

Timer boundary event and execution listeners

darionis
Champ on-the-rise
Champ on-the-rise
If I have a task with 'timer boundary event' and it times out, will it notify its listners? For example:


    <boundaryEvent id="workOrderTimer" name="RZ Timer" attachedToRef="workOrder" cancelActivity="true">
      <extensionElements>
        <activiti:executionListener event="end" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
          <activiti:field name="script">
            <activiti:string><![CDATA[execution.setVariable("status", "expired");]]></activiti:string>
          </activiti:field>
        </activiti:executionListener>
      </extensionElements>
      <timerEventDefinition>
        <timeDuration>PT1M</timeDuration>
      </timerEventDefinition>
    </boundaryEvent>


I noticed that my script which sets variable is never executed. I also tried with execution delegate, it never gets called. Does it work to define start or end execution listeners on timer?  Workflow is deployed and executed without errors.

Coud anyone please help with timer and listeners,

Thanks!
4 REPLIES 4

jbarrez
Star Contributor
Star Contributor
Have you tried putting it on the sequenceflow?

darionis
Champ on-the-rise
Champ on-the-rise
It does work on the sequence flow, but not for boundary event. Is it a feature or a bug?

I've been through the source, it looks like BoundaryEvents are treated the same as SequenceFlows,  in the public void processFlowElements(Collection<FlowElement> flowElements) but BoundaryEventParseHandler is much simpler than SequenceFlowParseHandler and does not call createExecutionListenersOnTransition(…).

Now, I know the answer to my initial question, but I would appreciate if you quickly comment on this - should BoundaryEvent be parsed like SequenceFlow?

Thanks!

jbarrez
Star Contributor
Star Contributor
No, it shouldn't, those are two quite different things.

The thing is that executionlistener is not officially supported: http://activiti.org/userguide/index.html#executionListeners
It only works on activities and a couple of dedicated events. But not the boundary event.

darionis
Champ on-the-rise
Champ on-the-rise
OK, understood.

Thank you!