当前位置:网站首页>Activiti obtains the initiator based on the process instance ID
Activiti obtains the initiator based on the process instance ID
2022-06-24 02:35:00 【FHAdmin】
/** Get originator
* @param PROC_INST_ID_ // Process instance ID
* @from fhadmin.cn
*/
protected String getInitiator(String PROC_INST_ID_) {
HistoricProcessInstance hip = historyService.createHistoricProcessInstanceQuery().processInstanceId(PROC_INST_ID_).singleResult(); // Get historical process instances
List<HistoricActivityInstance> hais = historyService.createHistoricActivityInstanceQuery().processInstanceId(PROC_INST_ID_)
.orderByHistoricActivityInstanceId().asc().list(); // Get the nodes that have been executed in the process , According to the order of execution
BpmnModel bpmnModel = repositoryService.getBpmnModel(hip.getProcessDefinitionId()); // obtain bpmnModel
List<FlowNode> historicFlowNodeList = new LinkedList<FlowNode>(); // All examples of activities
for(HistoricActivityInstance hai : hais) {
historicFlowNodeList.add((FlowNode) bpmnModel.getMainProcess().getFlowElement(hai.getActivityId(), true));
if(hai.getAssignee() != null) {
return hai.getAssignee(); // The first node handler that is not empty is the initiator
}
}
return null;
}边栏推荐
- How to recover the garbled words in the software?
- How about Tencent cloud game server? Can the cloud game server play games
- NTP synchronization clock server server and client settings
- Afnetworking server client
- Cloud rendering: cloud exhibition hall of Tencent digital ecology Conference - open roaming mode on cloud
- Afnetworking usage and cache processing
- Using robot framework to realize multi platform automated testing
- Network engineers must know the 10 technical points of IPv6. It is recommended to collect them!
- Looking at the future development direction of industrial Internet from the transformation of circulation links of large building materials
- The blue screen will be displayed at a remote location, and the error code kmode will be reported_ EXCEPTION_ NOT_ Handled, the DMP file has the keyword cdd dll
猜你喜欢
随机推荐
The same set of code returns normally sometimes and reports an error sometimes. Signature error authfailure SignatureFailure
How to build your own website? Is it difficult?
Leetcode838: push domino (medium)
Tornado code for file download
Afnetworking server client
How many graphics cards are required for cloud game servers? What should be paid attention to when purchasing servers
How to enable IPv6 network access for personal broadband
Internal reasons for cloud desktop unable to connect to the server and external reasons for cloud desktop connection failure
IPhone sending SMS implementation
DB2 database generates HTML patrol Report
Optimization of Clickhouse ConnectionPool link pool
How to calculate the trademark registration fee? How much does it cost to register a trademark?
An attempt to use Navicat tool to copy and export MySQL database data
The easydss on demand file upload interface calls postman to report an error. Failed to upload the file?
Coding -- the leader of R & D tools in the cloud native Era
Network engineers must know the 10 technical points of IPv6. It is recommended to collect them!
Tencent peace of mind ecological alliance was officially established as a linkage partner. Open technology helps "digital agriculture"
What about foreign trade companies? Is this another difficult year?
The United States offered 10million yuan to hunt down blackmail hackers and the energy industry became the "hardest hit" of phishing attacks | global network security hotspot
The technical route is based on UE4 for secondary development


