cancel
Showing results for 
Search instead for 
Did you mean: 

problem in multi instance task

pavan_bukka_ait
Champ in-the-making
Champ in-the-making
Hi all,
       I am trying to develop the following work flow , whenever a person raises a ecn  accept/reject task  will be generated to three groups, Accept/Reject task is multi instance parallel  user task. whenever a person who belongs to one of the three groups rejects the ecn request it should again go back to Raise ECN task . When all three groups aggre then only it should go to third task Accept/reject by manager task. I have used a process variable called status to store accept or reject status.

but now what happening is only after the third person accepts then it goes to the third task , if he rejects it goes back to first task . but it is not considering  what first two users have done. only after the third persons approval it goes to the respective task.

status is the process variable having the reject or accept status. why the first or second person rejects task is not getting created to the first person.
following is the process definition
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlnsSmiley Surprisedmgdc="http://www.omg.org/spec/DD/20100524/DC" xmlnsSmiley Surprisedmgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
  <process id="multiLevelEcnProcess" name="Multi Level Ecn Process">
    <startEvent id="startevent1" name="Start"></startEvent>
    <userTask id="raiseECN" name="Raise ECN" activiti:assignee="mnpatil2007@gmail.com"></userTask>
    <userTask id="acceptOrRejectECN" name="Accept/Reject ECN" activiti:candidateGroups="${assignee}">
      <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="assigneeList" activiti:elementVariable="assignee"></multiInstanceLoopCharacteristics>
    </userTask>
    <exclusiveGateway id="exclusivegateway1" name="Exclusive Gateway"></exclusiveGateway>
    <userTask id="usertask1" name="Accept/Reject By Manager" activiti:candidateGroups="${lastLevelGroup}"></userTask>
    <endEvent id="endevent4" name="End"></endEvent>
    <sequenceFlow id="flow1" name="" sourceRef="startevent1" targetRef="raiseECN"></sequenceFlow>
    <sequenceFlow id="flow2" name="" sourceRef="raiseECN" targetRef="acceptOrRejectECN"></sequenceFlow>
    <sequenceFlow id="flow3" name="" sourceRef="acceptOrRejectECN" targetRef="exclusivegateway1"></sequenceFlow>
    <sequenceFlow id="flow5" name="" sourceRef="exclusivegateway1" targetRef="usertask1">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${status =="accept"}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow8" name="" sourceRef="exclusivegateway1" targetRef="raiseECN">
      <conditionExpression xsi:type="tFormalExpression"><![CDATA[${status =="reject"}]]></conditionExpression>
    </sequenceFlow>
    <sequenceFlow id="flow9" name="" sourceRef="usertask1" targetRef="endevent4"></sequenceFlow>
  </process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_multiLevelEcnProcess">
    <bpmndi:BPMNPlane bpmnElement="multiLevelEcnProcess" id="BPMNPlane_multiLevelEcnProcess">
      <bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
        <omgdc:Bounds height="35" width="35" x="10" y="140"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="raiseECN" id="BPMNShape_raiseECN">
        <omgdc:Bounds height="55" width="105" x="80" y="130"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="acceptOrRejectECN" id="BPMNShape_acceptOrRejectECN">
        <omgdc:Bounds height="55" width="105" x="280" y="130"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="exclusivegateway1" id="BPMNShape_exclusivegateway1">
        <omgdc:Bounds height="40" width="40" x="460" y="137"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="usertask1" id="BPMNShape_usertask1">
        <omgdc:Bounds height="55" width="105" x="550" y="130"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape bpmnElement="endevent4" id="BPMNShape_endevent4">
        <omgdc:Bounds height="35" width="35" x="720" y="140"></omgdc:Bounds>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
        <omgdi:waypoint x="45" y="157"></omgdi:waypoint>
        <omgdi:waypoint x="80" y="157"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
        <omgdi:waypoint x="185" y="157"></omgdi:waypoint>
        <omgdi:waypoint x="210" y="157"></omgdi:waypoint>
        <omgdi:waypoint x="280" y="157"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
        <omgdi:waypoint x="385" y="157"></omgdi:waypoint>
        <omgdi:waypoint x="460" y="157"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
        <omgdi:waypoint x="500" y="157"></omgdi:waypoint>
        <omgdi:waypoint x="550" y="157"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
        <omgdi:waypoint x="480" y="177"></omgdi:waypoint>
        <omgdi:waypoint x="479" y="285"></omgdi:waypoint>
        <omgdi:waypoint x="354" y="285"></omgdi:waypoint>
        <omgdi:waypoint x="132" y="285"></omgdi:waypoint>
        <omgdi:waypoint x="132" y="185"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
        <omgdi:waypoint x="655" y="157"></omgdi:waypoint>
        <omgdi:waypoint x="684" y="157"></omgdi:waypoint>
        <omgdi:waypoint x="720" y="157"></omgdi:waypoint>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</definitions>

kind regards,
Bukka pavan kumar.
2 REPLIES 2

plehal
Champ in-the-making
Champ in-the-making
Set the  completion condition for multi-instance task  like ${status=='reject" ||  nrOfCompletedInstances==nrOfInstances }  to send it back as soon as anyone rejects it or move forward if all approve.

pavan_bukka_ait
Champ in-the-making
Champ in-the-making
thanks for the reply. I will try.
kind regards,
pavan kumar.