flowable獲取流程發起人的三種方式
阿新 • • 發佈:2021-01-23
1、方式一:
// 流程發起人 ProcessInstance processInstance = SpringUtil.getBean(RuntimeService.class) .createProcessInstanceQuery() .processInstanceId(execution.getProcessInstanceId()) .singleResult(); String startUserId = processInstance.getStartUserId();
2、方式二:
// 獲取流程發起人
HistoricProcessInstance hi = SpringUtil.getBean(HistoryService.class).createHistoricProcessInstanceQuery()
.processInstanceId(execution.getProcessInstanceId())
.singleResult();
String startUserId = hi.getStartUserId();
3、方式三:
HistoryService historyService = SpringUtil.getBean(HistoryService.class); HistoricProcessInstance hi = historyService.createHistoricProcessInstanceQuery() .processInstanceId(execution.getProcessInstanceId()) .singleResult(); Long startUserId = Long.parseLong(hi.getStartUserId());