How do i set the Superprocess instance ID in camunda using camunda rest api?

Hi, I would like to use the SuperProcessInstance Id and the subprocessinstance id. Found ways to query tickets based on these params but how to actually set these params while creating a ticket for a given process definition… Any thoughts?

@myarlagadda If I understand what you are asking - you’re looking to get process instances of main and subprocess for a given request. If that is so, you can try businessKey while starting the main BPD and use the business key to fetch all the process instances from the cockpit or REST API.

Hope this helps!

1 Like

@Arjun1007 Thanks for your response. I m looking for a Java/REST api the could set super process instance ID on a subprocess. Say Process 1 - does a call activity and calls process 2 - I could see a Superprocessinstanceid associated on the processinstanceid of process 2. Now this is done via the BPMN processing itself - I am looking for programmatically setting it.

I would be surprised if such a function existed that is intended to be called.

The SuperProcessID is the GUID that the engine uses internally to refer to the process that called the process. If your process (outside the engine) is starting the process, then your external system’s GUID would not be a valid reference for the engine to follow.

1 Like

In my case its not an external system. I would like to use this superprocessinstanceid and the rootprocessinstanceid as a design pattern to implement parent/child relationships amongst tickets that are getting created. In the get query there is such param to query based on the super and root. The value is also getting set if a process is called via the flow. My requirement here is I would like to build a UI where i can create a child ticket of a parent ticket, and as i create the child ticket i would like to set the superprocessinstance id on the child ticket.

  • superProcessInstanceId

ProcessInstanceQuery superProcessInstanceId(String superProcessInstanceId)

Select the process instances which are a sub process instance of the given super process instance.

Hi @myarlagadda,

superProcessInstanceId is set when you model a call activity and the called process is started.

There is no public API to set this value.

If you create the parent child relationship manually, you can use either the businessKey common for all processes or a dedicated process variable to refer to your parent process.

Hope this helps, Ingo

Thanks @Ingo_Richtsmeier , that’s helpful! Also is there a way we can create a product backlog item with camunda. Because we do not want to have two different implementation methods one while its embedded in BPMN when compared with the Custom ui.I would definitely love to take advantage of what camunda offers and the respective processinstancequery API’s camunda offers. thoughts?

You should be able to create a feature request at https://jira.camunda.com
But…
In my opinion (not a Camunda employee, so don’t take my opinion as their stance), it will be closed as “working as intended”. Your UI shouldn’t be trying to manage the pieces of the process - put the pieces in the process (ie. model them in the BPMN) and let the Camunda engine manage the sub-processes and relationships.