We’ve recently added support for Configuration Item Rule Properties in Dovetail Rulemanager and Dovetail Agent. In this post I’ll cover what they are, why you’d want to use them, as well as a few examples.
First, a quick refresher on Rule Properties and Config Items.
Business Rule Properties are used in a number of places throughout the Dovetail suite, including:
- Business Rule Conditions
- Business Rule Action Messages
- Canned Response Variables
- Email Log Templates
Traditionally, a rule property would traverse a path through the schema, starting from the base object, and ending at a column.
For example, the Contact First Name property for a case would use the path case_reporter2contact:first_name.
However, there are instances where a static value may be desired, and this static value cannot be traversed to via a schema path. In these instances, a Configuration Item Rule Property is useful.
As a refresher, Configuration Items (commonly referred to as Config Items) are a way to store name/value pairs on a system-wide or user-specific level. They are stored in table_config_itm, and can be managed using Dovetail Agent, or imported via a DAT file.
Configuration Items have a Value Type, which defines the type of value they hold, which would be either String, Integer, or Float.
In the past, you could not use a Config Item, or other type of variable unrelated to the base object, as a rule property.
But now you can!
These are probably best illustrated with some examples.
Business Rule Message
You may wish to have a business rule message that contains a static string, such as a URL to a website. Rather than hard-coding that URL in every business rule, the URL can be stored in a Config Item. This would allow the string to be edited at a later time in one place (in the config item), as opposed to having to modify many business rules.
Here’s an example of how this would look in a business rule message:
RE: Action Item [Action Item ID] Assigned
Action Item [Action Item ID] has been assigned to you by [Logger].
[ConfigItem.Dovetail Agent URL.String]/action-items/[Action Item ID]
Take note of the [ConfigItem.Dovetail Agent URL.String] in that message.
The brackets around it tell rulemanager that it’s a rule property that should be evaluated.
It starts with “ConfigItem”, which defines it as a Config Item Rule Property.
The next portion (Dovetail Agent URL) is the name of the config item.
Finally, the value type. String, Integer, or Float. This defines what column on the config_itm table to retrieve the data from (str_value, i_value, or f_value).
And here’s what the Config Item looks like in Dovetail Agent:
A URL could also be used in an email template, such as in the send_email_about_obj com_template which is used when a Log Email is performed on a case.
Here’s an example of the action for the send_email_about_obj com_template, showing a config item used for the company logo URL, and for the Selfservice URL.
RE: About Case <ADDITIONAL_INFO> : [Case Title] [Subcase Title]
![Company Logo]([ConfigItem.Company Logo URL.String])
[Check the status and update your case (Case <ADDITIONAL_INFO>) online at the Dovetail SelfService site]([ConfigItem.Dovetail Selfservice URL.String]/case/<ADDITIONAL_INFO>)
Here, we’re using 2 different Config Item Rule Properties:
- [ConfigItem.Company Logo URL.String]
- [ConfigItem.Dovetail Selfservice URL.String]
Business Rule Condition
You may wish to have a business rule that only fires if this is the production database (as opposed to a test or development database). You could use a business rule condition based on a configuration item’s value. The config item would indicate the database type (production, test, development, etc. )
1. In your production database, create a config item named Database Instance, and set its value to production.
2. In your test database, create a config item named Database Instance, and set its value to test
3. Create a business rule property named Database Instance.
Set its path to be [ConfigItem.Database Instance.String].
This allows for it to be presented to the user in the Business Rule Condition picker UI.
4. Create a business rule with a condition of: Database Instance = production
Now that business rule will only fire if it happens in your production database. It will not fire in the test database.
Defining Configuration Item Rule Properties
Configuration Item Rule Properties can be defined in either of two ways:
- By directly referencing the Config Item using the Configuration Item Reference Syntax.
- By creating a business rule property whose path follows the Configuration Item Reference Syntax.
Details on both of these are below.
Configuration Item Reference Syntax
To reference a configuration item, use the following syntax:
[ConfigItem.Configuration Item Name.Configuration Item Value Type]
Notice that there are three parts:
- a static string (ConfigItem)
- the name of your config item
- and then its value type (String, Int, or Float)
All wrapped in square brackets, similar to other rule properties.
- [ConfigItem.My Support Site Url.String]
- [ConfigItem.Dots. and spaces In.Name.String]
- [ConfigItem.config item with all values.String]
- [ConfigItem.config item with all values.Int]
- [ConfigItem.config item with all values.Float]
Creating a Business Rule Property for a Configuration Item
You can also create a business rule property that resolves to a configuration item.
This is useful when you want to make it available in the UI, such as in a business rule condition.
To do so, create a rule property with the following settings:
- Name: A user-friendly name for the property
- Path or Function: [ConfigItem.Configuration Item Name.Configuration Item Value Type]
Note: Be sure to include the square brackets
Here is an example of a rule property for a configuration item:
Comparison to Function-based Rule Properties
Function-based Rule Properties allow you to write your own code to determine a value.
You could write your own Function-based rule property for a config item’s value, such as MySupportSiteUrlConfigItem, which would query for the MySupportSiteUrl configuration item and return its String value.
But, a Configuration Item Rule Property makes this process much simpler, and eliminates having to write or deploy custom code.
Configuration Item Rule Properties make it easy to use dynamic variables that are not based on the base object. They allows you to define a variable once and use it in many places (such as in many business rule messages). And if/when you need to change the variable’s value – it’s super easy to do. Simply change one config item, rather than changing many business rules.
These are just one more nicety to simply your sys admin duties. Hope you dig it.
Sign up to get information like this delivered right to your inbox.