Discussion:
[jboss-user] [jBPM] - JBPM 5: Workflow not leaving embedded sub process
Robert de Lorimier
2012-12-19 22:33:19 UTC
Permalink
Robert de Lorimier [https://community.jboss.org/people/r_delorimier] created the discussion

"JBPM 5: Workflow not leaving embedded sub process"

To view the discussion, visit: https://community.jboss.org/message/784168#784168

--------------------------------------------------------------
Hi all,

I am trying to create a workflow with human tasks, convergent and divergent gateways, and an embedded subprocess. For some reason it looks like the workflow does not continue after the subprocess finishes to go to the final end point. See the workflow image:

Loading Image... Loading Image...
I am using a variable in the constraints of the divergent gateway to decide which direction the workflow will go. After I select the "Appove Rule" node, the next nodes are a convergent and divergent gateway. I can see that it is making it to the the divergent gateway, as I added in some code the the constraint that goes to the termination node in the subprocess:

org.drools.runtime.process.WorkflowProcessInstance process = (org.drools.runtime.process.WorkflowProcessInstance)kcontext.getProcessInstance();

if (((String)process.getVariable("ruleState")).equals("LIVE"))
{
    System.out.println("Rule approved and going LIVE");
    return true;
}
else
{
    return false;
}

I can see the Text "Rule approved and going LIVE" in the console when running my code, so it should be going to the terninal node. Outside of the subprocess is another convergent and divergent node. The divergent node uses the ruleState variable to decide whether go back through the process again or go to the terminal node, and again to am printing out what the decision is. I do not see any of this text when I run the code. I also assert that the End node was triggered and the process instance is completed, and both of these fail. I am including the workflow and code as a maven project so you can run the test with "mvn install" and take a look at it yourself.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/784168#784168]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2012-12-20 06:22:34 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: JBPM 5: Workflow not leaving embedded sub process"

To view the discussion, visit: https://community.jboss.org/message/784202#784202

--------------------------------------------------------------
A potential cause of it is that subprocess has still active nodes so it does not complete and a cause of it could be an incorrect gateway type that you expect to be. When you look at the gateway that follows "submit for approval" it's parallel gateway which means both approve role and reject role tasks will be created. Next when you complete first task it goes directly to end node but since there is still active the other task sub process is not yet finished and it waits for the second task to be completed.

So most likely you would like to have exclusive gateway there and that should fix the problem. If not please post back and I'll try to find some time to look through the attached code.

HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/784202#784202]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Robert de Lorimier
2012-12-22 06:50:49 UTC
Permalink
Robert de Lorimier [https://community.jboss.org/people/r_delorimier] created the discussion

"Re: JBPM 5: Workflow not leaving embedded sub process"

To view the discussion, visit: https://community.jboss.org/message/784538#784538

--------------------------------------------------------------
I looked at all of the gateways, and other than the first divergent gateway, all the others were set to XOR. Here is the bpmn:

<?xml version="1.0" encoding="UTF-8"?>
<definitions id="Definition"
             targetNamespace=" http://www.jboss.org/drools http://www.jboss.org/drools"
             typeLanguage=" http://www.java.com/javaTypes http://www.java.com/javaTypes"
             expressionLanguage=" http://www.mvel.org/2.0 http://www.mvel.org/2.0"
             xmlns=" http://www.omg.org/spec/BPMN/20100524/MODEL http://www.omg.org/spec/BPMN/20100524/MODEL"
             xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation=" http://www.omg.org/spec/BPMN/20100524/MODEL http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"
             xmlns:g=" http://www.jboss.org/drools/flow/gpd http://www.jboss.org/drools/flow/gpd"
             xmlns:bpmndi=" http://www.omg.org/spec/BPMN/20100524/DI http://www.omg.org/spec/BPMN/20100524/DI"
             xmlns:dc=" http://www.omg.org/spec/DD/20100524/DC http://www.omg.org/spec/DD/20100524/DC"
             xmlns:di=" http://www.omg.org/spec/DD/20100524/DI http://www.omg.org/spec/DD/20100524/DI"
             xmlns:tns=" http://www.jboss.org/drools http://www.jboss.org/drools">

  <itemDefinition id="_2-ruleStateItem" structureRef="String" />

  <process processType="Private" isExecutable="true" id="workflow" name="Rule Workflow Process" tns:packageName="defaultPackage" >

    <laneSet>
      <lane name="ruleState" >
      </lane>
      <lane name="ruleId" >
      </lane>
    </laneSet>
    <!-- nodes -->
    <startEvent id="_1" name="Start Process" />
    <subProcess id="_2" name="Approval Process"  >
    <!-- variables -->
    <property id="ruleState" itemSubjectRef="_2-ruleStateItem"/>
    <!-- nodes -->
    <startEvent id="_2-1" name="Start" />
    <exclusiveGateway id="_2-2" name="Gateway" gatewayDirection="Converging" />
    <userTask id="_2-3" name="Submit for Approval" >
      <ioSpecification>
        <dataInput id="_2-3_CommentInput" name="Comment" />
        <dataInput id="_2-3_SkippableInput" name="Skippable" />
        <dataInput id="_2-3_TaskNameInput" name="TaskName" />
        <inputSet>
          <dataInputRefs>_2-3_CommentInput</dataInputRefs>
          <dataInputRefs>_2-3_SkippableInput</dataInputRefs>
          <dataInputRefs>_2-3_TaskNameInput</dataInputRefs>
        </inputSet>
        <outputSet>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation>
        <targetRef>_2-3_CommentInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Task to submit the draft rule</from>
          <to xsi:type="tFormalExpression">_2-3_CommentInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_2-3_SkippableInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">true</from>
          <to xsi:type="tFormalExpression">_2-3_SkippableInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_2-3_TaskNameInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Submit for Approval</from>
          <to xsi:type="tFormalExpression">_2-3_TaskNameInput</to>
        </assignment>
      </dataInputAssociation>
      <potentialOwner>
        <resourceAssignmentExpression>
          <formalExpression>submitter</formalExpression>
        </resourceAssignmentExpression>
      </potentialOwner>
    </userTask>
    <parallelGateway id="_2-4" name="Gateway" gatewayDirection="Diverging" />
    <userTask id="_2-5" name="Approve Rule" >
      <extensionElements>
        <tns:onExit-script scriptFormat=" http://www.java.com/java http://www.java.com/java">
          <script>org.drools.runtime.process.WorkflowProcessInstance process = (org.drools.runtime.process.WorkflowProcessInstance)kcontext.getProcessInstance();

process.setVariable("ruleState", "LIVE");</script>
        </tns:onExit-script>
      </extensionElements>
      <ioSpecification>
        <dataInput id="_2-5_CommentInput" name="Comment" />
        <dataInput id="_2-5_SkippableInput" name="Skippable" />
        <dataInput id="_2-5_TaskNameInput" name="TaskName" />
        <inputSet>
          <dataInputRefs>_2-5_CommentInput</dataInputRefs>
          <dataInputRefs>_2-5_SkippableInput</dataInputRefs>
          <dataInputRefs>_2-5_TaskNameInput</dataInputRefs>
        </inputSet>
        <outputSet>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation>
        <targetRef>_2-5_CommentInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Approve the rule</from>
          <to xsi:type="tFormalExpression">_2-5_CommentInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_2-5_SkippableInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">true</from>
          <to xsi:type="tFormalExpression">_2-5_SkippableInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_2-5_TaskNameInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Approve Rule</from>
          <to xsi:type="tFormalExpression">_2-5_TaskNameInput</to>
        </assignment>
      </dataInputAssociation>
      <potentialOwner>
        <resourceAssignmentExpression>
          <formalExpression>approver</formalExpression>
        </resourceAssignmentExpression>
      </potentialOwner>
      <potentialOwner>
        <resourceAssignmentExpression>
          <formalExpression>appUser</formalExpression>
        </resourceAssignmentExpression>
      </potentialOwner>
    </userTask>
    <userTask id="_2-6" name="Reject Rule" >
      <extensionElements>
        <tns:onExit-script>
          <script>org.drools.runtime.process.WorkflowProcessInstance process = (org.drools.runtime.process.WorkflowProcessInstance)kcontext.getProcessInstance();

process.setVariable("ruleState", "DRAFT");</script>
        </tns:onExit-script>
      </extensionElements>
      <ioSpecification>
        <dataInput id="_2-6_CommentInput" name="Comment" />
        <dataInput id="_2-6_SkippableInput" name="Skippable" />
        <dataInput id="_2-6_TaskNameInput" name="TaskName" />
        <inputSet>
          <dataInputRefs>_2-6_CommentInput</dataInputRefs>
          <dataInputRefs>_2-6_SkippableInput</dataInputRefs>
          <dataInputRefs>_2-6_TaskNameInput</dataInputRefs>
        </inputSet>
        <outputSet>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation>
        <targetRef>_2-6_CommentInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Reject the rule</from>
          <to xsi:type="tFormalExpression">_2-6_CommentInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_2-6_SkippableInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">true</from>
          <to xsi:type="tFormalExpression">_2-6_SkippableInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_2-6_TaskNameInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Reject Rule</from>
          <to xsi:type="tFormalExpression">_2-6_TaskNameInput</to>
        </assignment>
      </dataInputAssociation>
      <potentialOwner>
        <resourceAssignmentExpression>
          <formalExpression>approver</formalExpression>
        </resourceAssignmentExpression>
      </potentialOwner>
      <potentialOwner>
        <resourceAssignmentExpression>
          <formalExpression>appUser</formalExpression>
        </resourceAssignmentExpression>
      </potentialOwner>
    </userTask>
    <exclusiveGateway id="_2-7" name="Gateway" gatewayDirection="Converging" />
    <exclusiveGateway id="_2-8" name="approveDecision" gatewayDirection="Diverging" />
    <endEvent id="_2-9" name="FinishSubProcess" />
    <!-- connections -->
    <sequenceFlow id="_2-1-_2-2" sourceRef="_2-1" targetRef="_2-2" />
    <sequenceFlow id="_2-8-_2-2" sourceRef="_2-8" targetRef="_2-2" name="Rejected" tns:priority="1" >
      <conditionExpression xsi:type="tFormalExpression" >org.drools.runtime.process.WorkflowProcessInstance process = (org.drools.runtime.process.WorkflowProcessInstance)kcontext.getProcessInstance();

if (((String)process.getVariable("ruleState")).equals("DRAFT"))
{
    System.out.println("Rule rejected and staying DRAFT. Back to the beginning");
    return true;
}
else
{
    return false;
}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="_2-2-_2-3" sourceRef="_2-2" targetRef="_2-3" />
    <sequenceFlow id="_2-3-_2-4" sourceRef="_2-3" targetRef="_2-4" />
    <sequenceFlow id="_2-4-_2-5" sourceRef="_2-4" targetRef="_2-5" />
    <sequenceFlow id="_2-4-_2-6" sourceRef="_2-4" targetRef="_2-6" />
    <sequenceFlow id="_2-6-_2-7" sourceRef="_2-6" targetRef="_2-7" />
    <sequenceFlow id="_2-5-_2-7" sourceRef="_2-5" targetRef="_2-7" />
    <sequenceFlow id="_2-7-_2-8" sourceRef="_2-7" targetRef="_2-8" />
    <sequenceFlow id="_2-8-_2-9" sourceRef="_2-8" targetRef="_2-9" name="Go live" tns:priority="1" >
      <conditionExpression xsi:type="tFormalExpression" >org.drools.runtime.process.WorkflowProcessInstance process = (org.drools.runtime.process.WorkflowProcessInstance)kcontext.getProcessInstance();

if (((String)process.getVariable("ruleState")).equals("LIVE"))
{
    System.out.println("Rule approved and going LIVE");
    return true;
}
else
{
    return false;
}</conditionExpression>
    </sequenceFlow>
    </subProcess>
    <userTask id="_3" name="Modify Rule" >
      <extensionElements>
        <tns:onExit-script scriptFormat=" http://www.java.com/java http://www.java.com/java">
          <script>org.drools.runtime.process.WorkflowProcessInstance process = (org.drools.runtime.process.WorkflowProcessInstance)kcontext.getProcessInstance();

process.setVariable("ruleState", "DRAFT");</script>
        </tns:onExit-script>
      </extensionElements>
      <ioSpecification>
        <dataInput id="_3_CommentInput" name="Comment" />
        <dataInput id="_3_SkippableInput" name="Skippable" />
        <dataInput id="_3_TaskNameInput" name="TaskName" />
        <inputSet>
          <dataInputRefs>_3_CommentInput</dataInputRefs>
          <dataInputRefs>_3_SkippableInput</dataInputRefs>
          <dataInputRefs>_3_TaskNameInput</dataInputRefs>
        </inputSet>
        <outputSet>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation>
        <targetRef>_3_CommentInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Modify the rule</from>
          <to xsi:type="tFormalExpression">_3_CommentInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_3_SkippableInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">true</from>
          <to xsi:type="tFormalExpression">_3_SkippableInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_3_TaskNameInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Modify Rule</from>
          <to xsi:type="tFormalExpression">_3_TaskNameInput</to>
        </assignment>
      </dataInputAssociation>
      <potentialOwner>
        <resourceAssignmentExpression>
          <formalExpression>submitter</formalExpression>
        </resourceAssignmentExpression>
      </potentialOwner>
      <potentialOwner>
        <resourceAssignmentExpression>
          <formalExpression>editor</formalExpression>
        </resourceAssignmentExpression>
      </potentialOwner>
    </userTask>
    <endEvent id="_4" name="End" >
        <terminateEventDefinition/>
    </endEvent>
    <exclusiveGateway id="_5" name="Gateway" gatewayDirection="Converging" />
    <parallelGateway id="_6" name="Gateway" gatewayDirection="Diverging" />
    <exclusiveGateway id="_7" name="Gateway" gatewayDirection="Converging" />
    <exclusiveGateway id="_8" name="Gateway" gatewayDirection="Diverging" />
    <userTask id="_9" name="Start Workflow" >
      <extensionElements>
        <tns:onExit-script scriptFormat=" http://www.java.com/java http://www.java.com/java">
          <script>System.out.println("Start Workflow triggered");</script>
        </tns:onExit-script>
      </extensionElements>
      <ioSpecification>
        <dataInput id="_9_CommentInput" name="Comment" />
        <dataInput id="_9_SkippableInput" name="Skippable" />
        <dataInput id="_9_TaskNameInput" name="TaskName" />
        <dataInput id="_9_GroupIdInput" name="GroupId" />
        <inputSet>
          <dataInputRefs>_9_CommentInput</dataInputRefs>
          <dataInputRefs>_9_SkippableInput</dataInputRefs>
          <dataInputRefs>_9_TaskNameInput</dataInputRefs>
          <dataInputRefs>_9_GroupIdInput</dataInputRefs>
        </inputSet>
        <outputSet>
        </outputSet>
      </ioSpecification>
      <dataInputAssociation>
        <targetRef>_9_CommentInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Starts the workflow</from>
          <to xsi:type="tFormalExpression">_9_CommentInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_9_SkippableInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">false</from>
          <to xsi:type="tFormalExpression">_9_SkippableInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_9_TaskNameInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression">Start Workflow</from>
          <to xsi:type="tFormalExpression">_9_TaskNameInput</to>
        </assignment>
      </dataInputAssociation>
      <dataInputAssociation>
        <targetRef>_9_GroupIdInput</targetRef>
        <assignment>
          <from xsi:type="tFormalExpression"></from>
          <to xsi:type="tFormalExpression">_9_GroupIdInput</to>
        </assignment>
      </dataInputAssociation>
      <potentialOwner>
        <resourceAssignmentExpression>
          <formalExpression>appUser</formalExpression>
        </resourceAssignmentExpression>
      </potentialOwner>
    </userTask>

    <!-- connections -->
    <sequenceFlow id="_6-_2" sourceRef="_6" targetRef="_2" />
    <sequenceFlow id="_6-_3" sourceRef="_6" targetRef="_3" />
    <sequenceFlow id="_8-_4" sourceRef="_8" targetRef="_4" name="Finish workflow" >
      <conditionExpression xsi:type="tFormalExpression" >org.drools.runtime.process.WorkflowProcessInstance process = (org.drools.runtime.process.WorkflowProcessInstance)kcontext.getProcessInstance();
System.out.println("Rule state is now " + ((String)process.getVariable("ruleState")));

if (((String)process.getVariable("ruleState")).equals("LIVE"))
{
    System.out.println("Finish workflow");
    return true;
}
else
{
    return false;
}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="_3-_5" sourceRef="_3" targetRef="_5" />
    <sequenceFlow id="_2-_5" sourceRef="_2" targetRef="_5" />
    <sequenceFlow id="_7-_6" sourceRef="_7" targetRef="_6" />
    <sequenceFlow id="_8-_7" sourceRef="_8" targetRef="_7" name="Return to start" >
      <conditionExpression xsi:type="tFormalExpression" >org.drools.runtime.process.WorkflowProcessInstance process = (org.drools.runtime.process.WorkflowProcessInstance)kcontext.getProcessInstance();
System.out.println("Rule state is now " + ((String)process.getVariable("ruleState")));

if (((String)process.getVariable("ruleState")).equals("DRAFT"))
{
    System.out.println("Go back to start");
    return true;
}
else
{
    return false;
}</conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="_9-_7" sourceRef="_9" targetRef="_7" />
    <sequenceFlow id="_5-_8" sourceRef="_5" targetRef="_8" />
    <sequenceFlow id="_1-_9" sourceRef="_1" targetRef="_9" />

  </process>

  <bpmndi:BPMNDiagram>
    <bpmndi:BPMNPlane bpmnElement="workflow" >
      <bpmndi:BPMNShape bpmnElement="_1" >
        <dc:Bounds x="236" y="12" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_2" >
        <dc:Bounds x="360" y="191" width="607" height="502" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_2-1" >
        <dc:Bounds x="456" y="220" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_2-2" >
        <dc:Bounds x="458" y="315" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_2-3" >
        <dc:Bounds x="406" y="400" width="153" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_2-4" >
        <dc:Bounds x="458" y="488" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_2-5" >
        <dc:Bounds x="435" y="609" width="100" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_2-6" >
        <dc:Bounds x="573" y="490" width="100" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_2-7" >
        <dc:Bounds x="737" y="611" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_2-8" >
        <dc:Bounds x="732" y="319" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_2-9" >
        <dc:Bounds x="895" y="318" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_3" >
        <dc:Bounds x="90" y="326" width="100" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_4" >
        <dc:Bounds x="40" y="726" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_5" >
        <dc:Bounds x="118" y="640" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_6" >
        <dc:Bounds x="236" y="181" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_7" >
        <dc:Bounds x="41" y="187" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_8" >
        <dc:Bounds x="40" y="640" width="48" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="_9" >
        <dc:Bounds x="210" y="102" width="100" height="48" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="_2-1-_2-2" >
        <di:waypoint x="120" y="53" />
        <di:waypoint x="122" y="148" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_2-8-_2-2" >
        <di:waypoint x="396" y="152" />
        <di:waypoint x="122" y="148" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_2-2-_2-3" >
        <di:waypoint x="122" y="148" />
        <di:waypoint x="122" y="233" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_2-3-_2-4" >
        <di:waypoint x="122" y="233" />
        <di:waypoint x="122" y="321" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_2-4-_2-5" >
        <di:waypoint x="122" y="321" />
        <di:waypoint x="125" y="442" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_2-4-_2-6" >
        <di:waypoint x="122" y="321" />
        <di:waypoint x="263" y="323" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_2-6-_2-7" >
        <di:waypoint x="263" y="323" />
        <di:waypoint x="401" y="444" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_2-5-_2-7" >
        <di:waypoint x="125" y="442" />
        <di:waypoint x="401" y="444" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_2-7-_2-8" >
        <di:waypoint x="401" y="444" />
        <di:waypoint x="396" y="152" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_2-8-_2-9" >
        <di:waypoint x="396" y="152" />
        <di:waypoint x="559" y="151" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_6-_2" >
        <di:waypoint x="260" y="205" />
        <di:waypoint x="663" y="442" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_6-_3" >
        <di:waypoint x="260" y="205" />
        <di:waypoint x="140" y="350" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_8-_4" >
        <di:waypoint x="64" y="664" />
        <di:waypoint x="64" y="750" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_3-_5" >
        <di:waypoint x="140" y="350" />
        <di:waypoint x="142" y="664" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_2-_5" >
        <di:waypoint x="663" y="442" />
        <di:waypoint x="142" y="664" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_7-_6" >
        <di:waypoint x="65" y="211" />
        <di:waypoint x="260" y="205" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_8-_7" >
        <di:waypoint x="64" y="664" />
        <di:waypoint x="65" y="211" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_9-_7" >
        <di:waypoint x="260" y="126" />
        <di:waypoint x="65" y="211" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_5-_8" >
        <di:waypoint x="142" y="664" />
        <di:waypoint x="64" y="664" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="_1-_9" >
        <di:waypoint x="260" y="36" />
        <di:waypoint x="260" y="126" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>

</definitions>
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/784538#784538]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Robert de Lorimier
2012-12-22 18:37:27 UTC
Permalink
Robert de Lorimier [https://community.jboss.org/people/r_delorimier] created the discussion

"Re: JBPM 5: Workflow not leaving embedded sub process"

To view the discussion, visit: https://community.jboss.org/message/784555#784555

--------------------------------------------------------------
I misspoke. There are two divergent AND gateways; one before the modify task and embedded subprocess, and one in the subprocess before the reject and accept tasks.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/784555#784555]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2012-12-27 17:59:38 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: JBPM 5: Workflow not leaving embedded sub process"

To view the discussion, visit: https://community.jboss.org/message/785111#785111

--------------------------------------------------------------
yes, and in fact the problem is with parallel gateway that splits the flow into both Approve and Reject user tasks which I believe is not what you want. So changing that to XOR gateway should make the subprocess complete as expected.

HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/785111#785111]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Robert de Lorimier
2012-12-29 00:15:23 UTC
Permalink
Robert de Lorimier [https://community.jboss.org/people/r_delorimier] created the discussion

"Re: JBPM 5: Workflow not leaving embedded sub process"

To view the discussion, visit: https://community.jboss.org/message/785278#785278

--------------------------------------------------------------
Ok, so  I do not understand how the workflow works then. What I think you are saying is that I really need to have a single human task that combines the reject and accept decision, and then the divergent gateway is used to go to the end or go back to the beginning.

That is a little less satisfactory, because I wanted to pick up the two unexecuted accept and reject tasks and present them as buttons. If one was then executed then jbpm would remove the other one. I thought you could use a divergent parallel gateway with multiple skippable tasks, and an XOR convergent gateway on the other side. The first human task completed would then go to the convergent gateway and complete the flow for that area between the divergent and convergent gateways. The branches that did not make it first were then deleted or invalidated. Are you saying this is not possible?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/785278#785278]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-01-03 10:39:21 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: JBPM 5: Workflow not leaving embedded sub process"

To view the discussion, visit: https://community.jboss.org/message/787294#787294

--------------------------------------------------------------
what id does is when reaching parallel gateway it will create both tasks - in your case they represent buttons so you would need to do one of the following:
- complete the task that represents button that was used and skip the other
- make the end event a terminate so as soon as the first enters that end event it will cancel all other active nodes in the sub process

the usual case is that you have single task that is to either approve or reject and then reason over the out come of a task. I think this more refers to the real usage as user will see only single task. In the process attached you have two tasks so using regular task list user would see both of them.

HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/787294#787294]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Robert de Lorimier
2013-01-08 01:11:59 UTC
Permalink
Robert de Lorimier [https://community.jboss.org/people/r_delorimier] created the discussion

"Re: JBPM 5: Workflow not leaving embedded sub process"

To view the discussion, visit: https://community.jboss.org/message/789119#789119

--------------------------------------------------------------
What you are describing is different from what I am seeing. You can follow the path I am taking in the workflow I appended above to see how the tasks are related. In my test I am doing this set of tasks and seeing which tasks are still reserved afterwards. The ones I am marking bold should not still be there:

1. Start Workflow1. Submit for Approval
2. Modify Rule

2. Submit for Approval1. Modify Rule
2. Approve Rule
3. Reject Rule

3. Reject Rule1. Modify Rule
2. Submit Rule

4. Submit for Approval1. Modify Rule
2. *Approve Rule* *- orphan*
3. Reject Rule
4. Approve Rule

5. Modify Rule1. *Approve Rule - orphan*
2. *Reject Rule* *- orphan*
3. *Approve Rule* *- orphan*
4. Submit for Approval
5. Modify Rule

6. Submit for Approval1. *Approve Rule* *- orphan*
2. *Reject Rule* *- orphan*
3. *Approve Rule - orphan
*
4. Modify Rule
5. Approve Rule
6. Reject Rule*
*

7. Approve Rule1. *Reject Rule* *- orphan*
2. *Approve Rule* *- orphan*
3. *Modify Rule* *- orphan*
4. *Approve Rule* *- orphan*
5. *Reject Rule* *- orphan*


When I check to see if the process instance is complete, it is not. Even the tasks in the subprocess are not being made not active, when I set the end node in the subprocess to terminate. You had mentioned that all tasks need to be complete or otherwise not active, so I am guessing this is why the process instance is still active. What would be the best approach to make the orphaned tasks not active? Any help would be appreciated.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/789119#789119]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Robert de Lorimier
2013-01-15 00:03:11 UTC
Permalink
Robert de Lorimier [https://community.jboss.org/people/r_delorimier] created the discussion

"Re: JBPM 5: Workflow not leaving embedded sub process"

To view the discussion, visit: https://community.jboss.org/message/791757#791757

--------------------------------------------------------------
Is there anything I am not doing correct to accumulate these orphaned tasks?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/791757#791757]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-01-15 12:31:56 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: JBPM 5: Workflow not leaving embedded sub process"

To view the discussion, visit: https://community.jboss.org/message/791992#791992

--------------------------------------------------------------
Robert, please find attached zip with two files:
- modified process definition
- adjusted test case

in general what I changed in there is the gateway in subprocess after approve reject user tasks to be parallel gateway, so it will wait until both tasks are finished. Finished does not have to mean completed as you can notice in the adjusted test case, it skips the task that was not selected.

HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/791992#791992]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Robert de Lorimier
2013-01-16 15:22:10 UTC
Permalink
Robert de Lorimier [https://community.jboss.org/people/r_delorimier] created the discussion

"Re: JBPM 5: Workflow not leaving embedded sub process"

To view the discussion, visit: https://community.jboss.org/message/792376#792376

--------------------------------------------------------------
Hi Maciej,

Thanks for the example. I see that you have added steps to skip the human tasks that will not be used, so we can now pass the AND convergent gateway instead of using the XOR version. You have also answered my question. Any cleanup we need to do is on the client, the JPBM framework itself will not invalidate (skip) items using the XOR gateway or exiting out of a subprocess. I will put in a feature request for that cleanup, as I cannot think of a reason why you would want the tasks that did not make it to the XOR gateway to remain in reserved state.

thanks again,
Rob
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/792376#792376]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-01-16 17:35:36 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: JBPM 5: Workflow not leaving embedded sub process"

To view the discussion, visit: https://community.jboss.org/message/792412#792412

--------------------------------------------------------------
Robert, it is because XOR (according to bpmn2 spec) does allow to be visited more than one time, what it does in converging mode is that it will not synchronize the tokens on it but move the flow as soon as the first token reaches it. It is possible and completely valid that at some point later another token will go through the xor converging gateway again and thus it does not cancel (skip) it.
Although I think that subprocess should be capable of canceling active nodes when it is terminating. Will check that soon and post back the result. If I would not do it within a week please ping me here ;)

Cheers
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/792412#792412]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Robert de Lorimier
2013-01-16 18:01:35 UTC
Permalink
Robert de Lorimier [https://community.jboss.org/people/r_delorimier] created the discussion

"Re: JBPM 5: Workflow not leaving embedded sub process"

To view the discussion, visit: https://community.jboss.org/message/792417#792417

--------------------------------------------------------------
Maciej,

Thank you for the insight. I had not thought about the case where tasks could be fired after the xor gateway has finished. But in cases where the flow returns back to the same XOR node, would there not be duplicate tasks again? Since I have not worked on that type of scenario, it is a bit blurry to me.

Thanx!
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/792417#792417]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-01-16 19:03:48 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: JBPM 5: Workflow not leaving embedded sub process"

To view the discussion, visit: https://community.jboss.org/message/792426#792426

--------------------------------------------------------------
you're right, there will be duplicated tasks which in some cases this is expected behavior.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/792426#792426]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...