/
Business Rules

Business Rules


Return to Security

Article Index


The Business Rules screen assists businesses to achieve their goals by giving more control over business behaviour.

image-20240903-013935.png

Procedures

Creating A Business Rule

  1. From the Groups list, select the required group. The Fields list will be updated.

  2. From the Fields list, select the required field. The Rules list will be updated.

  3. Select the Rules list. A shadow will appear around the list to indicate it is selected.

  4. Click New. The Business Rule dialog will be displayed.

  5. Enter the details.

  6. Click OK. The dialog will close and a new business rule will be created.

A business rule clause in Framework ECM consists of an operand + a comparator + an operand. For example, the modified Initial Deposit Date must occur after the Sale Reported Date.

 

To be complete, a business rule must also have a reversal. For example, the modified Sale Reported Date must occur before the Initial Deposit Date.

Disabling Individual Rules

For situations where business rules that are shipped with Framework ECM are not required to be enforced, they can be easily switched off by modifying the Enabled? field on the Business Rules dialog.

Customising A Standard Rule And Description

The default business rules that are shipped with Framework ECM are generic rules based on the major work flow stages. A current rule string or description may be customised for individual needs should the defaults not be applicable.

The customisation functionality has been included to enable users to change the terminology of these fields to suit.

  1. From the Groups list, select the required group. The Fields list will be updated.

  2. From the Fields list, select the required field. The Rules list will be updated.

  3. From the Rules list, select the required business rule.

  4. Click Edit. The Business Rule dialog will be displayed.

  5. Enter the Custom Rule? status as Yes. The Rule String field will be editable.

  6. Modify the rule string, as required.

  7. Modify the Description field, if required.

  8. Click OK. The dialog will close and the business rule will be modified.

Business Rules - String Syntax

Incorrect use of business rules in Framework ECM may cause errors and/or unpredictable behaviour. If unsure how to implement business rule changes, please contact your Framework Solution Provider.

Any field in the Framework ECM database may have none (0) or more rules associated with it. For a new value to be accepted by that field, all rules of this field must evaluate to true.

Business rules are unique to RMS fields and region divisions, allowing separate divisions of an organisation to specify their own local rules. Business rules may be switched on/off at the rule level, division level, and global level.

All rules are stored in the database as text strings representing the conditions that, as a whole, must logically evaluate to true for the rule to be valid.

A rule is either empty or a combination of clauses and logical operators (non-empty).

Empty Rule

The empty rule (no rule) is an empty string:

  • “”

Non-Empty Rule

A non-empty rule is either a single clause, or any number of sub-strings, containing 2 clauses and an operator, separated by any amount of white space and enclosed in round brackets “( )”

  • Rule with one (1) clause: “[X <= Y]”

  • Rule with one (1) operator: “([x <= Y] AND [Y <= Z])”

  • Rule with two (2) operators: “([x <= Y] AND ([A = B] OR [Y <= Z]))”

Operators

An operator is any of the following:

  • AND

  • OR

  • NAND

  • NOR

  • XOR

  • XNOR

Clause

A clause features two (2) operands separated by a comparator, enclosed in square brackets.

  • [X <= Y]

Where there is any amount of white space between the comparator and operands.

Comparator

A comparator is any of the following:

  • <

  • >

  • <=

  • >=

  • =

  • !=

Operand

An operand is either a database field’s context id (rmsFieldCtxPKID), or a literal value preceded by a single quote character ().

  • 49882 - field context ID (long)

  • ‘2/4/99 - literal value (date)

  • ‘$4,500 - literal value (currency)

  • ‘Hooper - literal value (string)

  • ‘1:00 PM- literal value (time)

Creating Clauses

If the value of the left operand is null (missing, empty, “”, white space, unknown, undefined), the clause is False.

If the value of the right operand is null (missing, empty, “”, white space, unknown, undefined), the clause is True.

A clause may also be a null test of a single field, using the following syntax:

  • [isNull<1234>] - Clause is true when the field 1234 is null

  • [notNull<1234>] - Clause is true when the field 1234 is not null

In addition to the above, a clause operand may include a mathematical manipulation of the field’s value.

Comparison

Users may wish to specify that one field be compared to 5% of another field, or one field be compared to another field minus 2 weeks. This is achieved by prefixing the field’s context ID with the operation and its parameter, followed by the operation again, as follows:

  • [86 > %5.5%91] - Field 86 must be greater than 5.5% of field 91

  • [86 > *10*91] - Field 86 must be greater than 10 times field 91

  • [86 > -2-91] - Field 86 must be greater than field 91 minus 2

  • [86 = +12+91] - Field 86 must equal field 91 plus 12

  • [86 != /4.0/91] - Field 86 must not equal field 91 divided by 4

Using the third example above, if field 91 is a date, field 86 must be greater than field 91 minus 2 days.

Summary

A clause operand may also be the sum of two (2) or more field values. This is achieved by the use of the s character, and the list of comma separated fields to be summed enclosed in curly brackets:

  • [86 < s{20, 30, 40}] - Field 86 must be less than the sum of fields 20,30, and 40

Framework Examples

Rule for Administration Complete:

  • ([86 <= 91] AND [64 < 91])

    • Building Permit Received Date (86) must be less than or equal to Admin Complete Date (91)

    • AND

    • Ordering Received Date (64) must be less than Admin Complete Date (91)

Rule for Frame Complete:

  • [2123 <= 2135]

    • Base Complete Date (2123) must be less than or equal to Frame Complete (2135)



Business Rules - Rule Control

A rule belonging to a specific field can be found in the rms_ctxBRule table, indexed by the Field Context ID (l_rms_fieldCtx_id) and the Region Context ID (l_context_id) - the region division to which the rule belongs.

  • Individual rules can be switched on and off in the f_customRule field

  • The message displayed to the user when a rule is violated is stored in m_notes

  • The ID of the context the rule belongs to is stored in l_context_id

  • Rule enforcement is enabled for a specific context (e.g.: region division) in the l_rDiv_id field in the rDiv table, and changes at log on/off. Thel_context_id of 0 will apply a rule to all regions/divisions.