Creating Custom Rule Verbs Using Rule Engine Extension
- 08 Sep 2021
- 2 Minutes to read
- Print
- DarkLight
This documentation version is deprecated, please click here for the latest version.
Creating Custom Rule Verbs Using Rule Engine Extension
- Updated on 08 Sep 2021
- 2 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Overview
This Flow Behavior Type is used to create a custom verb for Rules within a Flow. The Rule Engine Extension will use this custom verb to evaluate Rule Flow behavior.
Example
In this example, the Rule Engine Extension Flow behavior will create a custom verb (Is Email Address In List) for the Rule Engine. This Flow will have a string input (emailaddress) and will query Decisions Accounts and check if the email address provided matches any of the records in the email address field of the accounts.
- On the action bar of the Designer Project, click CREATE FLOW and select Flow [Advanced]. Scroll down and select Rule Engine Extension and click CREATE. Name the Flow (Is Email In List) and click CREATE to open the Flow Designer.
- Select the Start step and click Show Editor under the Flow Data category on the Properties panel.
- On the Data Definitions dialog window, enter "EmailAddress" in the Name field and leave the Type as String [Text]. Then, click CLOSE to close the dialog window to return to the Flow Designer.
- Click the Done path. Select the Fetch Entities step and click ADD.
- Under the Entity Fetch Definition category, click the dropdown button under Type Name and enter "account". Select Account [DecisionsFramwork...].
- Click Add New under Fetch Criteria. In the Field Name field on the Add Fetch Criteria dialog window, enter "emailAddress". Leave the Query Match Type as the default of Equals and click OK to save and close the window.
- Under the Inputs category, click Unknown and select Select From Flow. Then, select Email Address on the dialog window and click DONE.
- Click the Results path on the Fetch Entities step. Next, select Create Data and click ADD.
- Under the Data category, click Show Editor. In the Data Definitions dialog window, enter "output" in the Name field and change the Type to Boolean [Logical]. Then, click CLOSE to save the data.
- Under the Inputs category, select the checkbox and enter "output" in the textbox under the Outputs category.
- Click the No Results path and repeat steps 7 and 8 with output as a boolean value. In the OUTPUTS category on the Properties panel, rename the output as "output".
- Connect the two Done paths to the End step. Then, select Unknown next to the Result field and click Select From Flow. Select output and click DONE.
- Click Save and close the Flow Designer to return to the Designer Project.
- On the Designer Project screen, click CREATE RULE on the action bar. Select Statement Rule and click CREATE. Name the Rule (Validation Rule) and click CREATE to open the Rule Designer.
- Click SETUP INPUT DATA.
- Under the Name field on the Input Data dialog window, enter "emailAddress" and leave the Type field as String [Text]. Click CLOSE.
- Next, in the If statement block, create a Rule phrase that will take the emailAddress and evaluate it based on the created verb (Is Email Address In List) and no parameters. Click Save to save the changes to the Rule.
Debug
- On the top action bar, click Debug.
- In the textbox under email Address, enter an email (admin@decisions.com) and click Run Capturing All.The result will evaluate as true when ran when the email is found in the list of accounts.
Was this article helpful?