Skip to main content

Introduction to the Rule Editor

This chapter introduces the Rule Editor in the Management Portal. It is divided into the following sections:

Business Rule List

The Business Rule List page displays a list of the business rule classes defined in the active Ensemble namespace. Navigate to this page from the Business Rules item of the Ensemble List menu.

Select a rule class to be the target of one of the following commands in the ribbon bar:

  • Edit — Click to change or view the rule definition using the Business Rule Editor.

  • Delete — Click to permanently delete the rule definition class.

  • Export — Click to export the selected rule class as an XML file.

  • Import — Click to import an XML file into a rule class.

You can also export and import rule classes as you do any other class in Ensemble. You can use the Globals page of the Management Portal (System Explorer > Globals) or use the Export and Import commands on the Tools menu in Studio.

Business Rule Editor

The Ensemble Rule Editor page is where you create and edit business rule class definitions for all types of business rule. The page opens with the last rule you had open in the namespace. The tab at the left of the title bar contains the name of the business rule definition class. If this is the first time on the page for this namespace, the working pane is empty and you must either create a new rule or open an existing one.

The “Creating and Editing Rule Sets” chapter describes the details of how to use the editor to define business and routing rules; the rest of this chapter describes how the user interface works with the Ensemble rule structure.

The ribbon bar of the Ensemble Rule Editor page contains the following elements:

  • New button — Click to launch the Business Rule Wizard to create a new business rule definition.

  • Open button — Click to launch the Finder Dialog to choose an existing business rule definition to edit.

  • Save button — Click to save and compile any changes you have made to the rule definition.

  • Save As button — Click if you have been editing a rule definition and wish to save your changes as a new business rule class.

  • Contract — Click to contracts the display of all of the rules in the rule set. You can then individually expand the rule you want to view or edit.

  • Expand — Click to expand the display of all of the rules in the rule set.

  • Open new windows checkbox — If checked, the New and Open commands open the rule editor in a new window or browser tab.

  • Zoom drop-down—Specifies the zoom percentage to view the rule.

General Tab

Once you have a rule definition in the working pane you see tabs of information. The general tab contains the summary information for the rule definition:

Description

Class description of the rule definition and its purpose.

Rule Type / Rule Assist Class

Each rule type has an associated rule assist class which controls the constraints of the rule and provides information in the right pane of the page to guide you when editing rules.

The table shows the four rule types and their associated Ens.Rule.AssistOpens in a new tab class:

Rule Type Rule Assist Class
General Business Rule Ens.Rule.GeneralBusinessRuleAssistOpens in a new tab
HL7 Message Routing Rule EnsLib.HL7.MsgRouter.RuleAssistOpens in a new tab
General Message Routing Rule EnsLib.MsgRouter.RuleAssistOpens in a new tab
Virtual Document Message Routing Rule EnsLib.MsgRouter.VDocRuleAssistOpens in a new tab
Context Class

The class that contains the information to tell the Ensemble Rule Editor which object properties to provide as choices in the Value editor while you are editing a rule. For general rules, it is generated from the business process BPL class and ends in .Context. For routing rules without a BPL process, it is usually the routing engine business process class.

Rule Alias

This field may have a value if a rule was created in older releases before Ensemble stored rule definitions as classes. When the rule is upgraded, if the old name does not conform to class naming conventions, it becomes the alias. You can use this field for continuing such naming conventions, but if you are creating a new rule you do not need to use this field.

Temporary Variables

You can specify temporary variables in this field. You can use these temporary variables in the business rule. Each variable specification is separated by commas. For example:

FreeShippingValue,ShipMethod,PremierMember

Temporary variables are used in a rule by preceding the variable name with an @ (at sign). For example, @FreeShippingValue. Temporary variables are available only within the rule. If you want to pass information to the transformation using the rule, use the RuleUserData property. See “Selecting the Transformation and Target of a Send Action” for details.

Production Name

(Only for routing rules) This optional, informational setting makes it easier for you to define rules because the rule editor uses this setting to select configuration items to display when you are defining rules. The production configuration actually specifies that a rule is used for a production.

Rule Set List

List of Rule Sets with the following information:

  • Rule Set Name —Name to identify the particular set.

  • Beginning Date and Time — The time from which the rule becomes active. The exact time is included in the active interval. The format is YYYY-MM-DDTHH:MM:SS. The time portion is optional and defaults to 00:00:00.

  • Ending Date and Time — The time when the rule stops being active. The exact time is excluded from the active interval. The format is YYYY-MM-DDTHH:MM:SS. The time portion is optional and defaults to 24:00:00

Rule Set Tabs

Each rule set has its own tab for editing its list of rules. For details, see the “Creating and Editing Rule Sets” chapter.

Editor Icons

Both tabs contain following set of icons. The following icons are available to edit the rule definition, rule sets, rules, and clauses within a rule set:

generated description: rule up enabled generated description: rule down enabled generated description: rule add enabled generated description: rule delete enabled generated description: rule undo enabled generated description: rule redo enabled generated description: rule function enabled

The specific action may differ depending on the entity you are editing; the following table describes the action of each icon in general.

Icon Action
generated description: rule up enabled
Click the Up icon to move the selected item up in the list.
generated description: rule down enabled
Click the Down icon to move the selected item down in the list.
generated description: rule add enabled
Click the Add icon to add the type of item you choose from the list or beneath the icon in the Rule Assistant.
generated description: rule delete enabled
Click the Delete icon to delete the item next to it.
generated description: rule undo enabled
Click the Undo icon to undo the last change.
generated description: rule redo enabled
Click the Redo icon to redo the last change that was undone.
generated description: rule function enabled
Click the Function icon to open the associated editor for the selected action.

If an action is not available, its icon appears dimmed.

Rule Assistant

You can hide or show the Rule Assistant using the double-arrow in the right pane of the Ensemble Rule Editor. When you are editing a rule set, the expanded Rule Assistant pane provides you with help throughout the editing process. It describes the item you have selected and provides a list of options based on your assist class.

Business Rule Wizard

This wizard helps you create a new business rule definition based on the Ens.Rule.DefinitionOpens in a new tab class with an XData block named RuleDefinition. Enter values for the following fields:

Package

Enter a package name or use the arrow to select an existing package name.

Name

Enter the name of the business rule class.

Alias

(Optional) Enter the alias name for this rule. Do not use any of the following characters:

; , : | ! * - $ ‘ “ < > &

Generally, this exists for some rules created in older releases before Ensemble stored rule definitions as classes and for continuing such naming conventions. If you are creating a new rule you do not need to use this field.

Description

(Optional) Enter a description for this rule definition. This becomes the class description.

Type

Enter one of four rule types:

  • General Business Rule

  • HL7 Message Routing Rule

  • General Message Routing Rule

  • Virtual Document Message Routing Rule

Each rule type has an associated rule assist class which provides information in the right pane of the page to guide you in entering rules and controls which options the editor presents.

Context Class

(Optional)

This field tells the Ensemble Rule Editor which object properties to provide as choices in the Value field when you are editing a rule. For general rules, this class is generated from the BPL business process class that invokes the <rule>. The naming convention of the class is the business process class name plus the .Context extension, as in Demo.ZenService.Bproc.WeatherReport.ContextOpens in a new tab.

FeedbackOpens in a new tab