cancel
Showing results for 
Search instead for 
Did you mean: 

Receive Task doesn't create a task? How do I find processes in a Receive Task state?

roadtripryan
Champ in-the-making
Champ in-the-making
I'm modeling a JavaDelegate Service task with a Receive Task right after it. The delegate may be long running, so I have it return immediately, which puts the workflow in the Receive Task to wait for a signal the JavaDelegate is complete. (which will occur later from a different process)

The issue is my JavaDelegate is called, but I am not sure how to find the processes that are in a Receive state. If I query the process directly, it doesn't have any tasks assigned to it, and is not in a suspended state. I had expected to find a task assigned to the process instance to know it was in the receive task state.

How can I query the engine to find processes that are in a receive task wait state?
1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

  • receive task does not create task
  • runtimeService.createExecutionQuery().activityId(YOUR_RECEIVE_TASK_ACTIVITY_ID).list() returns list of all executions waiting on the receive task.
(I would use signal or message instead of receive task.)

Regards
Martin