/*启动流程实例*可以在启动流程时把所有流程变量设置好*/@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 }
/**执行流程* 也可以在执行任务时候设置流程变量*/@Testpublic void complete(){ //Task task = getCurrentTask(); String taskId = "60005"; Map<String,Object> map = new HashMap<String,Object>() ; map.put("message",2); taskService.complete(taskId,map);}
时间: 2024-11-05 14:37:57