AnsweredAssumed Answered

Add a receive task after my task programmatically

Question asked by esseti on Jun 12, 2013
Latest reply on Jun 25, 2013 by esseti
Hi all,
is there a way to post-process the Process adding (programmatically) a task (receive task)?
I've to add this task after my personalised Java Task  .
     <serviceTask id="servicetask1" name="MyTaskName" activiti:class="com.example.MyTask" activiti:extensionId="MyTask">
in theory what i should do is (pseudocode)

process = magic.getProcess();
for(MyTask task: process.getTaskByType(MyTask){
// save the next task
      Task temp = task.next;
// create the receive
      Receive r_task = new ReceiveTask(id,name);
// put the receive after my task
      task.next = r_task;
// add the temp as next of the receive
      r_task.next = temp;

}

is there anything like this that i can do?

Outcomes