cancel
Showing results for 
Search instead for 
Did you mean: 

How is it possible to fire the same intermediate timer event multiple times

sunblocker
Champ in-the-making
Champ in-the-making
I modeled a loop within my process that should periodically check, whether or not the proper information has been put into the DB (polling mechanism). For this reason, I have connected a start event with a intermediate timer event (Duration PT5S), the timer event is connected with a service task (for the check), the service task is connected with a XOR gateway (complete yes/no). One path of the XOR goes back to the timer event.

However, the timer seems to be fired only one time. I guess the counter has not been reset by the process engine. Is there a way to realize that?
2 REPLIES 2

trademak
Star Contributor
Star Contributor
And the process instance is waiting in the timer indefinitely?
Could you create a unit test and create a JIRA if this is the case?

Best regards,

sunblocker
Champ in-the-making
Champ in-the-making
The problem is that the timer will only wait at the first time. When the timer is triggered again it does not wait at all.
I attached the BPMN file.

17:45:06,830 ERROR [stderr] (pool-6-thread-3) Caused by: org.apache.ibatis.exceptions.PersistenceException:

17:45:06,830 ERROR [stderr] (pool-6-thread-3) ### Error querying database.  Cause: org.postgresql.util.PSQLException: Unzulässiger Wert für den Typ long : <?xml version="1.0" encoding="UTF-8"?>\012<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="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">\012  <process id="MyTimerLoopProcess" name="My Timer Loop Process" isExecutable="true">\012    <startEvent id="startevent1" name="Start"></startEvent>\012    <scriptTask id="firstStep" name="First Step" activiti:async="true" scriptFormat="javascript" activiti:autoStoreVariables="true">\012      <script>println("************************");\015\012counter = 0;\015\012limit = 3;\015\012println("first step, counter = " + counter);</script>\012    </scriptTask>\012    <scriptTask id="lastStep" name="Last Step" scriptFormat="javascript" activiti:autoStoreVariables="true">\012      <script>println("last step, counter = " + counter);</script>\012    </scriptTask>\012    <scriptTask id="intermediateStep" name="Intermediate Step" activiti:async="true" scriptFormat="javascript" activiti:autoStoreVariables="true">\012      <script>counter++;\015\012println("intermediate step, counter = " + counter);\015\012</script>\012    </scriptTask>\012    <sequenceFlow id="flow1" sourceRef="firstStep" targetRef="intermediateStep"></sequenceFlow>\012    <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>\012    <sequenceFlow id="flow2" sourceRef="intermediateStep" targetRef="exclusivegateway1"></sequenceFlow>\012    <sequenceFlow id="flow5" sourceRef="exclusivegateway1" targetRef="lastStep">\012      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${counter >= limit}]]></conditionExpression>\012    </sequenceFlow>\012    <sequenceFlow id="flow6" sourceRef="startevent1" targetRef="firstStep"></sequenceFlow>\012    <endEvent id="endevent1" name="End"></endEvent>\012    <sequenceFlow id="flow7" sourceRef="lastStep" targetRef="endevent1"></sequenceFlow>\012    <sequenceFlow id="flow8" sourceRef="exclusivegateway1" targetRef="timerintermediatecatchevent1">\012      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${counter < limit}]]></conditionExpression>\012    </sequenceFlow>\012    <intermediateCatchEvent id="timerintermediatecatchevent1" name="TimerCatchEvent">\012      <timerEventDefinition>\012        <timeDuration>PT10S</timeDuration>\012      </timerEventDefinition>\012    </intermediateCatchEvent>\012    <sequenceFlow id="flow9" sourceRef="timerintermediatecatchevent1" targetRef="intermediateStep"></sequenceFlow>\012  </process>\012  <bpmndi:BPMNDiagram id="BPMNDiagram_MyTimerLoopProcess">\012    <bpmndi:BPMNPlane bpmnElement="MyTimerLoopProcess" id="BPMNPlane_MyTimerLoopProcess">\012      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">\012        <omgdc:Bounds height="35.0" width="35.0" x="210.0" y="180.0"></omgdc:Bounds>\012      </bpmndi:BPMNShape>\012      <bpmndi:BPMNShape bpmnElement="firstStep" id="BPMNShape_firstStep">\012        <omgdc:Bounds height="55.0" width="105.0" x="300.0" y="170.0"></omgdc:Bounds>\012      </bpmndi:BPMNShape>\012      <bpmndi:BPMNShape bpmnElement="lastStep" id="BPMNShape_lastStep">\012        <omgdc:Bounds height="55.0" width="105.0" x="740.0" y="170.0"></omgdc:Bounds>\012      </bpmndi:BPMNShape>\012      <bpmndi:BPMNShape bpmnElement="intermediateStep" id="BPMNShape_intermediateStep">\012        <omgdc:Bounds height="71.0" width="105.0" x="480.0" y="162.0"></omgdc:Bounds>\012      </bpmndi:BPMNShape>\012      <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">\012        <omgdc:Bounds height="40.0" width="40.0" x="625.0" y="177.0"></omgdc:Bounds>\012      </bpmndi:BPMNShape>\012      <bpmndi:BPMNShape bpmnElement="timerintermediatecatchevent1" id="BPMNShape_timerintermediatecatchevent1">\012        <omgdc:Bounds height="35.0" width="35.0" x="510.0" y="30.0"></omgdc:Bounds>\012      </bpmndi:BPMNShape>\012      <bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">\012        <omgdc:Bounds height="35.0" width="35.0" x="887.0" y="180.0"></omgdc:Bounds>\012      </bpmndi:BPMNShape>\012      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">\012        <omgdi:waypoint x="405.0" y="197.0"></omgdi:waypoint>\012        <omgdi:waypoint x="480.0" y="197.0"></omgdi:waypoint>\012      </bpmndi:BPMNEdge>\012      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">\012        <omgdi:waypoint x="585.0" y="197.0"></omgdi:waypoint>\012        <omgdi:waypoint x="625.0" y="197.0"></omgdi:waypoint>\012      </bpmndi:BPMNEdge>\012      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">\012        <omgdi:waypoint x="665.0" y="197.0"></omgdi:waypoint>\012        <omgdi:waypoint x="740.0" y="197.0"></omgdi:waypoint>\012      </bpmndi:BPMNEdge>\012      <bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">\012        <omgdi:waypoint x="245.0" y="197.0"></omgdi:waypoint>\012        <omgdi:waypoint x="300.0" y="197.0"></omgdi:waypoint>\012      </bpmndi:BPMNEdge>\012      <bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">\012        <omgdi:waypoint x="845.0" y="197.0"></omgdi:waypoint>\012        <omgdi:waypoint x="887.0" y="197.0"></omgdi:waypoint>\012      </bpmndi:BPMNEdge>\012      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">\012        <omgdi:waypoint x="645.0" y="177.0"></omgdi:waypoint>\012        <omgdi:waypoint x="583.0" y="77.0"></omgdi:waypoint>\012        <omgdi:waypoint x="527.0" y="65.0"></omgdi:waypoint>\012      </bpmndi:BPMNEdge>\012      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">\012        <omgdi:waypoint x="527.0" y="65.0"></omgdi:waypoint>\012        <omgdi:waypoint x="532.0" y="162.0"></omgdi:waypoint>\012      </bpmndi:BPMNEdge>\012    </bpmndi:BPMNPlane>\012  </bpmndi:BPMNDiagram>\012</definitions>.

17:45:06,831 ERROR [stderr] (pool-6-thread-3) ### The error may exist in org/activiti/db/mapping/entity/Resource.xml

17:45:06,831 ERROR [stderr] (pool-6-thread-3) ### The error may involve org.activiti.engine.impl.persistence.entity.ResourceEntity.selectResourcesByDeploymentId-Inline

17:45:06,832 ERROR [stderr] (pool-6-thread-3) ### The error occurred while setting parameters

17:45:06,832 ERROR [stderr] (pool-6-thread-3) ### SQL: select * from ACT_GE_BYTEARRAY where DEPLOYMENT_ID_ = ? order by NAME_ asc