Set run conditions for flows and business process tests

The following steps describe how to set run conditions for your flows and business process tests.

Note: This task is part of a higher-level task. For details, see Create business process tests and flows.

Run conditions overview

A run condition checks the current value of parameters before running a:

  • Component in a flow

  • Component in a business process test

  • Flow in a business process test

Based on the parameter value and the run condition definition, ALM determines whether to:

  • Run the component or flow

  • Skip to the next component or flow

  • Skip to a subsequent component, flow, or group that you choose

  • Set the component \ flow status to Failed and skip to the next component

When you run business process tests containing run conditions (either directly or indirectly through a flow), the test run results display the results of run conditions in the test, and lists the entities that did not run because a run condition was not met. If a run condition is not met, the test results also provide details about why the entity run failed or did not run.

Tip: As with regular business process tests, you can view test results in the Actual section of the Last Run Report tab in the Test Lab module.

Note: If you set run conditions, and later add or remove an entity or change the order within a flow or a test, the parameters may no longer be relevant and the run condition may not work. For example, if Component B uses an output parameter value from Component A, and you change the order of the components so that Component B precedes Component A, then Component B cannot receive the output parameter value from Component A and the invalid run condition is ignored.

Back to top

Set run conditions

You can use run conditions to insert condition statements into your flows and business process tests.

To set run conditions:

  1. Prerequisites:

    Verify that one of the following is true to use run conditions:

    • A component step uses at least one flow parameter or component parameter

    • There is at least one output parameter in a component that is located before the current component or flow

    • Input test parameters are defined

  2. Add run conditions.

    1. In the Test Plan module, select a flow or a business process test. Select the Test Script tab. Select the component or flow for which you want to add the run condition and click Add/Edit Run Condition.

    2. In the Run Conditions dialog box, specify the criteria for the component or flow to run and click OK.

      UI Elements Description
      Run If

      Lists the parameter types defined in that entity. The following types are available:

      • Input parameter. Available for components and flows, only if one or more input parameters are defined for this entity.

      • Output parameter. Available for components and flows, only if one or more output parameters are defined for one or more of the previous entities.

      • Flow parameter. Available for components, only if one or more flow input parameters is defined.

      • Test parameter. Available for components and flows, only if one or more test parameters is defined.

      When creating a run condition on a parameter that contains a dynamic date value, define the run condition as a static date (for example, 12/10/2011), which is compared to the actual date used in the run.

      <parameter name>

      Lists the available parameter.

      Encrypted parameters are not listed.

      Parameters with encrypted values cannot be chosen from the list when defining run conditions. It is recommended that you do not use parameters whose default values are encrypted when defining run conditions.

      Is

      Lists the operators that need to be met for the component to run. The following conditions are available:

      • equal to

      • not equal to

      • less than

      • less than or equal

      • greater than

      • greater than or equal

      • contains
      • regular expression

      <value>

      Enables you to enter the valid value for the condition.

      Else

      Specifies what to do if the condition is not met. The following options are available:

      • Skip to the next component and continue. If the condition is not met, the entity for which the run condition is set does not run, and the test/flow run continues with the next entity.

        • When running with the Manual Runner, the test results list the run status for the component / flow with the run condition as Ignored.

        • When running with the Automatic Runner, the test results list the run status for the component / flow with the run condition as Not Run.

      • End component / flow run and fail. If the condition is not met, the entity for which the run condition is set does not run, and the test/flow run continues with the next entity.

        The status of the run as Failed.

        Because the status of the run is set as Failed, the execution of the flow or test might be stopped, depending on the Failure condition set for the entity. For details, see Set failure conditions for components and flows..

      • Go to... If the condition is not met, the entity for which the run condition is set does not run, and the test / flow run continues with the entity you choose.

        You can "go to" subsequent components, flows, and groups.

        The entity you choose must appear after the current entity in the test; For example, you cannot go to a component that already ran.

        To change the entity to go to, click Change. Change appears only after you have already selected a "go to" entity before.

        The status of the test run is not affected.

        • When running with the Manual Runner, the test results list the run status for the component / flow with the run condition as Not Run.

        • When running with the Automatic Runner, the test results list the run status for the component / flow with the run condition as Not Run.

      Note: If a run condition is not valid, the run condition link is displayed in red. This can happen, for example, if a reference parameter was deleted, a parameter value was encrypted, and so on. Delete the run condition and define a new one.

      Tip: Your selection in the Else box applies only if the run condition is not met. To specify whether to continue or end the entire run if a component run fails, set the failure condition for the component. You do this in the Test Script tab of the Test Plan module. For user interface details, see Test Plan module menu and buttons for Business Process Testing.

      Summary

      Displays a text description of the run condition you have defined for the component or flow.

  3. Test run conditions.

    Run the test set/test/flow and verify that the components and flows ran according to the defined run conditions.

    For task details on running tests and flows manually and automatically, see Run business process tests and flows.

    Note: If a run condition is not valid, the run condition link is displayed in red. This can happen, for example, if a reference parameter was deleted, a parameter value was encrypted, and so on. Delete the run condition and define a new one.

Back to top

Use case scenario

This use-case scenario describes how you can create run conditions.

  1. Background

    Suppose you work for a bank. Create a flow called ProcessLoans, which contains all the transactions necessary for the business process of creating and approving loans: CreateLoan, SearchLoan, and ApproveLoan.

    In the ProcessLoans flow, depending on the loan being processed, some screens may or may not open. For example, if the requested amount of the loan is above a certain amount, such as $500,000, an additional screen opens for approval from a higher-level bank manager. When requesting a loan for less than $500,000, the extra approval screen does not open.

  2. Add run condition

    1. In the CreateLoan component that enters the loan amount, promote the parameter containing the amount, Amount, to test parameter.
    2. Create a run condition for the CreateLoan component that checks the status of the parameter. If the Amount value is greater than $500,000, the flow runs the component for the extra approval screen. Otherwise, it skips to the next component and continues.

  3. Test run condition

    When running the test, assign the parameter, Amount, values above and below $500,000, and check that the relevant screens open.

Back to top