/**获取发起人
* @param PROC_INST_ID_ //流程实例ID
* @from fhadmin.cn
*/
protected String getInitiator(String PROC_INST_ID_) {
HistoricProcessInstance hip = historyService.createHistoricProcessInstanceQuery().processInstanceId(PROC_INST_ID_).singleResult(); //获取历史流程实例
List<HistoricActivityInstance> hais = historyService.createHistoricActivityInstanceQuery().processInstanceId(PROC_INST_ID_)
.orderByHistoricActivityInstanceId().asc().list(); //获取流程中已经执行的节点,按照执行先后顺序排序
BpmnModel bpmnModel = repositoryService.getBpmnModel(hip.getProcessDefinitionId()); // 获取bpmnModel
List<FlowNode> historicFlowNodeList = new LinkedList<FlowNode>(); //全部活动实例
for(HistoricActivityInstance hai : hais) {
historicFlowNodeList.add((FlowNode) bpmnModel.getMainProcess().getFlowElement(hai.getActivityId(), true));
if(hai.getAssignee() != null) {
return hai.getAssignee(); //不为空的第一个节点办理人就是发起人
}
}
return null;
}