How can I get the process instance id from the previous event?

For example, if I am in a call activity and want to get the process instance of the previous task, how can I do it?

Hello @CRA ,

this thread may help you:

Jonathan

I’ve just done this!

Inside each called process (from the main process), I create an output variable “processInstanceIdProcessName” on a convenient task (or a standalone task for mapping output variables. That makes it easier to know where they are).

The value is set to ${execution.processInstanceId}

Then for each call activity (the activity in the main process), I create an output mapping for that variable (source) outputting to the main process called “processInstanceIdProcessNameMain” (target). You’ll see it pop up as a process variable in the main process.

That way I can tell the processInstanceId for each of the called processes.

3 Likes