[color=red]任务委托:[/color]
签收了的:
未签收的:
[color=red]有一个节点的Id怎么得到这个节点的Activity:[/color]
[color=red]获得当前任务的所有节点:[/color]
[color=red]获取历史节点信息:[/color]
[color=red]获取activiti变量:[/color]
第一种:
第二种:
[color=red]获取当前任务,通过processinstanceId:[/color]
通过表达式分配任务:
[img]http://dl2.iteye.com/upload/attachment/0087/7861/c10543c9-4332-342a-a29d-b8ed679efbd8.jpg[/img]
变量通过map传递
[color=red]删除流程:[/color]
流程没有结束: runtimeService.deleteProcessInstance(processInstanceId,"");
historyService.deleteHistoricProcessInstance(procesInstanceId);(顺序不能换)
流程已经结束:historyService.deleteHistoricProcessInstance(procesInstanceId);
签收了的:
taskService.delegateTask(taskId, userId);
未签收的:
taskService.addCandidateUser(taskId, userId);
[color=red]有一个节点的Id怎么得到这个节点的Activity:[/color]
processDefinitionEntity.findExctivity(activitiyId)
[color=red]获得当前任务的所有节点:[/color]
ProcessDefinitionEntity processDefinition1 = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService)
.getDeployedProcessDefinition(processInstance.getProcessDefinitionId());
List<ActivityImpl> activitiList = processDefinition1.getActivities();//获得当前任务的所有节点
[color=red]获取历史节点信息:[/color]
List<HistoricActivityInstance> hiaciList = getHistoryService().createHistoricActivityInstanceQuery().processInstanceId(processInstanceId).finished().orderByHistoricActivityInstanceEndTime().asc().list();
HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
lastActivitiHandleUserName=historicProcessInstance.getStartUserId();
[color=red]获取activiti变量:[/color]
第一种:
Map<String, Object> variables1 = runtimeService.getVariables("processInstanceId");
第二种:
List<HistoricVariableInstance> list = historyService.createHistoricVariableInstanceQuery().processInstanceId("6310").list();
for (HistoricVariableInstance variableInstance : list) {
System.out.println("variable: " + variableInstance.getVariableName() + " = " + variableInstance.getValue());
}
[color=red]获取当前任务,通过processinstanceId:[/color]
Task task11= taskService.createTaskQuery().processInstanceId(processinstanceId).singleResult();
通过表达式分配任务:
[img]http://dl2.iteye.com/upload/attachment/0087/7861/c10543c9-4332-342a-a29d-b8ed679efbd8.jpg[/img]
变量通过map传递
[color=red]删除流程:[/color]
流程没有结束: runtimeService.deleteProcessInstance(processInstanceId,"");
historyService.deleteHistoricProcessInstance(procesInstanceId);(顺序不能换)
流程已经结束:historyService.deleteHistoricProcessInstance(procesInstanceId);