Starts a subworkflow from a step

Use this step to separate functions and execute.

Last published at: July 27th, 2023

subWorkflow Step

Description:

This step separates functionality into child instances and executes them separately from the parent instance.

 

Inputs

  • name - the name of the step
  • definition to use – definition to instantiate from
  • passVariablesToChild – passes variable values from parent to child instance. Make sure the child instance has the same variables, named the same as the parent variables
  • passVariablesBackToParent – passes the variable's values back to the parent from the child instance
  • passGlobalsToChild - Pass globals to child instance
  • passGlobalsBackToParent - pass globals back to parent
  • parentToChildVariableMapping - map the variables from child to parent workflow
  • parentToChildGlobalMapping - map the globals from child to parent workflow
  • isSynched – Yes = parent waits until child instance is completed to execute, No = parent instance does not wait for the child instance to complete, parent instance continues execution
  • executionPriority -Select execution priority
  • childToParentVariableMapping - map the variables from parent to child workflow
  • childToParentGlobalMapping - map the globals from parent to child workflow
 

 

Returns

  • True – step executed successfully
  • False – step failed to execute 
 

 

Usage:

 

 

Example:

Let’s build and execute the “subWorkflowDef” example.          

  • Create a new definition called “subWorkflowDef.”
  • Select the definition and click the “design” button
  • Drag the “updateVariables”, “updateGlobals,” “subWorkflow”, “decision,” and “place holder” controls to the canvas
  • Connect the dots between the controls as shown above
  • Define variables/globals to store the values and results after execution
  • Click on the "updateVariables" step to configure its "Settings" properties. Provide a name to the step. Navigate to the “Advanced” tab. Click on the icon and provide values to multiple variables.

 

  •  Click on the "updateGlobals" step to configure its "Settings" properties. Provide a name to the step. Navigate to the “Advanced” tab. Click on the icon and provide values to multiple globals.

 

  • Click on the "subWorkflow" step to configure its "Settings" properties. Give the step a name. Select the process definition to use as a separate function from the dropdown list. 

 

  • The process definition configured as sub-workflow in this example has this workflow

 

  • Click on the "evalExpression" step to configure its "Settings" properties. The expression here computes the variables and global values passed to the subworkflow during runtime. 

 

  •  Click on the "subWorkflow" step to configure its "Advanced" properties. Configures “Yes” to pass variables to the child instance. Configures “Yes” to pass variable values back to the parent instance. Configure “Yes” to pass globals to the child instance. Configure “Yes” to pass global values back to the parent instance. Click on the button to map “parent-to-child” variable values to and fro. Click on the button to map “parent-to-child” global values to and from. Configure “Yes” to Is Synchronized if a parent should wait until the child instance is completed to execute. Configure “No” if the parent instance does not wait for the child instance to complete; the parent instance continues execution. Select execution priority from the dropdown list - “low, medium, high.” 

 

  • Click on the button to map the “parent-to-child” variable mapping. Click on the “Add Row” icon to add new rows to map sub-process variables with parent process variables or values.  

 

  • Click on the button to map “parent-to-child” global mapping. Click on the “Add Row” icon to add new rows to map sub-process globals with parent process globals or values. 

 

  • Click on the button to map the “child-to-parent” variable mapping. Click on the “Add Row” icon to add new rows to map sub-process variables with parent process variables or values.  

 

  • Click on the button to map “child-to-parent” global mapping. Click on the “Add Row” icon to add new rows to map sub-process globals with parent process globals or values. 

 

  • Click on the "decision" step to configure its "Advanced" properties. Provide a name to the step.  Provide the expression to evaluate. 

 

  • Click on the link connection properties and configure the “True” and “False” process paths for the workflow. 

 

  • Save the process definition, create a new process instance, and execute. Render the process instance.  To render the child process instance, click on the navigation icon (black color) on the sub-workflow step. 

 

  • The child process instance is rendered in a new tab.