AnsweredAssumed Answered

Activiti 6: Dynamic activityId and triggering a receive task

Question asked by donovanmuller on Dec 4, 2015
Latest reply on Dec 8, 2015 by jbarrez
So, struggling a bit to get this working as expected

We have multiple processes for different work flows, some contain either 1 or more receiveTasks

<receiveTask id="receivetask1" name="Receive Task"></receiveTask>

The test process we created : [startEvent->scriptTask-> receiveTask -> scriptTask -> endEvent]

The below code will start the process and trigger successfully as we pass in the id of "receivetask1".

      "Starting process…");
                ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProcess");

                Execution execution = runtimeService.createExecutionQuery()

      "Execution id : " + execution.getId() + " - " + execution.getParentId() + " - " + execution.getActivityId());


The problem is we don't always know the receiveTasks`s id, or there could be more than one in the process.

  1. Is there anyway to look up the id during runtime? Almost same as looking for the current user task and then trigger the task
  3. did runtimeService.trigger(execution.getId()) replace runtimeService.signal(execution.getId())?
  5. i see from previous posts in using rs.signal( needed a while loop with sleep in case it isn't yet available. Is this still needed?  <a href="">example from camel component</a>