- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
How much do you know about the execution order of business rules? Most admins clearly understand the difference between before and after rules, if you don't, you really need to start there. What about the business rule order values? There's more to them than simply controlling the order in which rules are processed. There's some magic that happen when business rule orders are 1000 or higher that you may not be aware of. This is a critical point to understand since all of the system engine processing happens between the processing of rules at 999 and 1000. By system engines I'm referring to approval and assignment rules, data policies, escalations, workflow, and notification to name a few.
Here's a copy of the details from the wiki. If you are creating or managing business rules you need to understand these.
The order of execution is as follows:
1. Before business rules: Scripts configured to execute before the database operation with an order less than 1000.
2. Before engines. The following are not executed in any specific order:
- Approval engine (for task and sys_approval_approver tables)
- Assignment rules engine (for task tables)
- Data policy engine
- Escalation engine
- Field normalization engine
- Role engine - keeps role changes in sync with sys_user_has_role table (for sys_user, sys_user_group, sys_user_grmember, and sys_user_role tables)
- Execution plan engine (for task tables)
- Update version engine - creates version entry when sys_update_xml entry is written (for sys_update_xml table)
- Workflow engine
3. Before business rules: Scripts configured to execute before the database operation with an order greater than or equal to 1000.
4. The data base operation (insert, update, delete).
5. After business rules: Scripts configured to execute after the database operation with an order less than 1000.
6. After engines. The following are not executed in any specific order:
- Label engine
- Listener engine
- Table notifications engine
- Role engine - keeps role changes in sync with sys_user_has_role table (for sys_user, sys_user_group, sys_user_grmember and sys_user_role tables)
- Text indexing engine
- Update sync engine
- Data lookup engine inserts or updates
- Email notifications. The following are executed based on the weight of the notification record:
- Notifications sent on an insert, update, or delete
- Event-based notifications
7. After business rules. Scripts configured to execute after the database operation with an order greater than or equal to 1000.
While we're on the topic of business rules, the other MUST know and use feature is business rule debugging. The output also identifies the various execution phases as mentioned above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.