< Previous | Next >

Creating and using business rules

Create a group of rules that the bank will use to enforce its policy for loan applications. You will use these rules to send a response to the business process after the LoanLimits rule group is invoked, indicating if an applicant's credit rating is good enough to have the loan approved, or if a loan amount qualifies for automatic approval.

For example, the bank will want to specify that all loan applicants must have a minimum credit rating of 750 to get a loan request approved. This is achieved by creating a rule set with an if-then rule that says "If the applicant has a credit rating below 750, return a response to the invoker indicating that the loan request should be rejected". In this case, the invoker is the CreditCheck activity in mainProcess, and the boolean response that it receives is used in the ScoreEvaluation activity to decide which path in the process to follow.

To implement the LoanLimits business group and its business rules, follow the tasks below.

Generating the rule group

The rule group you will create is a group of rule sets that accept input from operations in the LoanLimitsRuleInterface, and provide responses based on the rules you create.

To generate the LoanLimits rule group implementation, follow these steps:
  1. Switch to the assembly editor.
  2. Right-click the LoanLimits component.
  3. From the pop-up menu, select Generate Implementation. The Generate Implementation window opens.
  4. In the navigation tree, click LoanApplicationModule and click OK. The rule group editor opens for LoanLimits

Adding a rule set to check an applicant's credit rating

Create a set of rules for deciding if the applicant is eligible for loan from the bank.

You will create the following rules:
  • Rule1: This default rule returns the response as false, indicating that the loan application has been declined.
  • Rule2: This rule invokes the checkCredit operation to obtain a credit score for the applicant.
  • Rule3: This rule takes the credit score stored in a variable from Rule2 and compares that against a value of 750. If the credit score of the applicant is 750 or higher, then the response is true and loan application will be approved.
To add the checkCredit rule set and the rules, follow these steps:
  1. Click Operation, which is the icon beside the checkCredit label.
  2. Click Enter Destination, which is the Enter Destination text figure.
  3. Select New Ruleset. The New Rule Set window opens.
  4. Click Finish. The business rules editor opens for checkCredit.
  5. Click Add Variable, which is the Add Variable button. var1 is added.
  6. In the Select Type field, select CreditBO.
  7. Click Add Action Rule, which is the Add Action Rule button. Rule1 is added.
  8. In the Action field, type response = false.
  9. Click Add Action Rule, which is the Add Action Rule button. Rule2 is added.
  10. Click the Action text figure.
  11. Select Invoke from the list.
  12. Click the Select Partner Link text figure and select CreditCheckInterfacePartner
  13. Click the Select Operation text figure and select checkCredit.
  14. Click the Input field. In the navigation tree, select applicantInformation : ApplicantBO > taxPayerId : nillable:string.
  15. In the Output field, type var1.
  16. Click Add If-Then Rule, which is the Add If-Then Rule button. Rule3 is added.
  17. In the If field, type var1.creditScore >= 750.
  18. In the Then field, type response = true.
  19. Click File > Save and close the rule set editor.
  20. Switch to the rule group editor.

Adding the autoapproval rule set

Create a set of rules to decide if the loan request will be automatically approved.

You will create the following rules:
  • Rule1: This default rule returns the response as false, indicating that the loan application must be manually approved.
  • Rule2: This if-then rule checks the loan amount against a value of 50 000. If the loan amount is less than this value, the response is true and the loan is automatically approved.
As you did for checkCredit, add the definition for the autoapproval rule set.
  1. Give Rule1 the following values:
    Rule Type Action
    Action Rule Add Action Rule response = false
  2. Give Rule2 the following values:
    Rule Type If Then
    If-Then Rule Add If-Then Rule applicationInformation.loanamount <= 50000 response = true
  3. Click File > Save and close the rule set editor.
Now that you have defined the business rules implementation, you will implement the CreditCheck component, which gets a credit rating for each applicant.

Feedback
(C) Copyright IBM Corporation 2005, 2007. All Rights Reserved.
< Previous | Next >