Expose Step as a RuleLast Updated: 08/12/2016 Introduced in Verision: 3.2 |
This tutorial demonstrates how to Expose Step as a Rule. This step configuration is available for any step in Decisions that has True/False outcome (including Rules). Expose Step as a Rule is helpful in such cases when step has one Outcome path with True or False value and we need two separate outcome Paths (one for True and one for False). Also, it is useful when Rule step has two outcome Paths and we need one outcome Path with either True Or False value.
Example:
We start in the Designer Folder with clicking Create Flow from the Folder Actions Panel to create a demonstration Flow.
Next, we Name the Flow and click Create to proceed to the Flow Designer.
In the Flow Designer we add Random Rule step from All Steps [Catalog] > Data > Rules category.
This is a Rule Step that has two outcome Paths: True and False. Depending on this Rule evaluation our Flow will continue execution on either True or False path.
For this example we will design a Notification to pop-up if this Rule evaluates as False. On the False outcome from the Random Rule step we add Show Popup step from the Favorite Steps category.
In the resulting window we configure Subject and Message for the Notification step and click Add.
Then, we connect outcome from the Show Popup step to the End Step in our Flow. On the True outcome from the Random Rule step we add another Random Rule step from the All Steps [Catalog] > Data > Rules category.
Next, we select second Random Rule step on the workspace to configure it. This time we do not want two outcomes from the step. Instead, we want this step to output True or False value to one Outcome Path. In this way we can use it for Form Control Visibility. In the step configurations we locate and expand Outcomes section. Under Outcomes section we uncheck Expose Step as a Rule checkbox.
After we uncheck Expose Step as a Rule checkbox, our step changes shape from diamond to rectangle. The Outputs section is being generated for the step configurations. In the Outputs section we can confirm that our step has only one outcome Path now.
On the Done outcome path from the second Random Rule step we add Show Form step from the Favorite Steps category.
In the resulting window we Name the Form and click Create to proceed.
Our Form is simply designed with only Button and Label component. The key point for our example is that Label visibility depends on the Flow Data Boolean input. We will use the outcome from the second Random Rule to either make the Label visible or not. When finished designing the Form we can save and close Form Designer.
Back in the Flow Designer we connect the outcome from the Form Step to the End Step in the Flow. Then, we select Form Step on the workspace to configure data mapping for the Label visibility control in the Form. We locate showLabel Input and with Select Value Mapping type we pick the Output from the second Random Rule step.
This completes our Flow. To test it we click Debug Flow link on the top panel of the Flow Designer.
Note that in Decisions version 3.5 and above, you’ll need to click Test Flow to access the Debugger.
Our Flow executes on the False outcome path from the first Random Rule step and Notification pops up. We rerun our Flow…
This time our Form shows up but Label on the Form is not visible…
This means that our Flow executes on the True outcome path from the first Random Rule step and second Random Rule step outputs False value. We rerun the Flow again…
This time our Form shows up with visible Label on it.
The outcome from the second Random Rule step is True…