Search
/
|
|
|

Configuring Rules

EfficiencySpring ships with a rules framework that runs on every Data Manager section's Add, Edit, and View pages. This framework allows you to setup rules that can evaluate multiple conditions and then apply results to the displayed page. Multiple rules can be configured per section, with the Execute Order field used to specify the order in which the rules are run. A rule with a later Execute Order can update or undo actions taken by a prior rule.

Setting Conditions

Each rule can contain multiple Conditions. For the rule's Results to execute, each Condition must be true. There are two categories of Condition Types, those that evaluate values and those that check user group assignments.

Below are the Condition Types you can select from:

Value Equals The value being evaluated must match the one specified in Condition Value textbox.
Value Not Equals The value being evaluated must not equal the one specified in the Condition Value textbox.
Value Inside Range The value being evaluated must be equal to either the Start Value textbox or End Value textbox, or be between those two values. This condition type operates only with numeric and date values.
Value Greater Than or Equal To The value being evaluated must be greater than or equal to the value specified in the Condition Value value. This condition type operates only with numeric values or date values.
Value Less Than or Equal To The value being evaluated must be less than or equal to the value specified in the Condition Value textbox. This condition type operates only with numeric values or date values.
Value In List The value being evaluated must be contained within the value list specified in the Condition Value textbox; each value in that list must be separated by a semicolon.
Value Not In List The value being evaluated must not be contained within the value list specified in the Condition Value textbox; each value in that list must be separated by a semicolon.
Value Has Changed The value being evaluated has changed from the value previously stored in the database (or changed from a blank value,  if the rules are being run on an "add" page).
Value Has Not Changed The value being evaluated has not changed from the value previously stored in the database (or has not changed from a blank value,  if the rules are being run on an "add" page).
User In Group This condition evaluates whether the current user belongs to the specified user group.
User Not In Group This condition evaluates whether the current user does not belong to the specified user group.



The value being evaluated can either come from a Test Structure Element, a Test Form Element, a Test Session Variable, or a Test Formula.

  • The Test Structure Element, if specified, will provide the value to evaluate. It must belong to the same section that contains the rule. Whenever a user modifies the Test Structure Element on the web page, the rules framework will execute.
     
  • The Test Form Element, if specified, will provide the value to evaluate from the stated form element name. This feature is useful if a rule belonging to a child section needs to check against a value contained in a parent section's record.
     
  • The Test Session Variable, if specified, will provide the value to evaluate from the stated session variable name.
     
  • The Test Formula, if specified, will calculate a value to evaluate using a stated formula, such as: (##price## * ##quantity## * ##form:taxrate##) + 3.5
    • Formulas can use parentheses to denote order of operation
       
    • Placeholders can be used to denote structure element names, such as ##price## in the above example. A placeholder that begins with form: will plug in a value from the submitted form directly. A placeholder that begins with session: will plug in a value from the stated session variable directly. The placeholder ##record:record_id## is available to plug in the current key field value of the record.
       
    • The mathematical operators supported in formulas are: + - * / ^
       
    • If a formula begins with the word "SELECT", then the formula will be evaluated as a SQL statement against the database the section points to.
       

Setting Results

If all of the conditions are true, then several results can be triggered. Many Result Types involve adjusting displayed structure elements. There are also Result Types that can trigger custom JavaScripts and business processes. Below are the available Result Types you can use.

Hidden The structure element specified in the Result Element field will be hidden.
Visible The structure element specified in the Result Element dropdown box field will be visible.
Required The structure element specified in the Result Element dropdown box will be required. This Result Type applies to structure elements of type 'Data' or type 'SubSection'.
Not Required The structure element specified in the Result Element dropdown box will not be required. This Result Type applies to structure elements of type 'Data' or type 'SubSection'.
Recommended The structure element specified in the Result Element dropdown box will be marked as recommended. This rule applies to structure elements of type 'Data'.
Not Recommended The structure element specified in the Result Elementdropdown box will not be marked as recommended. This Result Type applies to structure elements of type 'Data'.
Filter Select Element The lookup list of the structure element specified in the Result Element dropdown box will be filtered. The Lookup Table Filter Field Name textbox is used to specify the database field in the structure element's lookup table that will be set to a filtering value. The filtering values can come from a specified structure element, an explicit value, or a form element.
Unfilter Select Element The lookup list of the structure element specified in the Result Element dropdown box will be unfiltered. This Result Type is utilized to cancel out lookup list filtering that might have been carried out by another rule.
New Value The structure element specified in the Result Element dropdown box will be set to a new value. This Result Type applies to structure elements of type 'Data'. It will either use a specified value or a specified formula that will compute a value.
Popup Message The text in the Result Value will be displayed as a JavaScript message. It is recommended that any rule utilizing this Result type also contain another result that insures the same popup message is not re-displayed.
Trigger Process Triggers a Process Manager process, and attach it to the currently displayed Data Manager record.
Execute JavaScript The JavaScript specified in the JavaScript textarea will be executed.
Run Excel Calculation Workbook Loads an Excel Workbook with input and output values specified in the first tab. Input values are loaded in from the structure elements, formula calculations are conducted, and then output values are extracted from the first tab into the record's receiving structure elements.
Send Email

Sends a HTML formatted email. Just like formulas, ##fieldname## placeholders can be utilized for the Email From, Email To, Email To - CC, Email To - BCC, Email Subject, and Email Body settings.

Also, if the entered text beings with "SELECT " for the Email FromEmail ToEmail To - CC, or Email To - BCC settings, a query will be run against the section's database to retrieve a list of values, delimited by ";"

Reassign Record Ownership to User The user who owns the displayed record will be assigned, based on the user's numeric ID from the users table. The User ID will be determined either by a specified value or by a specified formula that will compute the value.
Reassign Record Ownership to Group The group who owns the displayed record will be assigned, based on the group's numeric ID from the groups table. The Group ID will be determined either by a specified value or by a specified formula that will compute the value.


Configured rules are stored in the Section_Rule, Section_Rule_Condition, and Section_Rule_Result database tables.


Printable Version