As part of process migration effort, we need to start a process with any user task. To complicate the issue, we further need to start a user task in a subprocess.
To achieve that, we first use createProcessInstanceByKey to start the subprocess, then we use the following to start the user task within the subprocess:
runtimeService.createProcessInstanceModification(subprocessPid) .startBeforeActivity(targetTaskId) .setVariables(payload) .cancelAllForActivity(sourceTaskDefId) .execute();
But the issue is the subprocess starts with an Event Gateway, that we don’t know how to get the activity ID, similar to user task.
Here is the illustrated subprocess model:
How can we get the activity ID of the Event gateway that we can use to cancel the activity on Event Gateway?
Thank you so much for your help in advance!