Customizing Business Rules

So far, we’ve explored sample scenarios that have well-known business rules. For example, in the expense report scenario, the business rules are always the same. This workflow solution defines the direct manager as a single approver, and the content of the notifications is predefined as well. Depending on the expense total value, the workflow solution will either send a notification to the manager or to the accounting department. However, there are many real-world applications that have complex business rules. Routing for approval can depend on many business variables, and notifications can change depending on some other variables. Imagine that in the same expense reporting solution, you have to route an expense report to up to ten different managers, depending on the expense purpose, the expense total, and the date of submission. Additionally, depending on the expense purpose, the content of the notifications sent by the workflow will have some slight differences. This means that there may be multiple workflow solutions with different routing levels and notifications. In all previous solutions discussed in this chapter the approvers and notifications of the solutions are predefined, meaning that each workflow instance will always follow the same business logic and execute the same predefined activities. However, for OBA workflow solutions in which you need more flexibility, you must build a separate component that encapsulates complex business rules. Depending on the complexity of the business rules of your solution, you may either create a database that stores and validates all these business rules, create custom business layer classes or Web services, or use Excel 2007 as a business rule storage for decision sets.

Excel 2007 simplifies the rules capture and decision process for notifications and approvals. Implementing decision tables using Excel 2007 represents low costs for companies that already invested in 2007 Microsoft Office systems licenses. To add to the benefits, Excel 2007 provides a comfortable environment for rules administrators and requires minimal investment in training. Figure 7-20 shows routing rules in Excel 2007 and Figure 7-21 shows notification rules in Excel 2007.

Routing rules in Excel 2007

Figure 7-20. Routing rules in Excel 2007

Notification rules in Excel 2007

Figure 7-21. Notification rules in Excel 2007

You can use Excel 2007 to store decision tables that capture approval, routing, and notification values. Thanks to the Open XML Formats, you can easily extract routing and approval domain information from Excel 2007 spreadsheets. Depending on your business needs, you can create a sequential or state machine workflow template using Visual Studio 2008. As part of your workflow template solution, you can use the Open XML Object Model API to retrieve business rules information from the decision tables stored in Excel 2007 spreadsheets.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset