작업 흐름activiti의 시작 실례 대상, 조회 처리 작업, 처리할 작업 완료

1621 단어 도구류
/**
*  
*/
@Test
public void testStartProcess() {
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RuntimeService runtimeService = processEngine.getRuntimeService();
//1. 
Map map = new HashMap();
map.put("username", " ");
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("LeaveBillBetter", map);

System.out.println(" id:"+processInstance.getId());
}


/**
*  id, 
*/
@Test
public void testFindProcessIns() {
String processInsId = "50001"; 
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
Task task = processEngine.getTaskService().createTaskQuery().processInstanceId(processInsId).orderByProcessInstanceId().desc().singleResult();
System.out.println("taskId:"+task.getId());
System.out.println(" :"+task.getAssignee());
}

/**
*  
*/
@Test
public void testTask() {
String taskId = "50005"; 
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
TaskService taskService = processEngine.getTaskService();

taskService.complete(taskId);
System.out.println(" :"+taskId);

}

/**
*  
*/
@Test
public void testTaskChance() {
String taskId = "45003"; 
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
TaskService taskService = processEngine.getTaskService();

Map map = new HashMap();
map.put("outcome", " ");
taskService.complete(taskId,map);
System.out.println(" :"+taskId);

}

좋은 웹페이지 즐겨찾기