The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

jerryfiunam (61) [Avatar] Offline
#1
Hi again Tijs smilie,

In my webapp I want to query for all the active process instances where a user is involved. I do this with this sentence:

List<ProcessInstance> previo = runtimeService
.createProcessInstanceQuery()
.involvedUser(userId)
.active()
.list();

But the problem I have right now is that this sentence retrieves ALL THE PROCESS INSTANCES no matter if the instance is a process or a subprocess. I wonder if there exists a way to query just for those processes that are SUPERPROCESSES, that is, a way to exclude the subprocesses from the query.

I have taken a look into, for instance, the TaskService where you can do something similar with Tasks using the sentence " excludeSubtasks()" that belongs to TaskQuery. I wonder is there exists something similar in the ProcessInstanceQuery. If not I would like to know some ideas in order to exclude the suprocesses. Also if not exists this, do you think I can request for this functionality in JIRA? Something like:

List<ProcessInstance> previo = runtimeService
.createProcessInstanceQuery()
.involvedUser(userId)
.active()
.excludeSubprocesses().
.list();

Thanks again for your time.

Regards,

Jerry
tijs.rademakers (494) [Avatar] Offline
#2
Re: Processes and Subprocesses
Hi Jerry,

I saw that you created a JIRA issue for this right?
Yes I think we can still add this for the 5.13 releases, certainly makes sense.

Best regards,

Tijs