|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV |
TODAY'S TOP SOA & WEBSERVICES LINKS BPEL4WS Building Flexible Business Processes Using BPEL and Rules
Don't embed business policies in your business processes: Automate them with a business rules engine!
Dec. 12, 2005 07:00 PM
Open standards-based BPM solutions, such as many of those based on BPEL, enable all three approaches: code-based, model-driven, and service-oriented. They allow you to use your choice of rules engine if you decide to go for the model-driven or the service-oriented approach. You can also leverage existing rules/rules repositories/rules engines for use in business processes. If you need to use facts external to the BPM solution, then you generally don't have to worry about synchronizing rules metadata if you take the service-oriented approach. However, if you don't, then you can use the integrated rules capabilities and benefit from the integrated design time for rules and processes.
Case Study Consider the example of a loan flow process that is deployed at a loan agency. The loan agency accepts a request from a client, performs a credit check with an external service, and then does an automatic approval or routes it to a manager for review. Depending on the outcome, the loan flow process notifies the customer. The scenario consists of the following participants: the customer, the loan agency's approval process, and the credit rating service. Various facts that may be used to make loan approval decisions include the loan amount, the customer's annual income, the customer's credit rating, the status at this agency (returning customer or new customer), and the agency's outstanding loans (after all, if the agency has approved many high risk loans recently, it's probably a good idea to take this into account in approving future loans). Now let's consider various decision points in the process: 1. The first step is to get the credit rating from the credit rating service. The credit rating service may return a rating if the customer has a past history or it may return a NULL value if the customer is not known. If the loan agency does not want to ever deal with customers without a credit rating, it may have a rule such as: (see Insert 1) This rule is very simple and not likely to be changed after process deployment. Hence, the fastest way to implement this would be by using the code-based approach with XPath or other expressions. Now let's consider a slightly more complex rule. 2. The loan agency may then use the customer's social security number (SSN), prior credit history, annual income, and outstanding loans to determine the customer credit rating, the risk, and maximum amount to lend a specific customer (see Insert 2). In the above rule, there are various inputs that are provided by the business analysts; for example, the minimum annual income requirements and credit score. The analysts would like the ability to change these without necessarily redeploying the process. In this case, the model-driven or service-oriented approach would offer the most flexibility, since the rules would be separate from the process logic and can be modified independently. The code-based approach would not work since it would not be maintainable in the long run, and as the rules get more complex, defining them through just simple expressions would be very difficult. Now let's examine a slightly more complex scenario. 3. Based on the current business environment and other company policies, the loan agency may interpret the results differently and further apply rules to determine if the customer should be granted the loan, what interest rate should be given, and the appropriate approval policies. Note that in case 2 above, all the information needed to apply the rules was available from the business process itself. However, in some cases, rules may require additional facts that are asserted by other applications. Say you want to know if the "outstanding loans this month" are greater than US$3M or if the customer already has some other products - say, home equity loan or insurance products - from this company. These facts are provided to the rules engine by other applications, but are used by the rules engine in the decision to approve or reject a loan. For example: (see Inserts 3 & 4) In this case, the decision service is used to evaluate rules based on both static data; that is, the loan application, as well as data such as "outstanding loans to high risk customers" from the BAM system. Similarly, rules are also used for dispatching the loan application for manual processing for high-risk customers. In this scenario, the code-based approach will obviously not work because it is not flexible enough and would be very difficult to maintain in the long run. The model-driven approach also is not very effective, since the rule engine requires facts/data from external systems such as a BAM solution or customer database. You could make the loan business process retrieve all this data and pass it to the rules engine; however, this would make the process very complex and would require changes every time the business analyst decided to use additional criteria for loan approval. The service-oriented approach works best in this case. You could have a central rules repository with a decision service that is used by all clients of the rules engine. The BPM solution, as well as other applications like BAM, would assert different facts to this service that executes the appropriate rule sets to make decisions. This process and the various decision points are also illustrated in the architecture diagram in figure 1. As you can see, the first rule is implemented using inline process logic, and the rules service is used for cases 2 and 3 discussed above. We suggest the following rules of thumb when deciding how to leverage rules logic in business processes:
SOA WORLD LATEST STORIES
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||