In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article shows you how activiti 5.16 businessKey handles for null. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
Activiti version 5.16
Cause: when a subprocess is created, businesskey is not passed.
The solution is as follows:
1. Create a listening class:
Import org.activiti.engine.delegate.event.ActivitiEntityEvent;import org.activiti.engine.delegate.event.ActivitiEvent;import org.activiti.engine.delegate.event.ActivitiEventListener;import org.activiti.engine.impl.persistence.entity.ExecutionEntity;import org.activiti.engine.impl.persistence.entity.TaskEntity;import org.apache.commons.lang3.StringUtils;import org.slf4j.Logger;import org.slf4j.LoggerFactory;public class BusinessKeyInjectionActivitiEventListener implements ActivitiEventListener {private Logger log = LoggerFactory.getLogger (getClass ()) @ Override public void onEvent (ActivitiEvent event) {switch (event.getType ()) {case TASK_CREATED: if (event instanceof ActivitiEntityEvent) {ActivitiEntityEvent activityEntityEvent = (ActivitiEntityEvent) event; TaskEntity taskEntity = (TaskEntity) activityEntityEvent.getEntity (); ExecutionEntity exEntity = taskEntity.getExecution () String key= exEntity.getBusinessKey (); log.info ("get the businessKey of the process instance of the current task: {}", key); if (StringUtils.isEmpty (key)) {ExecutionEntity superExecEntity = exEntity.getSuperExecution (); key=superExecEntity.getBusinessKey () If (StringUtils.isEmpty (key)) {key=superExecEntity.getProcessInstance () .getBusinessKey ();} log.info ("get the businessKey of a process instance on the current task: {}", key) Log.info ("set businessKey: {}" for the current process instance, key); exEntity.setBusinessKey (key); / / it is critical to make businessKey effective here. ExEntity.updateProcessBusinessKey (key);} break;} default: break;} @ Override public boolean isFailOnException () {/ / TODO Auto-generated method stub return false;}}
2. Configure monitoring:
This is how activiti 5.16 businessKey handles for null. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.