gpt4 book ai didi

java - Activiti - 继续执行而不完成子流程

转载 作者:行者123 更新时间:2023-12-01 09:16:48 25 4
gpt4 key购买 nike

我们正在使用 Activiti 工作流引擎,我们想知道如果子流程未完成,是否可以继续执行流程。

例如,我们有一个子进程A和一个子进程B,如下所示,A->B。 A 有两个端节点,一个正在执行,另一个正在等待用户任务完成。所以我猜测子进程 A 尚未完成,但我们希望继续执行并启动 B。

问题是,我们正在寻找影响最小的解决方案,因为我们已经在生产中拥有庞大的工作流程,如果我们想要添加子流程的话。

在这种情况下你们有什么建议?流程/执行/任务变量在这种情况下如何工作?

编辑:我们现在正尝试像 Greg Harley - BP3 建议的那样开始这个测试用例,但中间的 catch 事件永远不会被调用。

enter image description here

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<signal id="alertSignal" name="alert" />
<process id="myProcess" name="myProcess" isExecutable="true">
<subProcess id="subprocess1" name="Sub Process">
<startEvent id="startevent2" name="Start"></startEvent>
<endEvent id="endevent1" name="End"></endEvent>
<userTask id="verifico-id-transitorio-paciente" name="verifico-id-transitorio-paciente">
<extensionElements>
<activiti:taskListener event="create" expression="#{INTERNA_LOGICA_TRAMITE.setearPermisoTarea(task)}"></activiti:taskListener>
<activiti:taskListener event="create" expression="#{INTERNA_LOGICA_TRAMITE.setearPermisoDependencia(task)}"></activiti:taskListener>
</extensionElements>
</userTask>
<sequenceFlow id="flow1" sourceRef="startevent2" targetRef="verifico-id-transitorio-paciente"></sequenceFlow>
<sequenceFlow id="flow2" sourceRef="verifico-id-transitorio-paciente" targetRef="parallelgateway1"></sequenceFlow>
<parallelGateway id="parallelgateway1" name="Parallel Gateway"></parallelGateway>
<sequenceFlow id="flow10" sourceRef="parallelgateway1" targetRef="ingreso-formulario-ConMed"></sequenceFlow>
<intermediateThrowEvent id="signalintermediatethrowevent1" name="SignalThrowEvent">
<signalEventDefinition signalRef="alertSignal"></signalEventDefinition>
</intermediateThrowEvent>
<sequenceFlow id="flow11" sourceRef="parallelgateway1" targetRef="signalintermediatethrowevent1"></sequenceFlow>
<userTask id="ingreso-formulario-ConMed" name="ingreso-formulario-ConMed">
<extensionElements>
<activiti:taskListener event="create" expression="#{INTERNA_LOGICA_TRAMITE.setearPermisoTarea(task)}"></activiti:taskListener>
<activiti:taskListener event="create" expression="#{INTERNA_LOGICA_TRAMITE.setearPermisoDependencia(task)}"></activiti:taskListener>
</extensionElements>
</userTask>
<sequenceFlow id="flow13" sourceRef="ingreso-formulario-ConMed" targetRef="endevent1"></sequenceFlow>
</subProcess>
<subProcess id="subprocess2" name="Sub Process">
<startEvent id="startevent3" name="Start"></startEvent>
<endEvent id="endevent2" name="End"></endEvent>
<userTask id="ingreso-formulario-Con" name="ingreso-formulario-Con">
<extensionElements>
<activiti:taskListener event="create" expression="#{INTERNA_LOGICA_TRAMITE.setearPermisoTarea(task)}"></activiti:taskListener>
<activiti:taskListener event="create" expression="#{INTERNA_LOGICA_TRAMITE.setearPermisoDependencia(task)}"></activiti:taskListener>
</extensionElements>
</userTask>
<sequenceFlow id="flow5" sourceRef="startevent3" targetRef="ingreso-formulario-Con"></sequenceFlow>
<sequenceFlow id="flow6" sourceRef="ingreso-formulario-Con" targetRef="endevent2"></sequenceFlow>
</subProcess>
<startEvent id="startevent1" name="Start"></startEvent>
<subProcess id="subprocess3" name="Sub Process">
<userTask id="modifico-formulario-ConMed" name="modifico-formulario-ConMed">
<extensionElements>
</extensionElements>
</userTask>
<startEvent id="startevent4" name="Start"></startEvent>
<endEvent id="endevent3" name="End"></endEvent>
<sequenceFlow id="flow8" sourceRef="startevent4" targetRef="modifico-formulario-ConMed"></sequenceFlow>
<sequenceFlow id="flow9" sourceRef="modifico-formulario-ConMed" targetRef="endevent3"></sequenceFlow>
</subProcess>
<sequenceFlow id="flow3" sourceRef="startevent1" targetRef="subprocess1"></sequenceFlow>
<sequenceFlow id="flow4" sourceRef="subprocess1" targetRef="subprocess2"></sequenceFlow>
<endEvent id="endevent4" name="End"></endEvent>
<sequenceFlow id="flow7" sourceRef="subprocess2" targetRef="endevent4"></sequenceFlow>
<startEvent id="signalstartevent1" name="Signal start">
<signalEventDefinition signalRef="alertSignal"></signalEventDefinition>
</startEvent>
<sequenceFlow id="flow14" sourceRef="signalstartevent1" targetRef="subprocess3"></sequenceFlow>
</process>
</definitions>

最佳答案

不确定这是否是您想要的,但包含“the Dogs”任务的子流程只会在用户任务 2 完成后调用。在示例中,用户任务 2 是一个用户任务,但它也可以很容易地成为一个服务或脚本任务。这样,只要先决条件完成,子流程 2(包含狗)就会运行,无论用户任务 1 是否完成。

如果我错过了您的具体要求,请告诉我。格雷格

关于java - Activiti - 继续执行而不完成子流程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40489214/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com