Rules

 

As Alarm/Event notifications arrive in AssetWorX, they must first pass through a Rules Engine.

 

The goals of the Rules Engine are:

Each rule has three parts:

Rules Chains and Processing

A Rule Chain is a set of rules. All processing starts in the default chain, selected through the General Settings and Subscriptions properties. Each rule in a chain is processed in the order that it appears in that chain. This flow can then be changed by individual rules. Chains other than the default chain are processed only if a particular rule changes the flow to that chain.

 

To Add a Rule Chain:

  1. Open the Workbench and expand your project then the Assets node, then the Product configuration node, then the Alarms & Events Settings node, shown below. Right-click on the Rules node, then click on Add Rule Chain, as shown below.

Adding a Rule Chain in the Project Explorer in the Workbench

 

-OR-

 

Select the Rules node in the Project Explorer then click on the Add Rule chain button, shown below, in the Edit section of the Home ribbon in the Workbench.

 

Add Rule chain Button

  1. This opens the Rule chain properties, shown below, in the Project Details section of the Workbench. Enter a name in the Rule chain Name text entry field.

Rule Chain Properties

Rules

Rule Chain Properties with Added Rule

Condition

Rules can be executed conditionally based on an expression, which has to evaluate to either True or Fales. Variables are accessible through the expression. In event fields (e.g., {{BaseEventType.Message}}), the syntax is similar to what is used in AlarmWorX64 Viewer or AlertWorX. Relative References (e.g., {{@@self.Description}}) can be used only after the event has been successfully assigned to an Equipment or Property.

Action

Action type - Set field value

      • Value destination field - Enter the value destination field in the text entry field or click on the button to open the Data Browser and navigate to your selected value destination field.

      • Value expression - Enter the value expression in the text entry field or click on the button to open the Expressions Editor and build your preferred expression.

Action type - Set field to command

      • Command field - Enter the command field in the text entry field or click on the button to open the Data Browser and navigate to your selected command field.

      • Command - Enter the command in the text entry field or click on the button to open the Configure Command window, shown below, and select/configure your preferred command.

Configure Command Window

Action type - Assign to equipment or property

      • Assign type - Use the pulldown menu to select either:

        • By path - This is usable if an event field contains the asset information in a string form. For example "Company#Foxboro bakery#South". The character used to split levels is configurable.

        • By property realtime data tag - This setting involves finding an Equipment Property by its real time data tag. If multiple properties match, this assignment will fail.

      • Path separator - If By path is selected, this field allows you to select the character to be used to split levels.

      • Value expression - Enter the value expression in the text entry field or click on the to open the Expression Editor and build your preferred expression.

Continue with

Depending on how a set rule is executed, one of three continuation paths is chosen. These include:

'Continue with' Section of the Rule Chain Properties

Option Definitions:

  1. Once you have completed your settings, click Apply to save them and Close to return to the Workbench. Your newly created Rule Chain will now appear in the Project Explorer beneath the Rules node.

Values Usable Inside the Rules

Regular Event Fields (e.g., BaseEventType.Message)

Special Event Fields

Relative References

Syntax for Values Usable Inside the Rules

Places, which use the expression engine to evaluate the value, use double curly braces.

Example: {{BaseEventType.Message}} and {{@@self/.Description}}

 

Commands use the Relative References syntax.

Example: @@self/, which gets replaced by the path to the current Equipment

 

Or enclosed in << and >> to get the value.

Example: <<@@self/.Description>>

 

If a command field uses the Expression Engine syntax (starting with x=), the expression is not evaluated by the AssetWorX server side, and is sent to the client side, with just the Relative References (@@ and <<>>) resolved. The Alarm Viewer currently cannot evaluate the expression.

 

See Also:

Product Configuration