Expose Step as a Rule

Last Updated: 05/02/2018 Introduced in Version: 3.2

This tutorial demonstrates how to expose a step as a rule. This configuration is available for any step in Decisions that has a True/False outcome. The configuration, Expose Step as a Rule, is helpful when we need separate outcome paths (one for true and one for false). It  is also useful when we need to merge a rule steps multiple outcome into a single outcome.

Example

In a Designer Folder, click Create Flow.

 

Name the flow and click OK to proceed to the Flow Designer.

 

In the Flow Designer we add a 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 the rule’s evaluation, our flow will execute either path.

 

For this example we will have a notification display if this rule evaluates as False. On the False outcome we add a Show Popup step from the Favorite Steps drop down.

 

In the resulting window we configure the Subject and Message for the Show Popup step and click Add.

 

Connect the outcome from the Show Popup step to the End Step. On the True outcome from the Random Rule step we add another Random Rule step from All Steps [Catalog] > Data > Rules.

 

Select the second Random Rule step on the workspace to configure it. This time we do not want two outcomes from the rule step. We want this step to output both True and False values to one Outcome Path. This grants us the ability to use it for Form Control Visibility. In the step configurations, locate and expand the Outcomes section and uncheck the Expose Step as a Rule checkbox. 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, add a Show Form step from the Favorite Steps category.

 

In the resulting window we name the form and click Create to proceed.

 

Our form is designed with an Action Button and a Label component. The key point for our example is that the Label visibility depends on the Flow Data’s Boolean input. We will use the outcome from the second Random Rule to display the Label. When finished, save and close the Form Designer.

 

In the Flow Designer we connect the outcome from the Form Step to the End Step. Then, we select the 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 select the Output from the second Random Rule step.

This completes our Flow. To test, click the Debug Flow link on the top panel of the Flow Designer.

 

 

Our Flow executes on the False outcome path from the first Random Rule step.

ruleevaluatesfalse

 

When the flow is rerun, eventually, our Form shows up but the 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 the second Random Rule step outputs a False value. When the flow is ran again, our Form displays the label’s text. Therefore the outcome from the second Random Rule step is True as shown below.

 

 

Additional Resources