Siebel Business Rules Administration Guide > Implementing Rules in Siebel Workflows > Scenario for Using Rules in a Siebel Workflow to Do Batch Processing >

Testing the Rule Module in HaleyAuthority


This topic is a task in the development process that is listed in Scenario for Using Rules in a Siebel Workflow to Do Batch Processing.

You can use the test harness in HaleyAuthority to test your rules in a simulation environment before deploying the rule module.

For instruction on using the test harness, see Using the HaleyAuthority Test Harness.

Testing your rules in HaleyAuthority includes the following tasks:

  • Create a test case.
  • Create example instances of the entities that the rule module processes.
  • Run the test case.
  • Examine the test results.
  • Modify the data and rerun the test case. (optional)

To create a test case

  1. In HaleyAuthority, choose View > Tabs > Tests & Cases.

    The Tests & Cases window displays.

  2. Right click the Test Cases folder and choose Add a test case.
  3. In the Edit Test Case dialog box, enter a name for the test case in the Description field; for example, Opportunity Rules, then click OK.

Create the instances that serve as simulated data on which the rules act.

To create example instances for the test case

  1. Choose View > Tabs > Concepts.

    The Concepts window displays.

  2. Locate and right click the opportunity entity, then choose Add > an instance or example.
  3. In the instance dialog box, make the following entries, then click OK:
    • A label for the instance; for example, example_opportunity.
    • Click the This is an example for testing purposes only checkbox.

      The Instances folder under opportunity now contains the example_opportunity instance.

  4. Right click the example_opportunity instance and choose Test cases, click the Opportunity Rules checkbox, then click OK.

    NOTE:  Alternatively, you can add all example instances to a test case by right clicking the test case in the Tests & Cases window and choosing Examples.

  5. Right click on example_opportunity and choose Properties, then click the Facts tab.
  6. Click the New icon and select example_opportunity has a quality. For the quality value, enter 1-Excellent, then click OK.
  7. Repeat Step 6 to add the following fact to the example_opportunity instance:

    example_opportunity has a primary revenue win probability

    Enter 69 as the value of the primary revenue win probability.

  8. Repeat Step 2 through Step 7 to create an instance of opportunity no link, named example_opptynolink, with the following fact, but do not yet add example_opptynolink to the Opportunity Rules test case.

    example_opptynolink has a quality, with 2-Very High as the value for quality

    example_opptynolink has a primary revenue win probability, with 48 as the value of the primary revenue win probability.

This example is intended to act on one opportunity or opportunity no link record at a time, so associate only one instance at a time with the Opportunity Rules test case.

To run the test case

  1. Choose View > Tabs > Tests & Cases.

    The Tests & Cases window displays.

  2. Locate and right click the Opportunity Rules test case and choose Test case.
  3. In the HaleyAuthority Enterprise dialog box, click Yes to deploy (or redeploy) your logic.
  4. In the Deploy Configuration dialog box, make the following entries, then click OK.
    • Accept the default of the Deploy checkboxes being checked for all modules.
    • Enter or browse to choose a directory for the deployed module; for example, D:\temp.

      NOTE:  This directory has no persisting value, and does not affect the eventual runtime database to which the module is deployed.

      The test case runs and processes the example_opportunity instance.

The test case provides the following output:

  • The Output window provides a log of the statements that were executed.
  • An entry of the form Opportunity Rules on <date and time> is added to the Test Results folder under Opportunity Rules. Expand this folder to see the statements that were executed:

    1 if: the quality of the opportunity is "1-Excellent" and the primary revenue win probability of the opportunity is less than 70

    1 set "Description" of an opportunity to "Reconcile lead quality and probability %."

You can disassociate example_opportunity and associate example_opptynolink with the Opportunity Rules test case to test another aspect of the rule module. You can create other instances to test other aspects.

Siebel Business Rules Administration Guide Copyright © 2007, Oracle. All rights reserved.