By using routing rules, you can change default Ares processes by having the system automatically skip or add steps to the basic Reserves process. Each time the status of an item is changed by the Ares Client, the system runs a query to cycle through any rules that exist in the Routing table and determine if any active routing rules should be applied to that item.
Creating Routing Rules
You can create routing rules in the Ares Customization Manager under System | General | Routing:
- Click New Record.
-
Fill out the following values:
Rule ID
Type in the number you want to have assigned to the routing rule. Each routing rule must have a unique ID.
Configuring Routing Rule Priority
Routing rules in Ares are processed in the order specified by the Rule ID value. When the status of an item changes, Ares will evaluate the rules configured in the Routing table to determine if any routing rules are a match for that item, beginning with the rule that has the lowest Rule ID value. The first rule that matches the item will be used for processing, and any remaining rules in the Routing table will be skipped.
Active
If checked this rule will be active. If unchecked, the rule will be inactive.
Status
Enter the Item Status to which the rule will apply. This value may be any legitimate Ares status, including any Custom Queues.
Match
The query string for the routing rule. This string should only reference
the Courses, Items, and Users database tables. See further explanation below in The Match Value.New Status
Enter the new Item Status to which the item will be routed. This value may be any legitimate Ares status, including any Custom Queues.
Description
Enter text that describes what the rule is intended to do. - Click Save.
General Guidelines for Creating Routing Rules
- Routing rules should be created so that no two routing rules apply to the same transaction at the same time. This means that the Status and Match values, taken together, should be unique for each rule in the table.
- Routing rules should be created so that they are unique to your process tracking. In other words, the same rule should not apply to the same item multiple times during the course of standard processing. Routing rules should be created to be unique to a specific step in your process.
- The routing rule Match value cannot exceed 500 characters.
- Routing rules can only reference the Items, Courses, and Users database tables.
For a complete list of the fields in each database table, see Ares Database Tables.
The Match Value
The Match value in a routing rule is arguably the most important piece of the Routing entry. This value, also known as a match string, sets the conditions that distinguish one routing rule from another. These conditions, coupled with the other conditions specified in a routing rule, determine which items are impacted by the rule and which are not. As stated before, this query string should only reference fields in the Items, Courses, and Users database tables. For the match string value:
- Each Ares field value name in the match string must be preceded by an (i.) for the Items table, a (c.) for the Courses table, or a (u.) for the Users table.
- Only single quotation marks ('), not double quotation marks ("), should be used in the match string.
- Special formatting is required within the match string if performing a mathematical comparison on an Ares field holding a potentially non-numeric value. For additional guidance, see Using Potentially Non-Numeric Ares Field Values in Match String Comparisons.
- There cannot be any extra characters or spaces in the match string.
- If you are using OR clauses in your match string, it's a good practice to surround them with parentheses.
For example:
(i.Location like '%alpha%' or i.Location like '%beta%')
(i.CallNumber like ‘%gamma%’ or i.CallNumber like ‘%omega%')
Using Potentially Non-Numeric Ares Field Values in Match String Comparisons
When creating routing rules, it is important to consider the data type of the Ares field(s) used in match string comparisons. Certain Ares fields are configured in the database to hold both numeric and non-numeric values. If your routing rule match string attempts to use a mathematical operator (e.g., greater than (>), less than (<), etc.) to compare the value in one of these fields to a numeric value, Ares will throw an error when attempting to process the routing rule against any items containing a non-numeric value in the field.
For example, the PubDate field in the Items database table is a nvarchar(30) field, which means that it can store both numeric and non-numeric values up to 30 characters in length. If a routing rule match string is configured to perform a mathematical comparison using the PubDate field (e.g., i.PubDate > 2020), an error will occur when Ares uses the rule to process an item with a non-numeric value (e.g., December 2020) in the field.
Formatting the Match String to Handle Non-Numeric Field Values in Comparisons
To avoid these errors, the match string should be rewritten using the TRY_CAST SQL function to first check that the data in the specified Ares field is a numeric value that can be used in the mathematical comparison. For example, the routing rule match string condition i.PubDate > 2020 in the example above should be rewritten as follows:
TRY_CAST(i.PubDate AS INT) > 2020
The TRY_CAST function will first check to ensure the data in the PubDate field is an integer value that can be used in the comparison. If the data in the PubDate field is non-numeric and cannot be converted to an integer for the comparison, it will not cause an error but will simply exclude that item from being considered a match for the routing rule.
Example Routing Rules
Route Items by Department
Using this example routing rule, all item requests received from users in the Psychology department will be sent to a special custom queue called Awaiting Reserves Processing - Psychology when they are received.
For this routing example to work properly, you would also have to create a custom queue named Awaiting Reserves Processing - Psychology.
Rule ID |
1 |
---|---|
Active |
True (checked) |
Status |
Awaiting Reserves Processing |
Match |
|
New Status |
Awaiting Reserves Processing - Psychology |
Description |
Moves requests from the Psychology Dept to Awaiting Reserves Processing - Psychology. |
Route Items by Format
Using this example routing rule, all item requests submitted with an item format of "Video" will be sent to a special custom review queue called Awaiting Reserves Video Processing when they are received.
For this routing example to work properly, you would also have to create a custom queue named Awaiting Reserves Video Processing.
Rule ID |
2 |
---|---|
Active |
True (checked) |
Status |
Awaiting Reserves Processing |
Match |
|
New Status |
Awaiting Reserves Video Processing |
Description |
Moves all video requests to Awaiting Reserves Video Processing. |
Route Items by User
Using this example routing rule, all item requests received from the high-priority faculty members John Doe and Jane Doe will be sent to a custom review queue called Awaiting Supervisor Review.
For this routing example to work properly, you would also have to create a custom queue named Awaiting Supervisor Review.
Rule ID |
3 |
---|---|
Active |
True (checked) |
Status |
Awaiting Reserves Processing |
Match |
You could also write the string this way:
|
New Status |
Awaiting Supervisor Review |
Description |
Moves John Doe and Jane Doe requests to Awaiting Supervisor Review. |