How can I query for active processes?

Hi,

further exploring the BProc add-on… in my use case I start a process programatically when entity A is newly created and stored with field .a = “PENDING”.

The point is that if I store that entity, reopen and store it again with the same entity status, I start two different processes for exactly the same thing. That’s something I definetely don’t want.

To avoid such a scenario I need to query currently active processes, filter them by name and inspect the business key to ensure I am not starting an additional process to accomplish exactly the same.

Have had a look at the injectable bproc beans, but none of them seems to enable querying in such a manner.

Can anybody give some hints please?

Regards,
Carlos.

Hi,

already found a way.

List procesos = bprocRuntimeService.createExecutionDataQuery()
.processInstanceBusinessKey([business_key]).list();

Thanks and regards.
Carlos.