AnsweredAssumed Answered

timer to fire receiveTask

Question asked by javacorner on Mar 22, 2015
Latest reply on Mar 22, 2015 by javacorner

I am implementing business workflow
my process is calling <strong>external system </strong>
I have to find some way to fix the case of the <strong>external system </strong> doesn't reply .
I am trying to use the solution of <em>jbarrez</em> at <a></a>
I added  <em>receiveTask</em> in case of error in<strong>external system </strong> call failure like following
<receiveTask id="waitTimer" name="wait for timer"></receiveTask>
    <exclusiveGateway id="isCallBackendSuccess" name="Is Call Backend Success"></exclusiveGateway>
    <sequenceFlow id="continue" name="continue" sourceRef="isCallBackendSuccess" targetRef="servicetaskContinue">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${backendAnswered== true}]]></conditionExpression>
    <sequenceFlow id="backerror" name="backerror" sourceRef="isCallBackendSuccess" targetRef="waitTimer">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${backendAnswered== false}]]></conditionExpression>
I created another process "cleanup " that will fire after time duration to search about all process instances that are waiting at "receiveTask" to send  "signal" to them to try to call the<strong>external system </strong> again like following
<process id="timerCleanup" name="TimerCleanup" isExecutable="true">
    <startEvent id="timerstartevent1" name="Timer start">
    <serviceTask id="cleanupTask" name="cleanupTask" activiti:class="me.ffusion.bpm.javaDelegates.Cleanup"></serviceTask>
    <sequenceFlow id="flow1" sourceRef="timerstartevent1" targetRef="cleanupTask"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow2" sourceRef="cleanupTask" targetRef="endevent1"></sequenceFlow>
my question is how to implement the java delegate for the timer "cleanupTask" to about all process instances that are waiting at "receiveTask" to send  "signal" to them to try to call the external system again.

I want to loop for all these instances and run the following statement .