Back Forward How to test a flow rule with the Run Rule feature

About Flow rules

The Run Rule feature enables you to test a flow rule individually before testing it in the context of the entire application you are developing. You specify a test page for the rule to use, provide sample data as the input, run the rule, and examine the results. Additionally, if Automated Testing is enabled, you can save the test data and its results as a test case rule.

The Run Rule feature is available only for starting flows — that is, flows that have the Creates a new work object option selected on their Process tabs. So to test subflows and screen flows, you run the main flow that calls them.

For general information about the Run Rule feature, including a list of the clipboard pages that are generated when a rule runs, see How to test a rule with the Run Rule feature.

Run the rule

To run the flow, complete the following steps:

  1. Save the rule.
  2. If desired, select Edit > Preferences to review and update if desired the Run Process In settings in the General group of preferences. These determine the portal rule, skin rule, and window type of the flow execution. See Developer Portal — Setting preferences.
  3. Click the Run button Run.
  4. In the Test Page section, specify which page to use as the main page. Do one of the following:
    • Select Create or Reset Test page. Then, in the Apply field, select the model to use for the test page.
    • If Automated Testing is enabled, select Run Against a saved test case. Then choose an individual test case, or all test cases from the drop-down list.
      • When an individual test case is chosen, a short description of the test case is displayed along with who created it and the date it was created on.
      • For each individual test case, select Show Saved Results to display a list of all previously saved results for that test case.
      • If Automated Testing is enabled, you can click  Save as Test Case   to create a test case rule that holds the test data and the results. For information about running test cases, see Pega Developer Network articlePDNPRKB-25103 How to execute flow rule test cases.
    • If Automated Testing is enabled, select Jump to Flow Marker. Then choose a flow marker from the drop-down list. For more information, see Pega Developer Network article PDNPRKB-25104 How to create and use a flow marker.
      • You can click Save Flow Marker to save a flow marker that allows you to jump directly to a specific point in the flow rule without having to input the same information to reach that point.
  5. Click  Reset Page & Run Flow . The system either creates a new test page or copies one, and then starts a flow rule execution, allowing you to create a work object. The type of window, the portal, and the skin rule (styles and appearance) of the work object form depend on the Run Process In preferences you set in step 2 above.
  6. In the test section of the Run Rule window, step through each decision or assignment, providing representative input in each step. Click  Create Page and Run Rule  to progress to the next form.
  7. Run through the rule as many times as necessary, testing each possible path. Use the gold Where-Am-I? arrow Where am I?to see where an assignment is located in the flow rule diagram.

Repeat as necessary using different model rules, or alter the clipboard contents and perform the test again.

zzz About Flow rules