cancel
Showing results for 
Search instead for 
Did you mean: 

How to define custom Id to additionally identify a process instance

shuchi
Champ in-the-making
Champ in-the-making
Hi,

I have a use-case where I want to define a parent Id to associate multiple process instances in a process. I want to fetch data of all process instances associated with this parent Id. How is it possible to provide such a custom identifier? Also, how can this custom identifier used for querying purposes?

Thanks,
Shuchi
4 REPLIES 4

trademak
Star Contributor
Star Contributor
Hi Shuchi,

I think the easiest approach would be to use a specific process variable in all these process instances for this purpose. You can use the query API to search on a specific process variable value then.

Best regards,

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Shuchi.

2 possibilities came to my mind (there are others too):
  • use your custom process variable with the value and store in activiti tables. (- performance of the queries, + ready to use)
  • extend activiti structures to cover your needs
Regards
Martin

shuchi
Champ in-the-making
Champ in-the-making
Thanks Tijs and Martin, I defined a process variable per process instance initialisation to differentiate process instances and used businessKey to group them. However, I am not able to query by businessKey. This is what I am doing:

POST query/process-instances

{
  "processDefinitionKey": "MyProcess",
  "businessKey":"MyBusinesKey"
}

I have tried replacing "businessKey" with "processInstanceBusinessKey" as well but each time I get a 400.

Is querying by businessKey not possible or am I doing something wrong here?

Thanks,
Shuchi

jbarrez
Star Contributor
Star Contributor
Use 'processBusinessKey'. It is described in the user guide … (which is where I found it)