Setting up User Defined Rules

User Defined Rule is an option which is used to add user specified functionality to the module by which a user can define and add his own logical and arithmetic rules.

This can be used by the user to apply validations, comparisons or calculations on different fields.

NOTE: It is basically of two types or can be written in two modes:

  1. Active Governance: Works on the data which is entered in the system after applying the rule.
  2. Passive Governance: Works on the data which is already stored in the system.

User Defined Rule Configuration

To create a new User Defined Rule, please follow the steps mentioned below:

  1. Login with valid credentials.
  2. Click on setting icon on top right corner à Click “Modules
  3. Select a module from the list in which you want to add a dependency.
  4. Click on “Business Rules” tab and select “User Defined Rule
  5. Select Add New Rule.
  6. Fill in the details as stated in below table.
  7. Click “Save” to save the rule.
Field name Details
Rule Type Active Governance: Works on the data which is entered in the system after applying the rule.

Passive Governance: Works on the data which is already stored in the system.

If Active Selected Fields: Select the field on which you want to invoke the rule.
If Passive Selected Description: Enter an appropriate description for the rule.

FOR ACTIVE GOVERNANCE
  1. After the rule is saved, new page will open, Select
  2. Select the JAVASCRIPT event on which the rule will work.
  3. Then Choose
  4. a. JavaScript: Involves proper code writing according to requirement.
  5. b. Template: Rules applied with the help of system
  6. Enter the Plant Code of your organization tenant id.
  • If JAVASCRIPT is selected
  1. Then you have to select the particular rule, Select Configure
  2. Then select Code and write the functionality you want to add.
  • If TEMPLATE is selected
  1. Then you have to select the particular rule, Select Configure
  2. Click code à A new page will open-up.
  • Drag and drop the field from the ‘Fields’ tab on the left to the ‘General Condition’ in the center.
  1. Then select Relational or Arithmetic operator from the operator tab on the left side and Drag and Drop in the ‘General Condition’ in the center then select another Field to set the complete rule.

E.g., (OP)+(OP)

  1. Choose a message type in the bottom.
  2. Enter a custom message you want to show when this rule is invoked.
  • Select Submit Condition to save the operation.

FOR PASSIVE GOVERNANCE
  1. After the rule is saved, new page will open
  2. Fill in the details as stated in below table.
Field name Details
Field Select a field on which you want to apply the rule (Act as first operand)
Operator Type of operation you want to perform.
Comparison Defines type of second value (operand) we want to perform the operation.
Value Based on the value selected In the comparison field, we can select a value here.
=+ Selected when you need to add another logic to the existing one,

With OR or AND condition.

 

  1. Add Block lets you add a entire new rule along with the existing one.
  2. Select Generate to save the rule formed.