jerryfiunam (61) [Avatar] Offline
Hi again,

I would like to share this observation. I have implemented the GRAPHICAL CURRENT STATUS OF A PROCESS that was provided by the community using Rafaele.js. I was testing diferent process definitions in order to verify that everthing was ok. I tested a process definition that has a PARALLELGATEWAY as a FORK having one incoming sequence flow and two outgoing sequence flows, later there is another PARALLELEGATEWAY as a JOIN having two incoming sequence flows and just one outgoing sequence flow. The surprise was when I preview the graphical current statuts showing that the FORK was still alive along with the later task, but more surprising was when I review the history of the process where I realized that activiti-engine created TWO INSTANCES OF THE FORK PARALLELGATEWAY. I changed the process definition in order to create 3 PARALLEL TASKS rather than 2, and the result was the same: in the history there were 3 INSTANCES OF THE JOIN PARALLELGATWAY, moreover , even when the process instance was already finished, the 3 instances of the parallelgateway were not finished and that is a problem beacuse when I previewed the current status of the process instance GRAPHICALLY there was always that parallelgateway alive.

Taken in count the mentioned above, I have two doubs:

1. Is it correct that the number of instances of PARALLELGATEWAYS (as JOIN) are as many as incomming sequence flows? That is, if there are 5 incomming sequence flows to the JOIN, there will be then 5 instances of the JOIN? I think is a bit estrange smilie.

2. Despite if it is correct or not, why the PARALLELGATEWAY as JOIN is not being finished once it is finished? Given this, there are ACTIVITES ALIVE (JOIN's ) always.

Do you think both are bugs of the Activiti-Engine? If they are so, how can I report that in order to be corrected?

Thanks a lot smilie

tijs.rademakers (494) [Avatar] Offline
Re: Doubts about PARALLELGATEWAY object
Hi Jerry,

The parallel gateway is heavily tested in the Activiti Engine, so I'm confident that it works. Can you share a process definition where you see this behavior? When the parallel flows are joined the parallel gateway should be finished as well. Activiti creates separate executions for each parallel flow as well as one execution for the parallel gateway. Where in the history do you see that there are multiple instances of the parallel gateway?

Best regards.

jerryfiunam (61) [Avatar] Offline
Re: Doubts about PARALLELGATEWAY object
Of course Tijs, How can i send to you the .BPMN file and an Excel file that contains an example of what I get when I retrieve history?

I am getting the history thru this method:

List<HistoricActivityInstance> q = historyService

I reviewed the ACT_HI_ACTINST and effectivelly there are 3 instances of the JOIN (beacause that JOIN have 3 incomming sequece flows). This is part of the content of the ACT_HI_ACTINST that I want to send in a Excel file:

comienzo,Registrar proceso,startEvent,,41:30.2,41:30.2,0
parallelgateway1,Parallel Gateway,parallelGateway,,41:30.2,41:30.2,1
parallelgateway2,Parallel Gateway,parallelGateway,,41:30.2,,
parallelgateway2,Parallel Gateway,parallelGateway,,41:30.2,,
parallelgateway2,Parallel Gateway,parallelGateway,,41:30.3,,
servicetask1,Service Task 1,serviceTask,,41:30.2,41:30.2,2
servicetask2,Service Task 2,serviceTask,,41:30.2,41:30.2,3
servicetask3,Service Task 3,serviceTask,,41:30.3,41:30.3,5
servicetask4,Service Task 4,serviceTask,,41:30.2,41:30.2,3
servicetask5,Service Task 4,serviceTask,,41:30.3,41:30.3,24
usertask2,Example 2 of User Task,userTask,D10367:002001,41:30.3,,

As you can see, the registers number 3,4 and 5 are the instances of the JOIN that were generated and none of them is finished even though the process is currently in a later activity (userTask2 that is the current activiti of the process).
jerryfiunam (61) [Avatar] Offline
Re: Doubts about PARALLELGATEWAY object
BTW, this is the BPMN example of my process definition:

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="" xmlnssmiliesi="" xmlns:activiti="" xmlns:bpmndi="" xmlns:omgdc="" xmlns:omgdi="" typeLanguage="" expressionLanguage="" targetNamespace="RCS-PRUEBA9">
<process id="RCS-PRUEBA9" name="Mi proceso con subprocesos FINAL" isExecutable="true">
<documentation>Proceso con Subproceso de ejemplo</documentation>
<startEvent id="comienzo" name="Registrar proceso"></startEvent>
<parallelGateway id="parallelgateway1" name="Parallel Gateway"></parallelGateway>
<serviceTask id="servicetask1" name="Service Task 1" activiti:expression="${pruebaProceso.tarea1()}"></serviceTask>
<sequenceFlow id="flow4" sourceRef="comienzo" targetRef="servicetask1"></sequenceFlow>
<sequenceFlow id="flow5" sourceRef="servicetask1" targetRef="parallelgateway1"></sequenceFlow>
<serviceTask id="servicetask2" name="Service Task 2" activiti:expression="${pruebaProceso.tarea2()}"></serviceTask>
<sequenceFlow id="flow6" sourceRef="parallelgateway1" targetRef="servicetask2"></sequenceFlow>
<parallelGateway id="parallelgateway2" name="Parallel Gateway"></parallelGateway>
<sequenceFlow id="flow7" sourceRef="servicetask2" targetRef="parallelgateway2"></sequenceFlow>
<endEvent id="endevent2" name="End"></endEvent>
<serviceTask id="servicetask3" name="Service Task 3" activiti:expression="${pruebaProceso.tarea2()}"></serviceTask>
<userTask id="usertask2" name="Example 2 of User Task" activiti:assignee="D10367:002001"></userTask>
<sequenceFlow id="flow14" sourceRef="usertask2" targetRef="endevent2"></sequenceFlow>
<serviceTask id="servicetask4" name="Service Task 4" activiti:expression="${pruebaProceso.tarea2()}"></serviceTask>
<sequenceFlow id="flow15" sourceRef="parallelgateway1" targetRef="servicetask4"></sequenceFlow>
<sequenceFlow id="flow16" sourceRef="servicetask4" targetRef="parallelgateway2"></sequenceFlow>
<sequenceFlow id="flow17" sourceRef="parallelgateway1" targetRef="servicetask3"></sequenceFlow>
<sequenceFlow id="flow18" sourceRef="servicetask3" targetRef="parallelgateway2"></sequenceFlow>
<serviceTask id="servicetask5" name="Service Task 4" activiti:expression="${pruebaProceso.tarea2()}"></serviceTask>
<sequenceFlow id="flow19" sourceRef="parallelgateway2" targetRef="servicetask5"></sequenceFlow>
<sequenceFlow id="flow20" sourceRef="servicetask5" targetRef="usertask2"></sequenceFlow>
<bpmndi:BPMNDiagram id="BPMNDiagram_RCS-PRUEBA9">
<bpmndi:BPMNPlane bpmnElement="RCS-PRUEBA9" id="BPMNPlane_RCS-PRUEBA9">
<bpmndi:BPMNShape bpmnElement="comienzo" id="BPMNShape_comienzo">
<omgdc:Bounds height="35.0" width="35.0" x="40.0" y="220.0"></omgdc:Bounds>
<bpmndi:BPMNShape bpmnElement="parallelgateway1" id="BPMNShape_parallelgateway1">
<omgdc:Bounds height="40.0" width="40.0" x="390.0" y="217.0"></omgdc:Bounds>
<bpmndi:BPMNShape bpmnElement="servicetask1" id="BPMNShape_servicetask1">
<omgdc:Bounds height="55.0" width="105.0" x="180.0" y="210.0"></omgdc:Bounds>
<bpmndi:BPMNShape bpmnElement="servicetask2" id="BPMNShape_servicetask2">
<omgdc:Bounds height="55.0" width="105.0" x="550.0" y="350.0"></omgdc:Bounds>
<bpmndi:BPMNShape bpmnElement="parallelgateway2" id="BPMNShape_parallelgateway2">
<omgdc:Bounds height="40.0" width="40.0" x="775.0" y="217.0"></omgdc:Bounds>
<bpmndi:BPMNShape bpmnElement="endevent2" id="BPMNShape_endevent2">
<omgdc:Bounds height="35.0" width="35.0" x="1175.0" y="440.0"></omgdc:Bounds>
<bpmndi:BPMNShape bpmnElement="usertask3" id="BPMNShape_usertask3">
<omgdc:Bounds height="55.0" width="105.0" x="910.0" y="233.0"></omgdc:Bounds>
<bpmndi:BPMNShape bpmnElement="servicetask3" id="BPMNShape_servicetask3">
<omgdc:Bounds height="55.0" width="105.0" x="550.0" y="80.0"></omgdc:Bounds>
<bpmndi:BPMNShape bpmnElement="usertask4" id="BPMNShape_usertask4">
<omgdc:Bounds height="55.0" width="105.0" x="1045.0" y="233.0"></omgdc:Bounds>
<bpmndi:BPMNShape bpmnElement="usertask2" id="BPMNShape_usertask2">
<omgdc:Bounds height="55.0" width="105.0" x="1140.0" y="210.0"></omgdc:Bounds>
<bpmndi:BPMNShape bpmnElement="servicetask4" id="BPMNShape_servicetask4">
<omgdc:Bounds height="55.0" width="105.0" x="550.0" y="210.0"></omgdc:Bounds>
<bpmndi:BPMNShape bpmnElement="servicetask5" id="BPMNShape_servicetask5">
<omgdc:Bounds height="55.0" width="105.0" x="940.0" y="210.0"></omgdc:Bounds>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="75.0" y="237.0"></omgdi:waypoint>
<omgdi:waypoint x="180.0" y="237.0"></omgdi:waypoint>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="285.0" y="237.0"></omgdi:waypoint>
<omgdi:waypoint x="390.0" y="237.0"></omgdi:waypoint>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="410.0" y="257.0"></omgdi:waypoint>
<omgdi:waypoint x="410.0" y="377.0"></omgdi:waypoint>
<omgdi:waypoint x="550.0" y="377.0"></omgdi:waypoint>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
<omgdi:waypoint x="655.0" y="377.0"></omgdi:waypoint>
<omgdi:waypoint x="790.0" y="377.0"></omgdi:waypoint>
<omgdi:waypoint x="795.0" y="257.0"></omgdi:waypoint>
<bpmndi:BPMNEdge bpmnElement="flow14" id="BPMNEdge_flow14">
<omgdi:waypoint x="1192.0" y="265.0"></omgdi:waypoint>
<omgdi:waypoint x="1192.0" y="440.0"></omgdi:waypoint>
<bpmndi:BPMNEdge bpmnElement="flow15" id="BPMNEdge_flow15">
<omgdi:waypoint x="430.0" y="237.0"></omgdi:waypoint>
<omgdi:waypoint x="550.0" y="237.0"></omgdi:waypoint>
<bpmndi:BPMNEdge bpmnElement="flow16" id="BPMNEdge_flow16">
<omgdi:waypoint x="655.0" y="237.0"></omgdi:waypoint>
<omgdi:waypoint x="775.0" y="237.0"></omgdi:waypoint>
<bpmndi:BPMNEdge bpmnElement="flow17" id="BPMNEdge_flow17">
<omgdi:waypoint x="410.0" y="217.0"></omgdi:waypoint>
<omgdi:waypoint x="410.0" y="107.0"></omgdi:waypoint>
<omgdi:waypoint x="550.0" y="107.0"></omgdi:waypoint>
<bpmndi:BPMNEdge bpmnElement="flow18" id="BPMNEdge_flow18">
<omgdi:waypoint x="655.0" y="107.0"></omgdi:waypoint>
<omgdi:waypoint x="795.0" y="107.0"></omgdi:waypoint>
<omgdi:waypoint x="795.0" y="217.0"></omgdi:waypoint>
<bpmndi:BPMNEdge bpmnElement="flow19" id="BPMNEdge_flow19">
<omgdi:waypoint x="815.0" y="237.0"></omgdi:waypoint>
<omgdi:waypoint x="940.0" y="237.0"></omgdi:waypoint>
<bpmndi:BPMNEdge bpmnElement="flow20" id="BPMNEdge_flow20">
<omgdi:waypoint x="1045.0" y="237.0"></omgdi:waypoint>
<omgdi:waypoint x="1140.0" y="237.0"></omgdi:waypoint>

I hope you can help me with this issue.


jerryfiunam (61) [Avatar] Offline
Re: Doubts about PARALLELGATEWAY object
Hi Tijs,

I just wonder if you have found something about this matter?

Thanks in advance smilie,

tijs.rademakers (494) [Avatar] Offline
Re: Doubts about PARALLELGATEWAY object
Hi Jerry,

Really sorry that it took this long to answer, but I've been really busy.
You're right that for the third parallel gateway there are 3 entries in the history activity instance table. Every sequence flow has its own execution and therefore there are 3 entries. So it's by design that it behaves this way.

Best regards,

jerryfiunam (61) [Avatar] Offline
Re: Doubts about PARALLELGATEWAY object
No problem Tijs, I really appreciate your replay smilie.

I just have a doubt regarding this matter, Why in the history activity all those instances of the parallel gateway (as join) dont have END_TIME_ in the ACT_HI_ACTINST once they are finished? Beacuse when I query for the history of the process instance as follows:

List<HistoricActivityInstance> q = historyService

those parallel gateways are still alive (whitout END_TIME_) even when the process goes further than that parallel gateway.

Thanks again for your time.

tijs.rademakers (494) [Avatar] Offline
Re: Doubts about PARALLELGATEWAY object
Yes I think you are right, this is a bug. I'll see if we can fix it for the 5.13 release, otherwise it will be for the 5.14.
Thanks for reporting this.

Best regards,