Unfortunately I don't think Edson's suggestion will work as I gather you are
making the policy non-renewable in the second rule, which would match the
first rule even with the extra non-renewable condition
I would suggest either an extra property on the policy (i.e. "processed") or
a semaphore to indicate that you have processed the policy. In the RHS of
the second rule just set the processed flag or the semaphore before calling
modify.
cheers
Steve
On 12/5/06, Edson Tirelli <[EMAIL PROTECTED]> wrote:
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
--
Steven Williams
Supervising Consultant
Object Consulting
Office: 8615 4500 Mob: 0439 898 668 Fax: 8615 4501
[EMAIL PROTECTED]
www.objectconsulting.com.au
consulting | development | training | support
our experience makes the difference