|
From: <jbo...@li...> - 2006-06-06 06:01:27
|
Author: mic...@jb...
Date: 2006-06-06 02:01:22 -0400 (Tue, 06 Jun 2006)
New Revision: 4634
Modified:
labs/jbossrules/trunk/documentation/training/developers-course/lab-4-rule-formats/src/rules/approval/approval.drl
labs/jbossrules/trunk/documentation/training/developers-course/lab-4-rule-formats/src/rules/approval/archive/raw.drl
Log:
got rid of bad newlines
Modified: labs/jbossrules/trunk/documentation/training/developers-course/lab-4-rule-formats/src/rules/approval/approval.drl
===================================================================
--- labs/jbossrules/trunk/documentation/training/developers-course/lab-4-rule-formats/src/rules/approval/approval.drl 2006-06-06 05:03:43 UTC (rev 4633)
+++ labs/jbossrules/trunk/documentation/training/developers-course/lab-4-rule-formats/src/rules/approval/approval.drl 2006-06-06 06:01:22 UTC (rev 4634)
@@ -11,7 +11,7 @@
rule "Driver has had too many accidents"
when
- Driver has had more than 3 prior claims
+ Driver has had more than 3 prior claims
then
Reject Policy with explanation : 'Too many accidents'
@@ -27,32 +27,34 @@
end
rule "Driver is in marginal age"
- #remember, don't leave any blank lines in between expressions
+ #remember, don't leave any blank lines in between expressions
when
- Driver is between 18 and 24 years old
+ Driver is between 18 and 24 years old
Driver has had more than 1 prior claims
- Policy type is 'COMPREHENSIVE'
- then
- Reject Policy with explanation : 'No accidents allowed if in marginal age group'
+ Policy type is 'COMPREHENSIVE'
+ then
+ Reject Policy with explanation : 'No accidents allowed if in marginal age group'
end
-rule "Driver in unsafe area for marginal age"
- when
- Policy type is 'COMPREHENSIVE'
+rule "Driver in unsafe area for marginal age"
+ when
+ Policy type is 'COMPREHENSIVE'
Driver is less than 25 years old
- Driver has a location risk profile of 'HIGH'
- then
- Reject Policy with explanation : 'Marginal age driver in high risk area'
+ Driver has a location risk profile of 'HIGH'
+
+ then
+ Reject Policy with explanation : 'Marginal age driver in high risk area'
end
-rule "Driver in unsafe area with priors"
- when
+rule "Driver in unsafe area with priors"
+ when
Driver has a location risk profile of 'MED'
Policy type is 'COMPREHENSIVE'
Driver is less than 25 years old
- Driver has had more than 1 prior claims
- then
- Reject Policy with explanation : 'Driver in that area is too risky - given past accidents and age.'
+ Driver has had more than 1 prior claims
+
+ then
+ Reject Policy with explanation : 'Driver in that area is too risky - given past accidents and age.'
end
rule "Driver unsafe for third party"
Modified: labs/jbossrules/trunk/documentation/training/developers-course/lab-4-rule-formats/src/rules/approval/archive/raw.drl
===================================================================
--- labs/jbossrules/trunk/documentation/training/developers-course/lab-4-rule-formats/src/rules/approval/archive/raw.drl 2006-06-06 05:03:43 UTC (rev 4633)
+++ labs/jbossrules/trunk/documentation/training/developers-course/lab-4-rule-formats/src/rules/approval/archive/raw.drl 2006-06-06 06:01:22 UTC (rev 4634)
@@ -1,7 +1,8 @@
#created on: 23/05/2006
package org.acme.insurance
-
+import org.acme.insurance.Approve
+
rule "Driver underage"
when
@@ -40,7 +41,7 @@
d : Driver(locationRiskProfile == "MED")
d : Driver(priorClaims > 1)
d : Driver(age < 25)
- Policy(type == "COMPREHENSIVE")
+ Policy(type == "COMPREHENSIVE")
then
assert(new Rejection("Driver in that area is too risky - given past accidents and age."));
end
@@ -52,7 +53,10 @@
then
assert(new Rejection("Too many priors for third party"));
end
-
+
+
+
+
rule "Driver in bad area for theft"
when
@@ -60,37 +64,38 @@
d : Driver(locationRiskProfile == "HIGH")
then
assert(new Rejection("Unsafe area for theft"));
-end
+end
-rule "Quick approval - safe driver, any policy type"
- when
+rule "Quick approval - safe driver, any policy type"
+ when
not Rejection()
d: Driver(age >= 30)
d: Driver(priorClaims == 0)
- then
- assert(new Approve("Driver is safe, and mature"));
+ then
+ assert(new Approve("Driver is safe, and mature"));
end
-rule "Approve policy affirmative"
- salience 100 #this can short circuit any processing
- when
+rule "Approve policy affirmative"
+ salience 100 #this can short circuit any processing
+ when
a : Approve()
- p : Policy()
- then
+ p : Policy()
+
+ then
p.setApproved(true);
System.out.println("APPROVED: "
+ a.getReason());
- drools.clearAgenda(); #stop processing (bit of a hack ;)
+ drools.clearAgenda(); #stop processing (bit of a hack ;)
end
-rule "Approve if not rejected"
+rule "Approve if not rejected"
salience -100 #approve if there are no objections
- when
+ when
not Rejection()
- p : Policy(approved == false)
+ p : Policy(approved == false)
then
- System.out.println("APPROVED: due to no objections.");
- p.setApproved(true);
+ System.out.println("APPROVED: due to no objections.");
+ p.setApproved(true);
end
rule "Reject application"
|