AnsweredAssumed Answered

How to create Multi instance User Task without using XML

Question asked by surindersingh on Mar 20, 2014
Latest reply on Apr 7, 2014 by surindersingh
I have created user task which i can assign to multiple user at a time using XML
<?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" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="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="myProcessmulti" name="NEW MULTIPROCESS INSTANCE" isExecutable="true">
    <startEvent id="startevent1" name="Start">
    <extensionElements>
            <activiti:formProperty id="decisionInfo" name="Decision info" required="true" type="string" />
            <activiti:formProperty id="participants" name="Participants (comma separated)" required="true" type="string" />
         </extensionElements>
    </startEvent>
    <serviceTask id="servicetask1" name="Service Task" activiti:class="com.poc.multiinstance.CreateAssigneeList"></serviceTask>
    <sequenceFlow id="flow1" sourceRef="startevent1" targetRef="servicetask1"></sequenceFlow>
    <userTask id="usertask1" name="User Task" activiti:assignee="${assignee}">
      <multiInstanceLoopCharacteristics isSequential="false">
       <loopDataInputRef>assigneeList</loopDataInputRef>
      <inputDataItem name="assignee"/>
      </multiInstanceLoopCharacteristics>
    </userTask>
    <sequenceFlow id="flow2" sourceRef="servicetask1" targetRef="usertask1"></sequenceFlow>
    <endEvent id="endevent1" name="End"></endEvent>
    <sequenceFlow id="flow3" sourceRef="usertask1" targetRef="endevent1"></sequenceFlow>
  </process>


Can i done this in activiti without using XML file ?. And how can i use the MultiInstanceActivityBehavior.class file to assign the task manually to multiple user at time?.


I would appreciate your help. Thank You.

Outcomes