Using Business Rules
Business rules occur as an extension of the activity on the client user interface. They interact with the client user interface causing values to be updated, related records to be created or updated, etc.
Business object rules, including business rules, are event-driven synchronous processes that can create or update records as a client function. These can occur as either client- or server-side processes, depending on the design of the rule and action being taken.
Business rules are a special case of business object rules. A business rule can perform a server-side update to the current record, create a related record, or update a related record after the current record is saved.
All business object rules are client event driven and occur when the event happens. Although there is no time limit on how long a business rule can take to run, their very nature makes them run quickly during the time a record is being manipulated, saved, or created.
Each business rule pertains to a single business object. Use the business rule editor to create rules with the following characteristics:
- Defined by business object.
- Commonly used to configure events that are based on user input forms.
- Contain definitions that include:
- Triggering events.
- Actions triggered by an event.
- Characteristics of user input forms that pertain to the business object.
- Executed immediately when triggered by an event.
- Cannot be used to define time-based events such as start times, delays, etc.
Before-save rules (such as LastModBy or LastModDateTime) are saving rules, and are executed after the business rule eval loop has been closed. Saving and validation rules cannot be used to trigger any actions nor any edit or calculated rules. |
By adding rules, you are adding restrictions rather than removing them. If a business object field is only available to a particular user, you cannot add access using a business rule.
Business rule type | Description |
---|---|
Triggered Actions | Contains generic rules. |
Initialization Rules |
Adds a rule when an object or field is initialized. |
Editing and Calculation Rules |
Automatically populates the value of a field when a dependent field is changed (for example, the value displayed in the Email field changes when the owner is changed).
Editing rules can also include calculation fields allowing you to define calculations on the field.
Use the drop-down lists to create an On Change, set sequence. Add expressions in the field provided. |
Read-Only Rules |
Adds read-only rules for entire business objects. For example, you can render a business object as read-only when the status field changes to resolved.
A business object must contain a read-only field to use this option.
When a form is opened for a read-only object, all controls (except those listed in the exception list) become read-only. When defining an exception list, it is important to understand which fields can be changed by business rules. These fields must be also be added to the exceptions list. Updating a field that is not part of the exception list generates an error message.
Child objects are not affected when a business object is changed to a read-only state. However, you may not be able to link a new child object to this business object. |
Required Rules |
Determines when a rule is required. Required rules can be conditionally required using expressions. |
Before-save Rules |
Determines when an object can be saved. |
Regular Expression Validation Rules |
Adds custom validation rules based on regular expressions (RegEx). These rules run when you save an object.
The following regular expressions apply:
Enter the message to show when this validation encounters an error. |
Validation Rules |
Prevents the closure of a record when an associated workflow item has not been marked completed or canceled.
To use this rule, add validation rules with custom expressions. The system runs the rule when the user saves the object. (See note above.)
For example, you may need to construct your incident module to block incident resolution and closure when an existing task has not been completed or canceled. Construct a validate on save rule as follows: $(((Status != "Closed") && (Status != "Resolved")) || IsTrueForAllChildren("Incident#", RecId, "Task#Assignment.Rev3", "$(Status == 'Completed' || Status == 'Canceled')")) |
Business rules apply to records created after the business rule has been created, and not retroactively to existing records. |
1. | From the Configuration Console, open a business object, then select the Business Rules tab. |
2. | Click Triggered Actions. The Triggered Actions window appears. |
3. | Click Add Trigger. The Create Triggered Action window appears. |
Create Triggered Action Window
4. | Enter a unique trigger name and description. |
5. | Select a trigger or event from the drop-down list. You can choose more than one. |
Trigger | Description |
---|---|
Disabled |
Disables this triggered action. Select this option when you want to create a read-only business rule.
NOTE: You cannot disable triggered actions that contain calculations. |
On Initialize | Runs when the object is initialized. |
On Insert | Runs when the object is inserted. |
On Delete | Runs when the object is deleted. |
On Update | Runs when the object is modified and saved. |
On Initialization of Specific Field |
Runs when a specific field is initialized. The following additional parameters appear when this option is selected, depending on the specified field:
|
On Update of Specific Field |
Runs when a specific field is modified. The following additional parameters appear when this option is selected, depending on the specified field:
|
On Creation of Specific Relationship |
Runs when a specified relationship is modified. Select the relationship from the drop-down list. |
On Removal of Specific Relationship |
Runs when a specified relationship is deleted. Select the relationship from the drop-down list. |
6. | Click Next. |
7. | Select one of the following actions: |
Action | Description |
---|---|
Rule Action: Send Email | This option appears if the rule is an email notification. See Communication Manager. |
Configure new action | Configures a new action. Select an action from the drop-down list. |
Use copy of existing quick action | Uses a copy of an existing quick action. Select an action from the drop-down list. |
8. | Click Next. The options that appear depend on the selected action. See Quick Actions. |
9. | Click Save. |
You can enable or disable most business rules except for rules containing calculated fields.
- By default, the system enables business rules when they are created. Click Disable to disable a business rule while it is being created. When disabled, the system grays out the rule entry.
- To enable an existing rule, click Enable.
-
To enable or disable an existing rule, click Disable.
When disabling a read-only business rule for a business object, a confirmation window offers additional options:
- Disable and Clear: Disables the rule and removes the read-only restriction from existing objects.
- Disable Rule: Disables the rule, but maintains the read-only state of any existing business objects.
Business rules apply to records that are created after the business rule has been modified, and not retroactively to existing records. |
Use caution when modifying a business rule as it might affect dependent objects. |
1. | From the Configuration Console, open a business object, then select the Business Rules tab. |
2. | Navigate to the rule to modify. |
3. | Click Edit . The Edit window appears. |
4. | Make changes. |
5. | Click Save. |
Use caution when deleting a business rule as it might affect dependent objects. |
1. | From the Configuration Console, open a business object, then select the Business Rules tab. |
2. | Navigate to the rule to delete. |
3. | Click Delete . The Delete confirmation window appears. |
4. | Click Yes to delete the rule. |