Rules

A rule is a VBScript expression that evaluates to TRUE or FALSE. Rules are used within a Decision shape or a While shape to control the process flow. A Decision can have many rules. A While, on the other hand, can have exactly one. To add or edit a rule, double-click on the rule or the shape in the designer.

A rule belongs to an XLANG drawing and not to the shape that uses it. In other words, you could define a rule and reuse it in multiple shapes on the same drawing (that is, on any page other than the Data page). If you update a rule in any shape, all instances of the rule also are updated.

Rules can be named and a description associated with them. The VBScript expressions used within a rule can include the Date and Time functions, along with constant values you define in the Constants message and other system fields.

Figure 9.4 shows the Rule properties dialog.

Figure 9.4. The Rule properties dialog.


Figure 9.4 shows the default dialog displayed for configuring a rule. You can define a meaningful name for the rule and a short description of what it is intended for. The VBScript expression associated with the rule is constructed in the lower box. The expression assistant box lets you select specific fields from messages and insert them in the VBScript expression. (Unfortunately, the rule description and the expression do not show up as annotations in the drawing or in printouts.)

The following are examples of what sorts of VBScript expressions are allowed.

Msg1.Fld1 > 23 and Msg2.fld1 < 33 
Message1.[__Exists__]

The rules need not be defined until you are ready to compile the schedule. During compilation, basic syntactical checks are conducted on the rule expression, but unfortunately these do not catch misspelled field names.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset