Hi,
Unfortunatelly, this is the correct behaviour.
Usually, this is resolved by adding one additional constraint in rule
1, like
rule "Active premium billing policy initiated by an agent"
salience 10
when
There is a Policy
- without status "CANL"
- without status "LAPS"
- with pbs agent pay plan
- NON RENEWABLE
Policy is premium billing
then
Notify "This policy is active. Please call your agent for
billing
information."
Notify "The agent's phone number is " + p.getAgentPhoneNo() +
"."
end
This way, if the policy is non renewable, it will only trigger rule
1. If it is renewable, it will trigger rule 2, that will after trigger
rule 1.
If the order of the rule firing is sensitive for you, then you would
need to flag rule one to not fire again using some other
attribute/condition.
[]s
Edson
wheeler1 wrote:
I have two rules:
rule "Active premium billing policy initiated by an agent"
salience 10
when
There is a Policy
- without status "CANL"
- without status "LAPS"
- with pbs agent pay plan
Policy is premium billing
then
Notify "This policy is active. Please call your agent for
billing
information."
Notify "The agent's phone number is " + p.getAgentPhoneNo() +
"."
end
rule "Active premium billing policy initiated by an agent renewable"
when
There is a Policy
- without status "CANL"
- without status "LAPS"
- with pbs agent pay plan
- renewable
Policy is premium billing
then
Disallow renewals
Notify "Please contact a customer service representative at
555-1234 to
discuss renewing your policy."
end
The second rule runs last and causes the first rule to run again because it
flips the renewal flag (modifyObject in the DSL). How can I stop the first
rule from running a second time? no-loop doesn't work and wasn't designed
for this as far as I can tell.
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3124-6000
Mobile: +55 11 9218-4151
JBoss, a division of Red Hat @ www.jboss.com
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email