
Chapter 11. Business Rule Beans 343
Example 11-2 isPriceLimit() method
public boolean isPriceLimit (int total) {
boolean result = false;
try{
//Create new trigger point
TriggerPoint tp = new TriggerPoint();
//Disable caching - for demonstration purpose
tp.disableCaching();
//The rule expects one parameter: the total purchase order amount
Object[] firingParams = { new Integer(total) };
// Specify the business rule path.
String ruleName = "com/nicejourney/brb/rules/PriceLimit";
//Call the rule
Object resultObject = tp.triggerClassifier(
null, //Target Object-not required by rule implementation
firingParams, //Rule Implementor firing parameters
ruleName); //Th ...