How to call Dynamic Sub Processes in BusinessWorks and BusinessWorks Container Edition

Emmanuel Marchiset
3 min readFeb 25, 2024

--

This is common in integration projects to have to manage flows with variants to take into account requirements that are specific to a given source or target, for example mapping rules might differ between business units or geographies.

To avoid duplicating flows to manage each variant, a common approach is to create a generic application managing the common requirements and handling specific requirements in Dynamic Sub Processes as needed.

For example, if output files have to be written in a different format depending on the target country, it is possible to create a Sub Process for each target country, include the country code in the Sub Process name (WriteFile_FR, WriteFile_DE, WriteFile_US, etc) and then at run time call the needed Sub Process based on the country code.

This article is to explain how to call Dynamic Sub Processes in BusinessWorks and BusinessWorks Container Edition. This apply to Direct Sub Processes.

Creation of the Sub Processes

It is generally recommended to create a dummy Sub Process to define the signature that is going to be used by all the Sub Processes needed to implement the target use case, by signature I mean the Input and Output schemas.

. Create a Direct Sub Process

Creation of a Direct Sub Process

. Set the Input and Output Schemas as needed, the dummy Sub Process can stay empty, it will not be used at runtime

Setting the Output schema of the Start Activity of the dummy Sub Process

. Then Copy / Paste the dummy Sub Process has needed and use Sub Processes names that will be easy to build at runtime (a common part and a variable part)

Example of a set of Dynamic Sub Processes

. Finally implement the needed logic in each of the created Sub Processes

Calling Sub Processes dynamically

. Use the CallProcess activity and configure it using the dummy Sub Process created earlier

CallProcess activity configured to call the dummy Sub Process

. Directly enter the XPATH code in the ‘Process Name Dynamic override’ section or create an XPATH formula using the XPATH editor

Sub Process names should be in the following format : <packagename>.<processname>

In case there are multiple levels of packages this should be in the following format : <packagename>.[<subpackage>].<processname> , for example Subs.fileout.WriteFR

for example : Subs.Sub2

Setting he Dynamic Sub Process override option
Using the XPATH editor

. The activity is now configured, in the example below, depending on the value of the $code properties it will call the Sub Process Sub1 or the Sub Process Sub2

Call Process activity configured for Dynamic Sub Process call

. Map the Input of the CallProcess activity as needed

Debugging the application in Studio

To debug your application in Studio it is important to make sure all the Dynamic Sub Processes are selected before starting the Debugger (it is not needed to select the dummy process).

Selection of Sub Processes in the Debug Configuration panel

Calling dynamically a Sub Processes located in a Shared Module

To do this the name of the Sub Process must use the following format:

<sharedmodulename>/<packagename>.<processname>

for example : MySharedModule/mysharedSubs.Sub3

Example of calling a Dynamic Sub Processe defined in a Shared Module

Reference elements

https://docs.tibco.com/pub/activematrix_businessworks/6.10.0/doc/html/Default.htm#binding-palette/call-process.htm

--

--

Emmanuel Marchiset

I work as an Architect at TIBCO Software on Integration products. Opinions here are my own.