dynamicSubworkflow Step

Last published at: May 2nd, 2023

Description:

Starts a subworkflow from a step - dynamically builds the workflow.  

Inputs

  • definitionID – definition to instantiate from
  • dynamicKeys -- dynamic keys to process
  • passVariablesToChild – passes variable values from parent to child instance.  Make sure, the child instance has the same variables, named exactly same as the parent variables.
  • passVariablesBackToParent – passes the variables values back to the parent from the child instance
  • passGlobalsToChild – pass Globals to child instance 
  • passGlobalsBackToParent – pass Globals back to the parent from the child instance
  • childKeyVariableName -- dynamic key variables
  • 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 keeps executing
  • pcvarmap – parent to child variable mapping
  • pcglobalmap – parent to child global mapping 
  • cpvarmap – child to parent variable mapping 
  • cpglobalmap – child to parent global mapping 

Returns

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

Usage:

Example:

Let’s build and execute the dynamicsubworkflowDef example and pass variables / globals to subworkflows and back.                       

  • Create a new form definition called “dynamicsubworkflowDef”
  • Select the definition and click the “design” button
  • Drag table, file and submit controls to the canvas and arrange them as shown on the below graphic

  • Click on the “File” control to configure its properties. Save the form definition

  • Create a new process definition called “dynamicsubworkflowDef”
  • Select the definition and click the “design” button
  • Define and configure the following variables

  • Define and configure the following globals

  • Drag and connect the steps on the canvas as shown on the below graphic

  • Click on the “updateVariables” step to configure its properties

  • Click on the “updateGlobals” step to configure its properties

  • Click on the “getFileAttachments” step to configure its properties
  • Click on the “dynamicSubworkflow” step to configure its properties
  • Configure the following values as shown on the below graphic. The dynamicSubworfklow step uses another process definition to build the workflow dynamically. In this example, the other process definition is created prior to this.   
  • NOTE: The configurations to pass variables/globals from parent workflow to child and back during run time are optional. 
  • Click on the "Parent to child variable mapping" and configure the values as shown on the below graphic. 

  • Click on the "Parent to child global mapping" and configure the values as shown on the below graphic. 

  • Click on the "Child to Parent variable mapping" and configure the values as shown on the below graphic. 

  • Click on the "Child to Parent global mapping" and configure the values as shown on the below graphic. 

  • Save the "dynamicsubworkflowDef" process definition to confirm the changes. 
  • Create another process definition called “BooleanDef” to be referred by the dynamicSubworkflow step. 
  • Select the definition and click the “design” button
  • Define and configure the following variables
  • Drag and connect the steps on the canvas as shown on the below graphic

  • Click on the “updateVariables” step to configure its properties

  • Click on the “updateGlobals” step to configure its properties

  • Click on the “decision” step to configure its properties

  • Save the "BooleanDef" process definition. 
  • Navigate to Create - Form Definition page. Select the above form definition "dynamicsubworkflowDef". Click on View - Execute by params menu option

  • Execute the form using the following configuration

  • A form instance is created and rendered in a new tab. As per this example, choose 3 files from your local system folders and upload. Click to SUBMIT the form. 

  • The dynamic subprocess step builds the subworkflow and executes it dynamically. 

  • In this example, the steps executes the subworkflow dynamically 3 times.