| ILOG JRules User Guide > Running and Debugging > Getting Started > Tutorial: Debugging a Ruleset > Task 4: Correcting the Problem |
Task 4: Correcting the Problem |
PREVIOUS NEXT |
When the application determines that a customer qualifies for a special offer, for instance through the pricing.qualifyFor.LongTermDiscount rule, the RentalAgreement object is supposed to be updated to include that offer. The rule engine should then evaluate the updated RentalAgreement object and fire the rule that computes the price for this special offer, for instance the pricing.price.LongTermDiscount rule. Since the rules that compute the price are not being triggered, it means that the RentalAgreement object is not being updated, and the rule engine cannot see the offer to evaluate it.
In this task, you are going to modify the Business Object Model (BOM) so that the addOffer method updates the Rental Agreement object. You will then remove the breakpoints you inserted earlier.
To modify the BOM so that the addOffer method updates the RentalAgreement object:
pricing.qualifyFor.LongTermDiscount rule
qualifies for; when the phrase becomes underlined, press the left mouse button.
bom > model > carrental > RentalAgreement > addOffer(String) corresponding to the {this} qualifies for the {0} offer phrase.
addOffer method will update the RentalAgreement object to show that it qualifies for a special offer.
debug-start-configuration, and execute the application until you stop in the qualifyFor.LongTermDiscount rule.
qualifyFor.SuperBowl rule is listed.
'the current rental agreement' qualifies for the "long term" offer in the pricing.qualifyFor.LongTermDiscount rule. If you switch the rule view from Intellirule to IRL, you will see that the ?context.updateContext(); statement is now present in the rule.
updateContext by clicking twice on pricing.price.LongTermDiscount rule:
in 'the current session' , display the message : " set the price of the long term offer for the" + 'the current rental agreement' description ;
pricing.price.LongTermDiscount that a price was computed for the long term offer.
Allocating the small discount to the Super Bowl offer for Rental Agreement for Julian Bayles (May 20, 1970)
Now that the RentalAgreement object is being updated correctly, you can remove the breakpoints in the rules so that they execute normally.
To remove the breakpoints:
Remove All Breakpoints.
Next: Task 5: Stepping through the BOM to XOM Mapping
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |