1 Reply Latest reply on Jan 7, 2013 12:52 PM by roxy1987

    jbpm engine is generating 4 tasks instead of just one !!

    bardelman

      Hi,

      i'm using jbpm 5.0.

       

      i ve a simple process with 2 human-tasks for 2 different users, when i try to get each user tasks with this method :

       

      public static List <TaskSummary> getAssignedTasks(String idRef) {

                          connect();

                          List<TaskSummary> tasks = null;

                          try {

                                    BlockingTaskSummaryResponseHandler responseHandler = new BlockingTaskSummaryResponseHandler();

                                    client.getTasksOwned(idRef, "en-UK", responseHandler);

                        tasks = responseHandler.getResults();

                          } catch (Throwable t) {

                                    t.printStackTrace();

                          }

                          return tasks;

                }

       

      i got 4 tasks instead of just one :

      tasks list : [org.jbpm.task.query.TaskSummary@cf54f3e6, org.jbpm.task.query.TaskSummary@cf54f3e7, org.jbpm.

      task.query.TaskSummary@639962e7, org.jbpm.task.query.TaskSummary@639962e8]

       

      Sometimes i get just one task but when i complete it i get 4 tasks with status "completed".

       

      This seems as a bug in the jbpm engine but it doesn't happen with all processes ,i ve 2 processes and this problem only happens in one of them : this one :

       

      <?xml version="1.0" encoding="UTF-8"?>

      <definitions id="Definition"

                   targetNamespace="http://www.jboss.org/drools"

                   typeLanguage="http://www.java.com/javaTypes"

                   expressionLanguage="http://www.mvel.org/2.0"

                   xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"

                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                   xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd"

                   xmlns:g="http://www.jboss.org/drools/flow/gpd"

                   xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"

                   xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"

                   xmlns:di="http://www.omg.org/spec/DD/20100524/DI"

                   xmlns:tns="http://www.jboss.org/drools">

       

       

        <itemDefinition id="_var1Item" structureRef="String" />

        <itemDefinition id="_var2Item" structureRef="String" />

        <itemDefinition id="_var3Item" structureRef="Object" />

        <itemDefinition id="_var4Item" structureRef="String" />

       

       

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

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

        <itemDefinition id="_2-var3Item" structureRef="Object" />

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

       

       

        <itemDefinition id="_3-var1Item" structureRef="String" />

        <itemDefinition id="_3-var2Item" structureRef="String" />

        <itemDefinition id="_3-var3Item" structureRef="Object" />

        <itemDefinition id="_3-var4Item" structureRef="String" />

       

       

        <process processType="Private" isExecutable="true" id="themasterbossexpl" name="Sample Process" tns:packageName="defaultPackage" >

       

       

          <!-- process variables -->

          <property id="var1" itemSubjectRef="_var1Item"/>

          <property id="var2" itemSubjectRef="_var2Item"/>

          <property id="var3" itemSubjectRef="_var3Item"/>

          <property id="var4" itemSubjectRef="_var4Item"/>

       

       

          <!-- nodes -->

          <startEvent id="_1" name="StartProcess" />

          <userTask id="_2" name="User Task1" >

            <ioSpecification>

              <dataInput id="_2_param1Input" name="param1" />

              <dataInput id="_2_param2Input" name="param2" />

              <dataInput id="_2_TaskNameInput" name="TaskName" />

              <inputSet>

                <dataInputRefs>_2_param1Input</dataInputRefs>

                <dataInputRefs>_2_param2Input</dataInputRefs>

                <dataInputRefs>_2_TaskNameInput</dataInputRefs>

              </inputSet>

              <outputSet>

              </outputSet>

            </ioSpecification>

            <dataInputAssociation>

              <sourceRef>var1</sourceRef>

              <targetRef>_2_param1Input</targetRef>

            </dataInputAssociation>

            <dataInputAssociation>

              <sourceRef>var2</sourceRef>

              <targetRef>_2_param2Input</targetRef>

            </dataInputAssociation>

            <dataInputAssociation>

              <targetRef>_2_TaskNameInput</targetRef>

              <assignment>

                <from xsi:type="tFormalExpression">usertask1</from>

                <to xsi:type="tFormalExpression">_2_TaskNameInput</to>

              </assignment>

            </dataInputAssociation>

            <potentialOwner>

              <resourceAssignmentExpression>

                <formalExpression>jalel</formalExpression>

              </resourceAssignmentExpression>

            </potentialOwner>

          </userTask>

          <userTask id="_3" name="User Task2" >

            <ioSpecification>

              <dataInput id="_3_param3Input" name="param3" />

              <dataInput id="_3_param4Input" name="param4" />

              <dataInput id="_3_TaskNameInput" name="TaskName" />

              <inputSet>

                <dataInputRefs>_3_param3Input</dataInputRefs>

                <dataInputRefs>_3_param4Input</dataInputRefs>

                <dataInputRefs>_3_TaskNameInput</dataInputRefs>

              </inputSet>

              <outputSet>

              </outputSet>

            </ioSpecification>

            <dataInputAssociation>

              <sourceRef>var3</sourceRef>

              <targetRef>_3_param3Input</targetRef>

            </dataInputAssociation>

            <dataInputAssociation>

              <sourceRef>var4</sourceRef>

              <targetRef>_3_param4Input</targetRef>

            </dataInputAssociation>

            <dataInputAssociation>

              <targetRef>_3_TaskNameInput</targetRef>

              <assignment>

                <from xsi:type="tFormalExpression">usertask2</from>

                <to xsi:type="tFormalExpression">_3_TaskNameInput</to>

              </assignment>

            </dataInputAssociation>

            <potentialOwner>

              <resourceAssignmentExpression>

                <formalExpression>karim</formalExpression>

              </resourceAssignmentExpression>

            </potentialOwner>

          </userTask>

          <endEvent id="_4" name="End" >

              <terminateEventDefinition/>

          </endEvent>

       

       

          <!-- connections -->

          <sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" />

          <sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" />

          <sequenceFlow id="_3-_4" sourceRef="_3" targetRef="_4" />

       

       

        </process>

       

       

        <bpmndi:BPMNDiagram>

          <bpmndi:BPMNPlane bpmnElement="themasterbossexpl" >

            <bpmndi:BPMNShape bpmnElement="_1" >

              <dc:Bounds x="45" y="45" width="48" height="48" />

            </bpmndi:BPMNShape>

            <bpmndi:BPMNShape bpmnElement="_2" >

              <dc:Bounds x="253" y="69" width="100" height="48" />

            </bpmndi:BPMNShape>

            <bpmndi:BPMNShape bpmnElement="_3" >

              <dc:Bounds x="500" y="115" width="100" height="48" />

            </bpmndi:BPMNShape>

            <bpmndi:BPMNShape bpmnElement="_4" >

              <dc:Bounds x="725" y="177" width="48" height="48" />

            </bpmndi:BPMNShape>

            <bpmndi:BPMNEdge bpmnElement="_1-_2" >

              <di:waypoint x="69" y="69" />

              <di:waypoint x="303" y="93" />

            </bpmndi:BPMNEdge>

            <bpmndi:BPMNEdge bpmnElement="_2-_3" >

              <di:waypoint x="303" y="93" />

              <di:waypoint x="550" y="139" />

            </bpmndi:BPMNEdge>

            <bpmndi:BPMNEdge bpmnElement="_3-_4" >

              <di:waypoint x="550" y="139" />

              <di:waypoint x="749" y="201" />

            </bpmndi:BPMNEdge>

          </bpmndi:BPMNPlane>

        </bpmndi:BPMNDiagram>

       

       

      </definitions>

       

      Thanx for help !

        • 1. Re: jbpm engine is generating 4 tasks instead of just one !!
          roxy1987

          Why dont you use jbpm 5.4 final version?

          As for your question, similar thing happened to me once. I left the comment value for the task as empty which resulted in 4-5 tasks instead of just 1. So may be you can check if the comment value for the task is empty or not. If it is then try putting some comments and running it again.

           

          Regards.