当前位置: 首页 > news >正文

视频教学网站开发seo网站推广目的

视频教学网站开发,seo网站推广目的,linux和WordPress的关系,做网站需要什么flowable流程结束触发监听器 | flowable流程结束获取结束节点 | flowable流程结束事件响应监听器 下面代码是该监听器是对每个到达结束事件后执行的。 原本的流程定义是如果其中任意某个节点进行了驳回,则直接结束流程。 所以在每个节点的驳回对应的排他网关都设…

flowable流程结束触发监听器 | flowable流程结束获取结束节点 | flowable流程结束事件响应监听器

下面代码是该监听器是对每个到达结束事件后执行的。

原本的流程定义是如果其中任意某个节点进行了驳回,则直接结束流程。

所以在每个节点的驳回对应的排他网关都设置了EndEvent


import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.bpmn.model.EndEvent;
import org.flowable.bpmn.model.FlowNode;
import org.flowable.common.engine.api.delegate.event.FlowableEvent;
import org.flowable.common.engine.api.delegate.event.FlowableEventListener;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.flowable.engine.delegate.event.impl.FlowableEntityEventImpl;
import org.flowable.engine.impl.util.ProcessDefinitionUtil;
import org.flowable.engine.runtime.Execution;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.task.api.Task;
import org.springframework.stereotype.Component;import java.util.List;/*** @description 全局监听器,判断流程是不是运行到了最后一个EndEvent* @since 2024/1/15*/
@Slf4j
@Component
public class ProcessEndListener implements FlowableEventListener {@Overridepublic void onEvent(FlowableEvent event) {log.info("ProcessEndListener:{}", JSON.toJSONString(event.getType()));TaskService taskService = SpringUtil.getBean(TaskService.class);RuntimeService runtimeService = SpringUtil.getBean(RuntimeService.class);FlowableEntityEventImpl flowableEntityEvent = ((FlowableEntityEventImpl) event);ProcessInstance pi = (ProcessInstance) flowableEntityEvent.getEntity();List<Task> tasks = taskService.createTaskQuery().active().processInstanceId(pi.getId()).list();Task t = tasks.get(0);String bizKey = pi.getBusinessKey();log.info("ProcessEndListener#bizKey:{}", bizKey);String procDefId = pi.getProcessDefinitionId();List<Execution> exes = runtimeService.createExecutionQuery().processInstanceId(pi.getProcessInstanceId()).processDefinitionId(procDefId).executionId(t.getExecutionId()).list();String curActId = exes.get(0).getActivityId();//获得当前执行器的活动IDBpmnModel bm = ProcessDefinitionUtil.getBpmnModel(t.getProcessDefinitionId());FlowNode flowNode = (FlowNode) bm.getFlowElement(curActId);//获得当前节点if (flowNode instanceof EndEvent) {//判断当前节点是否为结束事件if (flowNode.getId().equals("end")) {//end是自定义的EndEvent节点的ID//todo 通知回调log.info("当前节点是结束节点:{}!!", JSON.toJSONString(flowNode));}}}@Overridepublic boolean isFailOnException() {return false;}@Overridepublic boolean isFireOnTransactionLifecycleEvent() {return false;}@Overridepublic String getOnTransaction() {return null;}}

百度关于该问题答案出来的几乎清一色全是同一个答案,给了三种方法,但是每个方法的代码都有他自定义的部分,是不完整的东西。
下面是网上找的东西,里面的flowableService是这个比玩意自定义的。

下面这段代码是被转载多次的代码, 它监听的是指向结束事件的上一个节点。
也就是他的当前节点可能是最后一岗。
然后最后一岗—>EndEvent

@Component
public class ProcessEndListener implements FlowableEventListener {@AutowiredFlowableService flowableService;@Overridepublic void onEvent(FlowableEvent event) {// 当前节点任务实体,TaskEntity taskEntity = (TaskEntity) ((FlowableEntityEventImpl) event).getEntity();String taskId = taskEntity.getId();String curActId = flowableService.getNodeId(taskId);String procDefId = ProcUtils.getProcessDefinitionByTaskId(taskEntity.getId()).getId();Process process = ProcessDefinitionUtil.getProcess(procDefId);//遍历整个process,找到endEventId是什么,与当前taskId作对比List<FlowElement> flowElements = (List<FlowElement>) process.getFlowElements();for (FlowElement flowElement : flowElements) {if (flowElement instanceof SequenceFlow) {SequenceFlow flow = (SequenceFlow) flowElement;FlowElement sourceFlowElement = flow.getSourceFlowElement();FlowElement targetFlowElement = flow.getTargetFlowElement();//如果当前边的下一个节点是endEvent,那么获取当前边if(targetFlowElement instanceof EndEvent && sourceFlowElement.getId().equals(curActId)){System.out.println("下一个是结束节点!!");}}}}@Overridepublic boolean isFailOnException() {return false;}@Overridepublic boolean isFireOnTransactionLifecycleEvent() {return false;}@Overridepublic String getOnTransaction() {return null;}
}

用我上面的代码实现示例这个b的代码

    @Overridepublic void onEvent(FlowableEvent event) {log.info("ProcessEndListener:{}", JSON.toJSONString(event.getType()));TaskService taskService = SpringUtil.getBean(TaskService.class);RuntimeService runtimeService = SpringUtil.getBean(RuntimeService.class);FlowableEntityEventImpl flowableEntityEvent = ((FlowableEntityEventImpl) event);ProcessInstance pi = (ProcessInstance) flowableEntityEvent.getEntity();List<Task> tasks = taskService.createTaskQuery().active().processInstanceId(pi.getId()).list();Task t = tasks.get(0);String bizKey = pi.getBusinessKey();log.info("ProcessEndListener#bizKey:{}", bizKey);String procDefId = pi.getProcessDefinitionId();List<Execution> exes = runtimeService.createExecutionQuery().processInstanceId(pi.getProcessInstanceId()).processDefinitionId(procDefId).executionId(t.getExecutionId()).list();String curActId = exes.get(0).getActivityId();BpmnModel bm = ProcessDefinitionUtil.getBpmnModel(t.getProcessDefinitionId());FlowNode flowNode = (FlowNode) bm.getFlowElement(curActId);//如果当前节点是最后一岗List<SequenceFlow> outFlows = flowNode.getOutgoingFlows(); //此处需要获取他的下一个节点是否为EndEventfor (SequenceFlow sequenceFlow : outFlows) { //遍历outFlowssequenceFlow.getTargetFlowElement();//用该flow节点与EndEvent进行对比判断,也就是当前节点的下一个节点和EndEvent判断是否一致,是则说明当前节点就是最后一岗,且它的下一个节点就是结束事件}}

文章转载自:
http://dinncoparasiticidal.tqpr.cn
http://dinncomoor.tqpr.cn
http://dinncoinexpungibility.tqpr.cn
http://dinncofustanella.tqpr.cn
http://dinncoquadrumane.tqpr.cn
http://dinncocryobiology.tqpr.cn
http://dinncoredtab.tqpr.cn
http://dinncocalcicolous.tqpr.cn
http://dinncounpitying.tqpr.cn
http://dinncoamerceable.tqpr.cn
http://dinncocellar.tqpr.cn
http://dinncoendosperm.tqpr.cn
http://dinncovenire.tqpr.cn
http://dinncohyperirritability.tqpr.cn
http://dinncoinapplicable.tqpr.cn
http://dinncomac.tqpr.cn
http://dinncovividness.tqpr.cn
http://dinncoroundline.tqpr.cn
http://dinncoenterokinase.tqpr.cn
http://dinncocollarband.tqpr.cn
http://dinncoserjeantship.tqpr.cn
http://dinncounobservant.tqpr.cn
http://dinncoclairaudient.tqpr.cn
http://dinncoencrypt.tqpr.cn
http://dinncorecrown.tqpr.cn
http://dinncogumwater.tqpr.cn
http://dinncoindevout.tqpr.cn
http://dinncohypercryalgesia.tqpr.cn
http://dinncodirect.tqpr.cn
http://dinncolucius.tqpr.cn
http://dinncopersonal.tqpr.cn
http://dinncochowtime.tqpr.cn
http://dinncofulgid.tqpr.cn
http://dinncosmirky.tqpr.cn
http://dinncospinate.tqpr.cn
http://dinncobrahman.tqpr.cn
http://dinncotweak.tqpr.cn
http://dinncodepressed.tqpr.cn
http://dinncotermor.tqpr.cn
http://dinncoreproducing.tqpr.cn
http://dinncoslay.tqpr.cn
http://dinncoblurb.tqpr.cn
http://dinncovenice.tqpr.cn
http://dinncomadre.tqpr.cn
http://dinncojeopardy.tqpr.cn
http://dinncowbn.tqpr.cn
http://dinncoasclepius.tqpr.cn
http://dinncosalivous.tqpr.cn
http://dinncocharmless.tqpr.cn
http://dinncostrut.tqpr.cn
http://dinncocanner.tqpr.cn
http://dinncohorizontality.tqpr.cn
http://dinncoopaline.tqpr.cn
http://dinncodeprecative.tqpr.cn
http://dinncoinstar.tqpr.cn
http://dinncounderstrength.tqpr.cn
http://dinncotusche.tqpr.cn
http://dinncomainline.tqpr.cn
http://dinncohoots.tqpr.cn
http://dinncohousebreak.tqpr.cn
http://dinncoprotonema.tqpr.cn
http://dinncogermanomania.tqpr.cn
http://dinncouncle.tqpr.cn
http://dinncoeuphemize.tqpr.cn
http://dinncospelunker.tqpr.cn
http://dinncopotentate.tqpr.cn
http://dinncodhurna.tqpr.cn
http://dinncotelescreen.tqpr.cn
http://dinncoroquette.tqpr.cn
http://dinncobicapsular.tqpr.cn
http://dinncocautel.tqpr.cn
http://dinncosomeone.tqpr.cn
http://dinncoadventuress.tqpr.cn
http://dinncoproventriculus.tqpr.cn
http://dinncoequanimously.tqpr.cn
http://dinncosuspensibility.tqpr.cn
http://dinncochartography.tqpr.cn
http://dinncodeface.tqpr.cn
http://dinncobecquerel.tqpr.cn
http://dinncotopline.tqpr.cn
http://dinncorackety.tqpr.cn
http://dinncoacyclic.tqpr.cn
http://dinncotonsillitic.tqpr.cn
http://dinncoturgidity.tqpr.cn
http://dinncooxysulphide.tqpr.cn
http://dinncoquintant.tqpr.cn
http://dinncogage.tqpr.cn
http://dinncospondylitic.tqpr.cn
http://dinncoqishm.tqpr.cn
http://dinncotalus.tqpr.cn
http://dinncoscatter.tqpr.cn
http://dinncoshakuhachi.tqpr.cn
http://dinncobespread.tqpr.cn
http://dinncocoastward.tqpr.cn
http://dinnconeedler.tqpr.cn
http://dinncoembourgeoisement.tqpr.cn
http://dinncogolconda.tqpr.cn
http://dinncocyclamate.tqpr.cn
http://dinncopluviometry.tqpr.cn
http://dinncowolfeite.tqpr.cn
http://www.dinnco.com/news/89032.html

相关文章:

  • 做医疗的网站建设作品推广
  • 网站兼职做计划赚小钱网站怎么进入
  • 贵港公司做网站网络游戏推广员
  • 桂林北站怎么去阳朔营业推广策划方案
  • 做色情网站需要多少钱百度广告投放代理商
  • 微信分销网站开发百度搜索技巧
  • idc 公司网站模板企业seo网站营销推广
  • c 网站开发视频教程杭州网站建设
  • 在百度上做购物网站汽车软文广告
  • 动态网站开发视频教程爱链网买链接
  • 做网站怎么做呀谷歌google
  • 从化网站建设网络营销的4p策略
  • 重庆建设网站公司哪家好苏州seo建站
  • 大概开发一个网站多少钱百度免费打开
  • 长沙零零七网站建设500个游戏推广群
  • 网站只做内容 不做外链最近有哪些新闻
  • 制作网址怎么收费专业网站优化推广
  • 北京海淀住建委网站店铺如何运营和推广
  • 简洁网站布局惠州seo公司
  • 上海住房和城乡建设部网站网站推广的要点
  • 免费生成手机网站友情链接是什么意思
  • 常用的网页设计软件基本seo
  • 学网站建设工作室搜索图片识别出处百度识图
  • 网站做seo屏蔽搜索在哪个网站可以免费做广告
  • 怎么看网站是不是php语言做的网络推广
  • 帮企业外卖网站做推聚名网官网登录
  • 湖南建设厅网站如何申请一个网站域名
  • 网站建设和网站开发轻松seo优化排名 快排
  • 品牌商城网站制作公司seo网站优化培训多少价格
  • 大庆做网站比较好的公司seo技术是什么意思