The rules manager is the location where you can create rules that will be available for use throughout your company. Rules can be used in rules applied, flags, etc. Rules in LoanPro are written in Clojure. This is primarily to make it possible for the LoanPro system to evaluate a large number of rules in a short amount of time. Here is an overview of how rules work.
The rules manager is located in Settings > Company > Rules Manager inside the LoanPro system.
To create a new rule, click Add.
The Add Rule page looks complicated, but lets take a look at the three major parts and hopefully it won’t be so intimidating.
The top section is where you can enter basic information about the rule. You have the following options:
- Name – This is the name of the rule. Assign a name that will distinguish this rule from others you have created or might create. Try to give some sense of what the rule does in the name.
- Output format – The rule won’t necessarily output a value, but if it does, this field lets you choose what type of value it will output, either number, date, or currency.
- Round result – If this rule will output a value, you can choose to have LoanPro round the result. You can choose to have the result rounded to between 1 and 6 decimal places. You can also have the result rounded to a whole number or not rounded at all.
- Category – Here you can select either True/False Output or Value Output. This is meant to specify whether the rule you are creating should evaluate to a specific value or simply to either true or false.
First, you’ll see Load Existing Rule. This button lets you load a rule that already exists in your company’s library of rules. You can use existing rules to build new rules. If you choose to load an existing rule, you should note the message “If your rule includes the characters ‘%1’, it is intended as a placeholder. You should replace these characters with a numeric value (either static or dynamic).”
There is only one field in this section, but this is the field where the actual rule will be entered. You can manually enter the rule, load an existing rule and make changes or additions, add system variables, or use the shortcut buttons below the field. These buttons include: +, -, *, / operators, a logical AND and OR, parentheses, and equality operators and values. Some of the equality operators and values may not be familiar.
- == – This compares two values to see if they are equal.
- != – This means not equal.
- T = This means true.
- NIL – This means no value. This is different than 0 which is a numerical value.
The bottom section lets you search through and select system variables.
On the left all the variables are arranged in a tree structure. Click to the left of any section to expand that section. Click to the left of any variable to view the data for that variable. Use the “Search by keyword” field to filter the list of variables by a keyword or key phrase.
Once a rule is entered, you can validate it by clicking Validate this rule. This will make sure that the rule you entered uses valid Clojure syntax.
In the Info pane on the right, you can view the information about any variable. If you click they hyperlinks in this pane, the variable will be inserted into your formula. Here is some additional information about rule variables.