activiti中使用定时器在指定时间内完成任务
use of timer in activiti to complete task within a specified time
我创建了一个使用计时器的工作流,即我想在用户任务中使用计时器。这意味着如果用户没有在指定时间内执行他的任务,那么该任务将从他的待处理任务列表中清除,并且令牌将移动到工作流中的指定节点。
我的 bmpn.xml 文件是:
<process id="newprocess6" isExecutable="true">
<startEvent id="start" name="Start Consulting" activiti:initiator="initiator">
<extensionElements>
<activiti:formProperty id="hname" name="Hospital Name" type="string"> </activiti:formProperty>
<activiti:formProperty id="dname" name="Doctor Name" type="string"> </activiti:formProperty>
</extensionElements>
</startEvent>
<userTask id="usertask1" name="Start Consulting with seema" activiti:assignee="seema">
<extensionElements>
<activiti:formProperty id="consult" name="consult" type="enum">
<activiti:value id="true" name="true"></activiti:value>
<activiti:value id="false" name="false"></activiti:value> </activiti:formProperty>
</extensionElements>
</userTask>
<endEvent id="end1"></endEvent>
<boundaryEvent id="timer2" attachedToRef="usertask1" cancelActivity="true">
<timerEventDefinition>
<timeDuration>PT2M</timeDuration>
</timerEventDefinition>
</boundaryEvent>
<userTask id="usertask2" name="Start Consulting with saurabh" activiti:assignee="saurabh">
<extensionElements>
<activiti:formProperty id="consult" name="consult" type="enum">
<activiti:value id="true" name="true"></activiti:value>
<activiti:value id="false" name="false"></activiti:value>
</activiti:formProperty>
</extensionElements>
</userTask>
<endEvent id="end2"></endEvent>
<sequenceFlow id="flow1" sourceRef="start" targetRef="usertask1"></sequenceFlow>
<sequenceFlow id="flow2" sourceRef="usertask1" targetRef="end1"></sequenceFlow>
<sequenceFlow id="flow4" sourceRef="usertask2" targetRef="end2"></sequenceFlow>
<sequenceFlow id="flow3" sourceRef="timer2" targetRef="usertask2"></sequenceFlow>
</process>
据我所知,如果用户 seema 没有在 2 分钟内完成她的任务,那么该任务将从 seema 的待处理任务列表中清除,并应移至用户 saurabh 的待处理任务列表。但是任务并没有移动到 saurabh 的待处理任务列表中。
请帮我。
提前致谢。
查看 Activiti 文档:http://www.activiti.org/userguide/#timerEventDefinitions
timeDuration. To specify how long the timer should run before it is
fired, a timeDuration can be specified as sub-element of
timerEventDefinition. The format used is the ISO 8601 format (as
required by the BPMN 2.0 specification). Example (interval lasting 10
days): P10D
一旦您的用户任务开始,就会执行指定的持续时间。这段时间结束后,您的计时器边界事件将被触发,您可以转到下一个用户任务
我创建了一个使用计时器的工作流,即我想在用户任务中使用计时器。这意味着如果用户没有在指定时间内执行他的任务,那么该任务将从他的待处理任务列表中清除,并且令牌将移动到工作流中的指定节点。 我的 bmpn.xml 文件是:
<process id="newprocess6" isExecutable="true">
<startEvent id="start" name="Start Consulting" activiti:initiator="initiator">
<extensionElements>
<activiti:formProperty id="hname" name="Hospital Name" type="string"> </activiti:formProperty>
<activiti:formProperty id="dname" name="Doctor Name" type="string"> </activiti:formProperty>
</extensionElements>
</startEvent>
<userTask id="usertask1" name="Start Consulting with seema" activiti:assignee="seema">
<extensionElements>
<activiti:formProperty id="consult" name="consult" type="enum">
<activiti:value id="true" name="true"></activiti:value>
<activiti:value id="false" name="false"></activiti:value> </activiti:formProperty>
</extensionElements>
</userTask>
<endEvent id="end1"></endEvent>
<boundaryEvent id="timer2" attachedToRef="usertask1" cancelActivity="true">
<timerEventDefinition>
<timeDuration>PT2M</timeDuration>
</timerEventDefinition>
</boundaryEvent>
<userTask id="usertask2" name="Start Consulting with saurabh" activiti:assignee="saurabh">
<extensionElements>
<activiti:formProperty id="consult" name="consult" type="enum">
<activiti:value id="true" name="true"></activiti:value>
<activiti:value id="false" name="false"></activiti:value>
</activiti:formProperty>
</extensionElements>
</userTask>
<endEvent id="end2"></endEvent>
<sequenceFlow id="flow1" sourceRef="start" targetRef="usertask1"></sequenceFlow>
<sequenceFlow id="flow2" sourceRef="usertask1" targetRef="end1"></sequenceFlow>
<sequenceFlow id="flow4" sourceRef="usertask2" targetRef="end2"></sequenceFlow>
<sequenceFlow id="flow3" sourceRef="timer2" targetRef="usertask2"></sequenceFlow>
</process>
据我所知,如果用户 seema 没有在 2 分钟内完成她的任务,那么该任务将从 seema 的待处理任务列表中清除,并应移至用户 saurabh 的待处理任务列表。但是任务并没有移动到 saurabh 的待处理任务列表中。 请帮我。 提前致谢。
查看 Activiti 文档:http://www.activiti.org/userguide/#timerEventDefinitions
timeDuration. To specify how long the timer should run before it is fired, a timeDuration can be specified as sub-element of timerEventDefinition. The format used is the ISO 8601 format (as required by the BPMN 2.0 specification). Example (interval lasting 10 days): P10D
一旦您的用户任务开始,就会执行指定的持续时间。这段时间结束后,您的计时器边界事件将被触发,您可以转到下一个用户任务