Sequential Rule
- 17 Sep 2021
- 4 Minutes to read
- Print
- DarkLight
This documentation version is deprecated, please click here for the latest version.
Sequential Rule
- Updated on 17 Sep 2021
- 4 Minutes to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Overview
A Sequential Rule is a Flow Behavior that allows a user to connect Rules together with limited processing steps in between to specify a very specific set of conditions that have to be run in a specific order.
Sequential Rules can be a Data Return Rule or True/False Rule. Both can be used as a Sub Flow since they will redirect a user to a Flow Designer.
Example
In the following example, a user will fill out a Form with their name, age, gender, and medical issue. A sequential rule will then perform Rules on the input data to evaluate which specialist the user will need. A popup will display with a message notifying them of the specialist to contact.
- In a Designer Project, click CREATE FLOW. Select Default and click CREATE. Name the Flow and click CREATE.
- Click the Done path on the Start step. Select Show Form and click ADD.
- On the Properties panel, click Pick or Create Form. Name the Form and click CREATE.
- Configure the Form to have a Text Field component (UserName), Number Box component (UserAge), two Drop Down List components (UserGender, MedicalIssueList), and a Button component (SUBMIT). On the MedicalIssueList, add "Severe Toothache", "Short of Breath", "Chronic Pain in joints or muscle", "Fainting", "High Fever", and "Pregnancy". Click Save to save the Form and click Close.
- Click the SUBMIT path. Select Run Sub Flow and click ADD.
- On the Properties panel, select Pick or Create Flow. Name the Flow and under Behavior, select Sequential Rule, and click CREATE.
- Select the Start step. On the Properties panel, click Show Editor under Flow Input Data.
- On the Data Definitions window, enter "Name" and "Gender" as a String [Text], "MedicalIssue" as String [Text] list, and "Age" as an Int32 [Number]. Click CLOSE.
- Click the Done path. Select Run Rule and click ADD. On the Properties panel, select Pick or Create Rule. Name the Rule and click CREATE.
- Click SETUP INPUT DATA.
- Enter "Gender" as the data input and click CLOSE.
- In the If Statement, click Select Data Element, choose Gender, and click NEXT. On the Pick Verb dialog, choose Is and click NEXT. Enter "Male" under the Gender as a Constant value and click DONE. Save and close the Rule.
- Select the True path and add another Rule. Configure the Rule to evaluate as "if Age is greater than or equal to 18".
- On the False path of the Gender Rule, pick the Age Rule.
- Select the False path of the Age Rule. Select Run Truth Table and click Add.
- Click Pick or Create Truth Table from the Properties panel. Name the Truth Table and click CREATE.
- Click SETUP INPUT DATA and add "Age", "Gender", and "MedicalIssue" as data inputs. Click the Checkbox for Is List for MedicalIssue. Click CLOSE to save.
- Click Select Data Element and select Age and choose Between as the verb. Click the pencil icon in the cell and enter "1" and "17".
- Click the plus sign icon to add a new column. Select Gender and click Is. In the cell, enter "Male".
- Add a column for Medical Issue and choose verb List Contains Any. In the cell, enter values from the Start step of the Sequential Flow.
- Hover over the Default Output Data column and click the pencil icon. Rename the column to Specialist and change the Type to String [Text]. Click OK.
- In the cell, enter "Dr. Sarah Jones, Pediatrician".
- Click Click To Add Row with the same age range with Female as gender and the same Specialist.
- Add another row that will evaluate "if age is 18-80 and gender is Male with MedicalIssue List Contains Short of Breath and Chronic Pain in joints or muscle" and add "Dr. Tom Robinson, Chiropractor" as the Specialist.
- Add a row that will evaluate "if age is 18-45 and gender is Female with MedicalIssue List Contains Chronic Pain in joints or muscle and Pregnancy" with "Dr. Michelle Jones, Gynecologist".
- Save all changes and close Rule Designer.
- Connect the True and False paths to the MedicalIssue Truth Table. Connect the Truth Table to the End step. Select the End step and click Result from Pick From Current Data. Click Save and close the Rule.
- Click Edit Input Mappings on the Properties panel.
- Map each field to the appropriate input and click OK.
- Connect a Show Popup to the Done path of the Sub Flow. Click Unknown next to Subject and Select Merge Plain Text. Click Show Editor to open the Merge Text Editor and click the plus sign to add data elements to read as "[UserName] due to the following medical issues: [Medical Issue List]". Click SAVE.
- Click Unknown next to Message and choose Merge Plain Text. Configure the Merge Text to read as "[Result.Last] is who you should contact". Click SAVE.
- Connect the Done path of the Show Popup step to the End step. Click Save to save all changes.
Debug
- On the top action bar, click Debug. Click FULL.
- On the Form, enter "Max" for Name, select Male for Gender, enter "44" as Age, and select Chronic Pain in joints or muscle for Medical issue/symptom. Click SUBMIT. The popup will display the message with the information of who the correct contact is for the user. Clicking on the Sub Flow and Rules will display how the input information was evaluated.
Was this article helpful?