AnsweredAssumed Answered

Querying to find currently waiting receive tasks

Question asked by imamchishty on Apr 4, 2012
Latest reply on Apr 28, 2016 by maikelnait
Hi guys,

I've taken this example from the activiti site:

<receiveTask id="waitState" name="wait" />  
 

To continue a process instance that is currently waiting at such a receive task, the runtimeService.signal(executionId) must be called using the id of the execution that arrived in the receive task. The following code snippet shows how this works in practice:

ProcessInstance pi = runtimeService.startProcessInstanceByKey("receiveTask");
Execution execution = runtimeService.createExecutionQuery()
  .processInstanceId(pi.getId())
  .activityId("wait")
  .singleResult();
assertNotNull(execution);

Question
If you don't have access to the activity Id is there anyway to find tasks that are in suspended state? All I have access to is the processInstanceId. Using this I need to signal to the waiting task to continue.

Outcomes