Building and Testing Rules
This section discusses how to:
Build Rules.
Test Rules.
Create a new version of a Rule.
View the Page Process Flow.
View Rule Cross-references.
Page Name |
Definition Name |
Navigation |
Usage |
---|---|---|---|
Rule Builder |
SCC_RULE_BUILDER |
, select Search for a Rule, Define Rule, select an Action of Build Rule. |
Select Rules to build. |
Build Rules |
SCC_RULE_REBUILD |
|
Search for Rules to build. |
Rules Engine Tester |
SCC_RULE_REBUILD |
, select Search for a Rule, Define Rule, select an Action of Test Rule. |
Test a Rule. |
Rules Engine Manager Version History |
SCC_RULE_VERSION |
, select Search for a Rule, Version History tab. |
View and manage Version History for a Rule. |
Rules Engine Manager Cross Reference |
SCC_RULE_XREF |
, select Search for a Rule, Cross Reference tab. |
View the other Rules where this Rule is used. |
Rules Engine Tester |
SCC_RULE_REBUILD |
, select Search for a Rule, Define Rule, select an Action of Test Rule. |
Test a Rule. |
Before a Rule can be tested or used, the code in the Rule needs be converted to executable code. This is done by the Rules Engine Build code compilation process. This process can be initiated:
From an individual Rule using the Rule Action Build on the Define Rule page.
In batch using the Build Rules process, where you can build multiple Rules simultaneously.
Building a Rule from the Define Rule Page
Access the Define Rule page (
, select Search for a Rule, Define Rule).Select the Update Status Information Action to display the current Rule Build Status.
Then, select the Build Action to open the Rule Builder page, select the Rule, and click the Build button to compile the Rule:
Image: Rule Builder Page
This example illustrates the fields and controls on the Rule Builder Page. You can find definitions for the fields and controls later on this page.
If the Rule Build Status is updated to Build Successful, you may proceed to testing the Rule. Otherwise, consult your Rule for Current Logic. A flaw in Rule Logic may be the issue.
Building Multiple Rules at the Same Time
Access the Build Rules page (
).Image: Build Rules page
This example illustrates the fields and controls on the Build Rules page. You can find definitions for the fields and controls later on this page.
Select any search parameter fields you want to use to search for Rules you want to build and click the Search button. If you click the Search button without making any parameter selection, all Rules are returned.
Select the Rules you want to build and click the Build button.
After a Rule is built successfully, you can test the Rule.
Access the Define Rule page (
, select Search for a Rule, Define Rule).Select the Test Rule Action to open the Rules Engine Tester page:
Image: Rules Engine Tester page
This example illustrates the fields and controls on the Rules Engine Tester page. You can find definitions for the fields and controls later on this page.
Image: Rules Engine Tester page (Inputs and Outputs)
This example illustrates the fields and controls on the Rules Engine Tester page (Inputs and Outputs). You can find definitions for the fields and controls later on this page.
Image: Example of Rules Engine Tester List Output
This example illustrates the fields and controls on the Example of Rules Engine Tester List Output. You can find definitions for the fields and controls later on this page.
Enter the required Arguments that are needed to test the Rule. After test parameters have been added the Parameters can be saved as a Rule Test Profile.
Field or Control |
Definition |
---|---|
Test Data Profile |
Select a saved Test Data Profile. |
Delete |
Click this button to delete a stored Test Data Profile. |
Update |
Click this button to update a stored Test Data Profile with new parameters. |
Add a New Test Data Profile and Add |
Enter a name if you want to save a new Test Data Profile and click the Add button. A Test Data Profile can be added after the Rule has been executed using the listed parameters |
Inputs |
Displays all Parameters/Variables which have been listed as Input. Note: The text Click Search for input list appears next to List Input Variables. Click the Search icon to provide input. |
Arguments |
Enter the required Arguments needed to test the Rule. |
Execute Test |
Select this button to execute the Rule. If a Rule needs parameters and none are provided, the Rule cannot be executed. |
Outputs |
Displays all output Parameters/Variables with the output result when the Rule executes successfully. Note: The text Click details for output list appears in the Output grid for List Variables only. Click on the Details icon to view List Variable output on a secondary page. |
Debug Log Information |
Displays debug information is shown if the Logging Level is set on the Define Rule page. The Debug Log Information shows the execution logic of the Rule in order of execution. Refer to the “Starting Query” for information about how the Base Entity is selected and with which criteria the selection is done. If this is a Rule, a Select statement is generated based on the underlying tables associated with the Base Entity attached to the Rule. The Criteria attached to the Rule is used to create the Starting Query's Criteria. Refer to the individual debug statements to view what information was selected per statement. The timestamp option shows the elapsed time. |
Return |
Select this button to return to the Rules Engine Manager page. |
XML Dumps of the Entity, before and after Rule execution, are also displayed:
Image: Example of XML Dump in Rule Tester
This example illustrates the fields and controls on the Example of XML Dump in Rule Tester. You can find definitions for the fields and controls later on this page.
Field or Control |
Definition |
---|---|
XML Dump of the Entity Before Execution |
Displays all data selected for the Base Entity and made available to the Rule. |
XML Dump of the Entity after Execution |
Displays all current data for the Base Entity after the Rule is executed. This information is relevant in instances where the Rule is used to update or insert data in the database. |
Active Rules can be referenced by other Rules or by online triggers and/or batch processes. In a production environment, it should not be possible to change anything in an active Rule. Changing an Active Rule can be disruptive to business processes. Therefore, Rule changes should be made by creating a new version of an Active Rule. Only one Active version of a Rule exists for any Rule at any given time. Since Rules are referenced by other systems using the Rule ID, it is always the Active version of the Rule that is executed. Use the Create new Version of Rule Action on the Define Rule page to create a new version of an Active Rule.
After the option Create new version of Rule has been selected the user is shown a warning message:
Image: Example of Create New Rule Warning Message
This example illustrates the fields and controls on the Example of Create New Rule Warning Message. You can find definitions for the fields and controls later on this page.
After clicking OK on the warning message, the Version History page opens:
Image: Version History page
This example illustrates the fields and controls on the Version History page. You can find definitions for the fields and controls later on this page.
Note: You may also access the Version History by navigating to .
Older versions of the Rule are shown as Version History. Any Version Codes and Comments are displayed by Version. You can still ignore the new Rule Version created by cancelling out of the page without saving.
After saving the Rule Version, an Operator ID and Date Time stamp are automatically updated, and the status of the new Version is In Progress. In the example illustrated above, . Version 2 remains Active until Version 3 is activated. When activating Version 3, Version 2 becomes Inactive automatically.
Note: It is not possible to reactivate “old” versions of Rules.
Access Rules Engine Manager Cross Reference page (Set up SACR, System Administration, Rules Engine, Rules Engine Manager, Cross Reference).
Image: Cross Reference page
This example illustrates the fields and controls on the Cross Reference page. You can find definitions for the fields and controls later on this page.
A Rule Cross Reference page is available which shows all Rules which are referencing the current Rule via a call statement. Click the link to navigate directly to the referenced Rule. If there no other Rules reference the current Rule, a message is displayed: “This Rule is not used by another Rule.”