Workflow design: How to retrieve a sub-process request ID in the parent process

In some cases, you might have to save a sub-process request ID in a process data of the parent process. The solution is to update this parent process data (e.g. CHILD_ID) from the sub-process itself.

Note: This applies to WorkflowGen versions 5.6.3 and later only.

In the sub-process

Process data

Define a new process data:

  • Name: PARENT_ID

  • Data type: Numeric

  • Sub-process parameter: IN

This way, when the sub-process is launched, its process data PARENT_ID will contain the parent request ID that instantiated the sub-process.

Workflow

Create a new action (just after the start point) using the UPDATEPROCESSDATA workflow application with the following parameters:

  • REQUEST_ID send the value of: Data: PARENT_ID (or use the Parent Request.Id macro)

  • CHILD_ID send the value of: Macro: Request.Id

You can add an exception management on this action if the UPDATEPROCESSDATA application fails.

In the parent process

Process data

Define a new process data:

  • Name: CHILD_ID

  • Data type: Numeric

Workflow

In your sub-process action, add the following new parameter:

  • PARENT_ID send the value of: Macro: Request.Id