<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
jbpm engine is generating 4 tasks instead of just one !!
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/bardelman">Feki Ahmed</a> in <i>jBPM Development</i> - <a href="https://community.jboss.org/message/786819#786819">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi,</p><p>i'm using jbpm 5.0.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>i ve a simple process with 2 human-tasks for 2 different users, when i try to get each user tasks with this method : </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>public static List <TaskSummary> getAssignedTasks(String idRef) {</p><p>                    connect();</p><p>                    List<TaskSummary> tasks = null;</p><p>                    try {</p><p>                              BlockingTaskSummaryResponseHandler responseHandler = new BlockingTaskSummaryResponseHandler();</p><p>                              client.getTasksOwned(idRef, "en-UK", responseHandler);</p><p>                  tasks = responseHandler.getResults();</p><p>                    } catch (Throwable t) {</p><p>                              t.printStackTrace();</p><p>                    }</p><p>                    return tasks;</p><p>          }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>i got 4 tasks instead of just one :</p><p>tasks list : [org.jbpm.task.query.TaskSummary@cf54f3e6, org.jbpm.task.query.TaskSummary@cf54f3e7, org.jbpm.</p><p>task.query.TaskSummary@639962e7, org.jbpm.task.query.TaskSummary@639962e8]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Sometimes i get just one task but when i complete it i get 4 tasks with status "completed".</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>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 : </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><?xml version="1.0" encoding="UTF-8"?> </p><p><definitions id="Definition"</p><p><span>             targetNamespace="</span><a class="jive-link-external-small" href="http://www.jboss.org/drools" target="_blank">http://www.jboss.org/drools</a><span>"</span></p><p><span>             typeLanguage="</span><a class="jive-link-external-small" href="http://www.java.com/javaTypes" target="_blank">http://www.java.com/javaTypes</a><span>"</span></p><p><span>             expressionLanguage="</span><a class="jive-link-external-small" href="http://www.mvel.org/2.0" target="_blank">http://www.mvel.org/2.0</a><span>"</span></p><p><span>             xmlns="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/MODEL" target="_blank">http://www.omg.org/spec/BPMN/20100524/MODEL</a><span>"</span></p><p><span>             xmlns:xsi="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>"</span></p><p><span>             xsi:schemaLocation="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/MODEL" target="_blank">http://www.omg.org/spec/BPMN/20100524/MODEL</a><span> BPMN20.xsd"</span></p><p><span>             xmlns:g="</span><a class="jive-link-external-small" href="http://www.jboss.org/drools/flow/gpd" target="_blank">http://www.jboss.org/drools/flow/gpd</a><span>"</span></p><p><span>             xmlns:bpmndi="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/DI" target="_blank">http://www.omg.org/spec/BPMN/20100524/DI</a><span>"</span></p><p><span>             xmlns:dc="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/DD/20100524/DC" target="_blank">http://www.omg.org/spec/DD/20100524/DC</a><span>"</span></p><p><span>             xmlns:di="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/DD/20100524/DI" target="_blank">http://www.omg.org/spec/DD/20100524/DI</a><span>"</span></p><p><span>             xmlns:tns="</span><a class="jive-link-external-small" href="http://www.jboss.org/drools" target="_blank">http://www.jboss.org/drools</a><span>"></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  <itemDefinition id="_var1Item" structureRef="String" /></p><p>  <itemDefinition id="_var2Item" structureRef="String" /></p><p>  <itemDefinition id="_var3Item" structureRef="Object" /></p><p>  <itemDefinition id="_var4Item" structureRef="String" /></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  <itemDefinition id="_2-var1Item" structureRef="String" /></p><p>  <itemDefinition id="_2-var2Item" structureRef="String" /></p><p>  <itemDefinition id="_2-var3Item" structureRef="Object" /></p><p>  <itemDefinition id="_2-var4Item" structureRef="String" /></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  <itemDefinition id="_3-var1Item" structureRef="String" /></p><p>  <itemDefinition id="_3-var2Item" structureRef="String" /></p><p>  <itemDefinition id="_3-var3Item" structureRef="Object" /></p><p>  <itemDefinition id="_3-var4Item" structureRef="String" /></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  <process processType="Private" isExecutable="true" id="themasterbossexpl" name="Sample Process" tns:packageName="defaultPackage" ></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <!-- process variables --></p><p>    <property id="var1" itemSubjectRef="_var1Item"/></p><p>    <property id="var2" itemSubjectRef="_var2Item"/></p><p>    <property id="var3" itemSubjectRef="_var3Item"/></p><p>    <property id="var4" itemSubjectRef="_var4Item"/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <!-- nodes --></p><p>    <startEvent id="_1" name="StartProcess" /></p><p>    <userTask id="_2" name="User Task1" ></p><p>      <ioSpecification></p><p>        <dataInput id="_2_param1Input" name="param1" /></p><p>        <dataInput id="_2_param2Input" name="param2" /></p><p>        <dataInput id="_2_TaskNameInput" name="TaskName" /></p><p>        <inputSet></p><p>          <dataInputRefs>_2_param1Input</dataInputRefs></p><p>          <dataInputRefs>_2_param2Input</dataInputRefs></p><p>          <dataInputRefs>_2_TaskNameInput</dataInputRefs></p><p>        </inputSet></p><p>        <outputSet></p><p>        </outputSet></p><p>      </ioSpecification></p><p>      <dataInputAssociation></p><p>        <sourceRef>var1</sourceRef></p><p>        <targetRef>_2_param1Input</targetRef></p><p>      </dataInputAssociation></p><p>      <dataInputAssociation></p><p>        <sourceRef>var2</sourceRef></p><p>        <targetRef>_2_param2Input</targetRef></p><p>      </dataInputAssociation></p><p>      <dataInputAssociation></p><p>        <targetRef>_2_TaskNameInput</targetRef></p><p>        <assignment></p><p>          <from xsi:type="tFormalExpression">usertask1</from></p><p>          <to xsi:type="tFormalExpression">_2_TaskNameInput</to></p><p>        </assignment></p><p>      </dataInputAssociation></p><p>      <potentialOwner></p><p>        <resourceAssignmentExpression></p><p>          <formalExpression>jalel</formalExpression></p><p>        </resourceAssignmentExpression></p><p>      </potentialOwner></p><p>    </userTask></p><p>    <userTask id="_3" name="User Task2" ></p><p>      <ioSpecification></p><p>        <dataInput id="_3_param3Input" name="param3" /></p><p>        <dataInput id="_3_param4Input" name="param4" /></p><p>        <dataInput id="_3_TaskNameInput" name="TaskName" /></p><p>        <inputSet></p><p>          <dataInputRefs>_3_param3Input</dataInputRefs></p><p>          <dataInputRefs>_3_param4Input</dataInputRefs></p><p>          <dataInputRefs>_3_TaskNameInput</dataInputRefs></p><p>        </inputSet></p><p>        <outputSet></p><p>        </outputSet></p><p>      </ioSpecification></p><p>      <dataInputAssociation></p><p>        <sourceRef>var3</sourceRef></p><p>        <targetRef>_3_param3Input</targetRef></p><p>      </dataInputAssociation></p><p>      <dataInputAssociation></p><p>        <sourceRef>var4</sourceRef></p><p>        <targetRef>_3_param4Input</targetRef></p><p>      </dataInputAssociation></p><p>      <dataInputAssociation></p><p>        <targetRef>_3_TaskNameInput</targetRef></p><p>        <assignment></p><p>          <from xsi:type="tFormalExpression">usertask2</from></p><p>          <to xsi:type="tFormalExpression">_3_TaskNameInput</to></p><p>        </assignment></p><p>      </dataInputAssociation></p><p>      <potentialOwner></p><p>        <resourceAssignmentExpression></p><p>          <formalExpression>karim</formalExpression></p><p>        </resourceAssignmentExpression></p><p>      </potentialOwner></p><p>    </userTask></p><p>    <endEvent id="_4" name="End" ></p><p>        <terminateEventDefinition/></p><p>    </endEvent></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <!-- connections --></p><p>    <sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" /></p><p>    <sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" /></p><p>    <sequenceFlow id="_3-_4" sourceRef="_3" targetRef="_4" /></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  </process></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  <bpmndi:BPMNDiagram></p><p>    <bpmndi:BPMNPlane bpmnElement="themasterbossexpl" ></p><p>      <bpmndi:BPMNShape bpmnElement="_1" ></p><p>        <dc:Bounds x="45" y="45" width="48" height="48" /></p><p>      </bpmndi:BPMNShape></p><p>      <bpmndi:BPMNShape bpmnElement="_2" ></p><p>        <dc:Bounds x="253" y="69" width="100" height="48" /></p><p>      </bpmndi:BPMNShape></p><p>      <bpmndi:BPMNShape bpmnElement="_3" ></p><p>        <dc:Bounds x="500" y="115" width="100" height="48" /></p><p>      </bpmndi:BPMNShape></p><p>      <bpmndi:BPMNShape bpmnElement="_4" ></p><p>        <dc:Bounds x="725" y="177" width="48" height="48" /></p><p>      </bpmndi:BPMNShape></p><p>      <bpmndi:BPMNEdge bpmnElement="_1-_2" ></p><p>        <di:waypoint x="69" y="69" /></p><p>        <di:waypoint x="303" y="93" /></p><p>      </bpmndi:BPMNEdge></p><p>      <bpmndi:BPMNEdge bpmnElement="_2-_3" ></p><p>        <di:waypoint x="303" y="93" /></p><p>        <di:waypoint x="550" y="139" /></p><p>      </bpmndi:BPMNEdge></p><p>      <bpmndi:BPMNEdge bpmnElement="_3-_4" ></p><p>        <di:waypoint x="550" y="139" /></p><p>        <di:waypoint x="749" y="201" /></p><p>      </bpmndi:BPMNEdge></p><p>    </bpmndi:BPMNPlane></p><p>  </bpmndi:BPMNDiagram></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p></definitions></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanx for help !</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/786819#786819">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM Development at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2035">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>