activiti排他网关

 

/*启动流程实例
*可以在启动流程时把所有流程变量设置好
*/
@Test
public void startProcessInstance(){
//流程定义key
String processDefinitionKey = "leave";
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("message",2);
ProcessInstance pi = runtimeService.startProcessInstanceByKey(processDefinitionKey,variables);
System.out.println("流程实例ID:"+pi.getId());
System.out.println("流程实例ID:"+pi.getProcessDefinitionId()); //helloworld:1:4
}

/**执行流程
* 也可以在执行任务时候设置流程变量
*/
@Test
public void complete(){
//Task task = getCurrentTask();
String taskId = "60005";
Map<String,Object> map = new HashMap<String,Object>() ;
map.put("message",2);
taskService.complete(taskId,map);
}

 

posted @ 2017-06-07 23:06  N神3  阅读(2211)  评论(0编辑  收藏  举报