[jboss-dev-forums] [jBPM Development] - jbpm engine is generating 4 tasks instead of just one !!

Feki Ahmed do-not-reply at jboss.com
Mon Dec 31 04:05:52 EST 2012


Feki Ahmed [https://community.jboss.org/people/bardelman] created the discussion

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

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

--------------------------------------------------------------
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 at cf54f3e6, org.jbpm.task.query.TaskSummary at cf54f3e7, org.jbpm.
task.query.TaskSummary at 639962e7, org.jbpm.task.query.TaskSummary at 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 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="_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 !
--------------------------------------------------------------

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

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20121231/d2512515/attachment-0001.html 


More information about the jboss-dev-forums mailing list