IBM BPM, V8.0.1, All platforms > Create processes in IBM Process Designer > Modeling processes > Create a business process definition (BPD) > Subprocess types > Work with linked processes
Calling a linked process dynamically
When you use a linked process as the implementation for an activity, you can use an advanced option in the implementation properties to supply a predefined variable to dynamically call one of many linked processes, depending on your needs.
To use the dynamic option for a linked process, first:
- Create a variable of type String in the parent process to hold the name of the linked process that you want to run. Your parent process must also include the logic to determine the value of this variable at run time.
For example, the parent process can include logic to set the value of this variable based on user input.
- Establish the input and output variables for each potential linked process so that the parent process runs as expected regardless of which linked process is called. To meet this requirement, the variables in all potential linked processes must be the same. To map variables from the parent process to the linked process, follow the steps described in Work with linked processes.
To configure an activity to dynamically call one of many potential linked processes:
Procedure
- Open the parent business process definition (BPD) in the Process Designer.
- Click the activity that you want to work with in the BPD diagram.
- Click the Implementation tab in the properties.
- Under Implementation, select the Linked Process menu option.
- Click Select to choose one of the predefined linked BPDs from the library.
You must initially select one of the predefined linked BPDs for the dynamic configuration to function properly.
- Click the Data Mapping tab in the properties.
Because you already created the input and output variables for the linked process, the Data Mapping tab for the activity in the parent process includes those variables.
- Under Input Mapping, click the auto-map icon in the upper-right corner, and then click the auto-map icon in the upper-right corner of the Output Mapping section.
- Click the Implementation tab in the properties.
- Click the indicator next to the Advanced section heading to expand the section.
- Click the variable icon next to the Dynamic Sub-Process field to choose the previously defined variable that provides the name of the selected process.
At run time, the value of this variable cannot be null and it must exactly match the name of an existing BPD.
- Save the configuration.