Outputting Data Objects From Rule Steps
- 07 Nov 2022
- 2 Minutes to read
- Print
- DarkLight
This documentation version is deprecated, please click here for the latest version.
Outputting Data Objects From Rule Steps
- Updated on 07 Nov 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 true/false outcomes. Rules can have the following output options:
Output Option | Description |
---|---|
New Output Data | Can define a new piece of data to output. |
Change Value | Changes the value of the input. |
Modify Text | Adds text to input can Append or Prepend text. |
Run Flow | Will run a Flow when a result or else is returned. |
It is possible to choose multiple output options.
Example
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 to import into Decisions.
To learn how to import into Decisions, see Import/Export Overview
- In a Designer Folder, click CREATE FLOW, select Default, and CREATE. Name the Flow (Output Data Object) and click CREATE.
- In the Flow Designer, select the Start step. On the Properties panel, click Show Editor under Flow Input Data below the Flow Data category.
- On the Data Definitions dialog window, enter "Age" in the Name field. Click the dropdown list under the Type field and select Int32 [Number]. Click CLOSE to return to the Rule Designer.
- Click on the Done path. Select the Run Rule step and click ADD.
- Next, click Create under Target on the Properties panel.
- Enter a name for the Rule (Rule for Data Object) and click CREATE.
- Click SETUP INPUT DATA.
- On the Input Data dialog window, enter "Age" under the Name field and change the Type to Int32 [Number]. Click CLOSE to return to the Rule Designer.
- In the If statement block, create a Rule that will evaluate if the "Age" is greater than or equal to the value of 21.To learn more about creating a Rule navigate Creating Your First Rule.
- To output data objects, click Add under Return True in the Result block and then click New Output Data.
- In the Add Output 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 Run Capturing All. 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.
Was this article helpful?