cancel
Showing results for 
Search instead for 
Did you mean: 

Querying to find currently waiting receive tasks

imamchishty
Champ in-the-making
Champ in-the-making
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.
1 REPLY 1

trademak
Star Contributor
Star Contributor
Hi,

You can use the getActiveActivityIds of the RuntimeService to get all active activity ids of a specific process instance.

Best regards,