Using Runtime Selection
  • 08 Jul 2022
  • 3 Minutes to read
  • Dark
    Light

Using Runtime Selection

  • Dark
    Light

Article Summary

Overview

Via the settings provided in the Flow Designer, the choice of which Flow or Rule is called can be made either at Design time (see Using Sub Flows) or at Runtime.

As this differs from the Target selection's Inputs, which are known at Design Time, users are given the option to define Inputs via the Additional Data For Flow option, allowing for more dynamic mapping options. The following document explains and demonstrates the options that are available when using Runtime Selection. The following document explains the options available when choosing a Flow or Rule at Runtime. 


Use Case

Note on Use Case
Note that the following is a description of one possible example use case; the Runtime Selection Property can be implemented in many other ways not depicted.

A process needs to run a Flow that is based upon which day of the week an item is submitted. This Flow would return a different score based upon the different logic of each day. For example; Monday has logic that is different from Tuesday, and Tuesday's differs from that of Wednesday. Even though the logic within each Flow is different, the Input and Output names are the same.

The Flow set for the Target is the Flow that takes in the data and outputs a score. At Runtime, the Flow will determine the day of the week, then fetch the proper Flow Id, and pass that into the Target Id Input using Select From Flow mapping.


Enabling Runtime Selection

To set a Flow/Rule to allow selection at Runtime, users may utilize the Runtime Selection Property via the Selection Type dropdown located under the ADVANCED category of the step (either a Rule step or Run Sub Flow). 


To set the Flow/Rule to allow a selection at Runtime:

  1. From the Flow Designer, attach the desired step (either Run Sub Flow or Run Rule) from the FAVORITE STEPS category of the Toolbox tab to the Start step, or the proceeding Process logic. 
  2. From the Properties tab of the newly added step, under Advanced > Selection Type, select Runtime Selection.
  3. Still in the Properties tab, PICK OR CREATE TARGET. 
    About Target
    Choosing a Target will allow the user to map in the Inputs and see Outputs of a Flow. To run a dynamic Flow that takes in Inputs, those Inputs can only be specified if the Target has the same ones. 
  4. Map in the desired Target Id.
    About Target Id
    The Target ID represents the ID of the Flow that is being called on whenever the Run Sub Flow or Run Rule step is reached in a process at Runtime.

  5. If applicable provide Additional Data For Flow (see following section below for additional information) by selecting ADD, defining the data, then clicking OK. Then map the Input via the Properties tab. 



Additional Data For Flow

The Additional Data For Flow panel serves the purpose of providing Input Data to a Flow where the exact Input Data parameters are unknown at design time.

This Property can be utilized in situations where Runtime Selection is chosen from the Selection Type drop-down box and can be found under the ADVANCED Properties category of the Run Sub Flow step.

Since the Flow (determined via Target Id) ran is unknown at design time, the Flow's Input Data parameters can not be mapped directly. Instead, these values are added in the Additional Data For Flow panel. This data will be then be passed through if it matches the linked Flow's Input Data. 

To add additional data for the Flow, click Add New. Then utilize the resulting window to determine how the data is passed through using the following options:

Property NameDescription 
Output data nameThis allows users to input a Name for the data.
Data typeThis drop-down allows users to select a DataType for the additional data.
Can be nullEnabling this box allows the data to have a null value.
Is list Enabling this box defines the data as a List.
SelectEditorChecking this box gives users access to the PropertyEditor selector which allows users to select from a drop-down list of properties that can be applied to the data.


Get Flow/Rule ID

In the event that a user wishes to define the Flow or Rule ID as a Constant value, they may obtain the value of a specific item via the Get Flow/Rule ID action.

To obtain the ID for a Flow or Rule:

  1. Navigate to the Flow or Rule that will be used as a Runtime Selection.
  2. Right-click the desired Designer Element and navigate to Manage > Get Flow/Rule ID
  3. Select Copy Text, then click DONE.

Was this article helpful?