This operation retrieves the subprocesses associated with a process instance. Use it when parent process logic needs information about child process instances.
The base request is:
subprocesses()
The following example retrieves subprocesses for a process instance:
variables.children =
new RuntimeProcessInstanceService()
.subprocesses(
variables.processInstanceId,
25,
0,
null
);
In this example, new RuntimeProcessInstanceService() creates a service instance for interacting with process instances and subprocesses(...) retrieves the subprocesses associated with a parent process instance. variables.processInstanceId identifies the parent process instance. 25 limits the result to a maximum of 25 subprocesses, 0 starts the query from the first result, and null indicates that no additional query filter is applied.
Because this operation returns the results directly, the script can immediately inspect child process instances, evaluate their status, or use the information in subsequent process logic.