Outputting Data From Rule Steps
- 28 Jun 2022
- 2 Minutes to read
- Print
- DarkLight
Outputting Data From Rule Steps
- Updated on 28 Jun 2022
- 2 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Overview
Rule Steps can be configured to return data objects, rather than just outputting true/false, using the following output options: It is possible to have options as an output. The same behavior is also available for Truth Tables.
Output Option | Description |
---|---|
New Output Data | Defines a new piece of data to output |
Change Value | Changes the value of the input |
Modify Text | Adds text before (Prepend) or after (Append) input data |
Run Flow | Runs a Flow when a result or else is returned |
Outputting Data From a Truth Table
For a Truth Table, Selecting the + symbol in the header column for the Output section will provide a dialog box to define the data object.
Outputting Data From Statement Rules
The Rule in this example will determine if the age provided is less than or greater than 21. If it is under 21, it will output the message "You MUST be 21. Purchase is denied.". If the age given is over 21, the message will display "Purchase is approved". Below is a downloadable example that can be imported.
- In the Flow Designer, select the Start step. On the Properties panel, click SHOW EDITOR under Flow Input Data below the FLOW INPUTS category.
- On the Flow Inputs dialog window, enter "Age" in the Name field. Click the dropdown list under the Type field and select Int32 [Number]. Save and then close the window to return to the Flow Designer.
- Click on the Done path. Select the Run Rule step and click ADD. Create or pick a new Statement Rule.
- Next, click SETUP INPUT DATA and click DEFINE on the Rule Input Data dialog window.
- On the Input Data dialog window, enter "Age" under the Name field and change the Type to Int32 [Number]. Save and close to return to the Rule Designer.
- In the If statement block, define a Rule that will evaluate if the "Age" is greater than or equal to the value of 21.
- To output data objects, click Add under Return True in the Result block and then click New Output Data.
- In the AddOutput Data dialog window, enter "Purchase" under the Name field and click OK to return to the Rule Designer.
- In the textbox next to Purchase, enter "Purchase is approved." In the Else statement block, click the Purchase checkbox and enter "You MUST be 21. Purchase is denied." in the textbox. Save and close the Rule to return to the Flow Designer.
- Connect the Done outcome path to the End step and click Save.
Debug
- Click Debug on the top panel.
- Enter a number in the textbox under Age that is less than 21 and click START DEBUGGING. Select the Run Rule step, click Execution 1, then select View Input/Output Data.
- The result will display the number entered and the output will display the message that was typed in the Else statement block.
- Click CREATE NEW SESSION and enter a new value that is greater than 21. After the Debugger has run, view the Input/Output Data. The result will display the message that was typed in the Result block.
For further information on Rules, visit the Decisions Forum.
Was this article helpful?