AnsweredAssumed Answered

Process does not continue when timer is elasped

Question asked by rmilovic on Jan 5, 2015
Latest reply on Jan 8, 2015 by sonica75
Hello all.

I'm pretty new to Activiti and whole BPNM stuff and this problem is possibly caused by my lacking of knowledge. The problem is that process instance doesn't continue with execution after time duration of 10s on a timer passes. This is the process definition xml:


<?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">
  <signal id="migrateOutStartSignal" name="migrateOutStartSignal"></signal>
  <signal id="migrateOutStarted" name="migrateOutStarted"></signal>
  <process id="migrateOutStartProcess" name="Migrate out start process" isExecutable="true">
    <startEvent id="start" name="Start"></startEvent>
    <serviceTask id="migrateOutServiceTask" name="Migrate out service task" activiti:delegateExpression="${migrateOutServiceTask}"></serviceTask>
    <endEvent id="end" name="End"></endEvent>
    <sequenceFlow id="flow3" sourceRef="migrateOutServiceTask" targetRef="end"></sequenceFlow>
    <intermediateCatchEvent id="migrateOutStartedEvent" name="Migrate out started event">
      <signalEventDefinition signalRef="migrateOutStarted"></signalEventDefinition>
    </intermediateCatchEvent>
    <sequenceFlow id="flow5" sourceRef="migrateOutStartedEvent" targetRef="migrateOutServiceTask"></sequenceFlow>
    <intermediateCatchEvent id="dummyTimer" name="Dummy timer">
      <timerEventDefinition>
        <timeDuration>PT10S</timeDuration>
      </timerEventDefinition>
    </intermediateCatchEvent>
    <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
    <exclusiveGateway id="timerCountGateway" name="Timer count check" default="flow6"></exclusiveGateway>
    <sequenceFlow id="flow6" name="Timer count is not 0" sourceRef="timerCountGateway" targetRef="dummyTimer"></sequenceFlow>
    <sequenceFlow id="flow7" sourceRef="dummyTimer" targetRef="exclusivegateway1"></sequenceFlow>
    <sequenceFlow id="flow9" sourceRef="start" targetRef="exclusivegateway1"></sequenceFlow>
    <sequenceFlow id="flow10" name="Timer count is 0" sourceRef="timerCountGateway" targetRef="migrateOutStartedEvent">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${timerCount == 0}]]></conditionExpression>
    </sequenceFlow>
    <serviceTask id="timerCountDecreaserServiceTask" name="Timer count decreaser service task" activiti:class="nl.tele2.orc.core.business.service.task.TimerCountDecreaserServiceTask"></serviceTask>
    <sequenceFlow id="flow11" sourceRef="exclusivegateway1" targetRef="timerCountDecreaserServiceTask"></sequenceFlow>
    <sequenceFlow id="flow12" sourceRef="timerCountDecreaserServiceTask" targetRef="timerCountGateway"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_migrateOutStartProcess">
    <bpmndi:BPMNPlane bpmnElement="migrateOutStartProcess" id="BPMNPlane_migrateOutStartProcess">
      <bpmndi:BPMNShape bpmnElement="start" id="BPMNShape_start">
        <omgdc:Bounds height="35.0" width="35.0" x="410.0" y="20.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="migrateOutServiceTask" id="BPMNShape_migrateOutServiceTask">
        <omgdc:Bounds height="65.0" width="105.0" x="375.0" y="429.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="end" id="BPMNShape_end">
        <omgdc:Bounds height="35.0" width="35.0" x="410.0" y="540.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="migrateOutStartedEvent" id="BPMNShape_migrateOutStartedEvent">
        <omgdc:Bounds height="35.0" width="35.0" x="410.0" y="339.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="dummyTimer" id="BPMNShape_dummyTimer">
        <omgdc:Bounds height="35.0" width="35.0" x="530.0" y="163.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
        <omgdc:Bounds height="40.0" width="40.0" x="407.0" y="80.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="timerCountGateway" id="BPMNShape_timerCountGateway">
        <omgdc:Bounds height="40.0" width="40.0" x="407.0" y="255.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="timerCountDecreaserServiceTask" id="BPMNShape_timerCountDecreaserServiceTask">
        <omgdc:Bounds height="78.0" width="105.0" x="375.0" y="142.0"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="427.0" y="494.0"></omgdi:waypoint>
        <omgdi:waypoint x="427.0" y="540.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
        <omgdi:waypoint x="427.0" y="374.0"></omgdi:waypoint>
        <omgdi:waypoint x="427.0" y="429.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
        <omgdi:waypoint x="427.0" y="255.0"></omgdi:waypoint>
        <omgdi:waypoint x="547.0" y="198.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="100.0" x="437.0" y="255.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
        <omgdi:waypoint x="547.0" y="163.0"></omgdi:waypoint>
        <omgdi:waypoint x="427.0" y="120.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
        <omgdi:waypoint x="427.0" y="55.0"></omgdi:waypoint>
        <omgdi:waypoint x="427.0" y="80.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
        <omgdi:waypoint x="427.0" y="295.0"></omgdi:waypoint>
        <omgdi:waypoint x="427.0" y="339.0"></omgdi:waypoint>
        <bpmndi:BPMNLabel>
          <omgdc:Bounds height="14.0" width="100.0" x="437.0" y="295.0"></omgdc:Bounds>
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
        <omgdi:waypoint x="427.0" y="120.0"></omgdi:waypoint>
        <omgdi:waypoint x="427.0" y="142.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow12" id="BPMNEdge_flow12">
        <omgdi:waypoint x="427.0" y="220.0"></omgdi:waypoint>
        <omgdi:waypoint x="427.0" y="255.0"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

As you can see I'm simulating a loop with two gateways and a timer until timerCount is decreased to zero which is done inside TimerCountDecreaserServiceTask java delegate class. After the timer is triggered for the first time, process is stuck.

Thank you for your help.

Outcomes