关于activity工作流常用操作(个人总结)

1、部署流程定义
repositoryService.createDeployment().addClasspathResource(path+filename).deploy();
2、删除流程定义
ProcessDefinitionQuery query =repositoryService.createProcessDefinitionQuery();
ProcessDefinition processDefinition = query.processDefinitionId(id).singleResult();
// 删除流程定义(级联)
repositoryService.deleteDeployment(processDefinition.getDeploymentId(), true);
3、根据流程定义key创建流程实例
ProcessDefinitionQuery query =repositoryService.createProcessDefinitionQuery();
ProcessDefinition processDefinition = query.processDefinitionId(id).singleResult();
// 删除流程定义(级联)
repositoryService.deleteDeployment(processDefinition.getDeploymentId(), true);
4、根据流程实例id和任务领取人名称完成任务
TaskQuery taskQuery = taskService.createTaskQuery();
Task task = taskQuery.processInstanceId(piId).taskAssignee(userId).singleResult();
taskService.complete(task.getId());
5、未完待续。。。

你可能感兴趣的:(activity)