/*啟動流程實例
*可以在啟動流程時把所有流程變量設置好
*/
@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);
}