论坛首页 Java企业应用论坛

jbpm的教程的例子之二 两个task

浏览 1702 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2009-06-08   最后修改:2009-09-17
当process流进task-node 't'的时候,进入wait-state,当两个task都被end的时候,process继续。

<process-definition name='simpleTask'>

<start-state>
<transition to='t' />
</start-state>

<task-node name='t'>

<task name='task0'>
<assignment class='test.task.TaskA' />
</task>
<task name='task1'>
<assignment class='test.task.TaskB' />
</task>

<transition to='end' />

</task-node>

<end-state name='end' />

</process-definition>

private static void endTasks(long piId) {

JbpmContext jbpmContext = JBPMUtil.getJbpmContext();
try {
ProcessInstance processInstance = jbpmContext
.getProcessInstance(piId);

Iterator<TaskInstance> iterator = processInstance
.getTaskMgmtInstance().getTaskInstances().iterator();

for (; iterator.hasNext();) {
TaskInstance taskInstance = iterator.next();
log.info("task instance name = " + taskInstance.getName());
log.info("task instance actor = " + taskInstance.getActorId());
taskInstance.end();
}

jbpmContext.save(processInstance);
} finally {
jbpmContext.close();
}
}
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics