cancel
Showing results for 
Search instead for 
Did you mean: 

Get all processes in ReceiveTask

alef
Champ in-the-making
Champ in-the-making
Hi all,
is there a way to retrieve all processes in ReceiveTask and related ProcessInstanceIds?
Thanks in advance.
3 REPLIES 3

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Alef,

yes, there is a way. Use extension elements and task listener in the receive task. Task listener should run your query with runtime service.
To include currently running process instance into the query make receive task async (transaction is committed).

Regards
Martin

alef
Champ in-the-making
Champ in-the-making
Thanks Martin,
could you please give me more details about the query?

I saw that with HistoricProcessInstanceQuery I can retrieve unfinished processes, but I need also distinguish suspended processes from those in receive task.
Both processes are in ACT_HI_PROCINST table and are unfinished.

The used statement is the following:
<java>List<HistoricProcessInstance> unfinishedProcs = historyService.createHistoricProcessInstanceQuery().unfinished().list();</java>

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Alef,

to query for suspended processes use runtime service (runtimeService.createProcessInstanceQuery().suspended().list()). I did not find a way how to distinguish between suspended/non-suspended processes in HistoricQuery.
If you wan to fetch all process instances in one query use native API.
To query for all jobs use management service

Regards
Martin
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.