JPDL
<process key="task" name="task" xmlns="http://jbpm.org/4.4/jpdl">
<start name="start1" g="243,29,48,48">
<transition name="提交到任务A" to="任务A" g="-63,-11"/>
</start>
<end name="end1" g="243,393,48,48"/>
<task assignee="A" name="任务A" g="224,115,92,52">
<transition name="提交到任务B" to="任务B" g="-77,-11"/>
</task>
<task assignee="B" name="任务B" g="220,221,92,52">
<transition name="提交到任务C" to="任务C" g="-83,-14"/>
</task>
<task assignee="C" name="任务C" g="224,308,92,52">
<transition name="通过" to="end1" g="-62,-25"/>
</task>
</process>
部署流程
repositoryService.createDeployment().addResourceFromClasspath("com/tgb/node/task/task.jpdl.xml").deploy();
创建流程实例
//流程部署KEY
ProcessInstance processInstance = executionService.startProcessInstanceByKey("task");
print("流程实例ID",processInstance.getId());
获取当前节点
//流程实例ID
String name = executionService.createProcessInstanceQuery().processInstanceId("task.290001").uniqueResult().findActiveActivityNames().toString();
print("当前节点名词:",name);
获得任务列表
List<Task> tasks = taskService.findPersonalTasks("A");
print("任务数量",tasks.size());
print("任务名词",tasks.get(0).getActivityName());
print("任务ID",tasks.get(0).getId());
完成任务
//任务ID
taskService.completeTask("290002");