declare another variable named countRule1 with initi value 1,
modify the rule 1 with condition x>2 && countRule1 ==1 and consequence 
countRule1++ ;modifyObject(countRule1);

another way?

-----邮件原件-----
发件人: Lionel Port [mailto:[EMAIL PROTECTED] 
发送时间: 2006年2月21日 8:39
收件人: [email protected]
主题: [drools-user] Is there a way to not fire already fired rules

Hi,
Is there a way in drools to not have rules that have already been fired firing 
again when an object is modified?


For example if I have:
1. rule 1 with condition x>2
2. rule 2 with condition y>2 and consequence x = 10 3. rule 3 with condition x>6

If I give the facts x=3 and y=3,

I would want
1. rule 1 and rule 2 are true so rule1 and rule 2 consequences are fired.
2. The consequence of rule 2 make rule 3 true, so rule 3 fires.

At the moment I get rule 1 firing a second time.


Lionel


********************************************************************************************************************************
The information in this email is confidential and may be legally privileged. If 
you have received this email in error or are
not the intended recipient, please immediately notify the sender and delete 
this message from your computer. Any use, distribution,
or copying of this email other than by the intended recipient is strictly 
prohibited. All messages sent to and from us may be 
monitored to ensure compliance with internal policies and to protect our 
business. 
Emails are not secure and cannot be guaranteed to be error free as they can be 
intercepted, amended, lost or destroyed, 
or contain viruses. Anyone who communicates with us by email is taken to accept 
these risks. 

收发邮件者请注意:
本邮件含保密信息,若误收本邮件,请务必通知发送人并直接删去,不得使用、传播或复制本邮件。
进出邮件均受到本公司合规监控。邮件可能发生被截留、被修改、丢失、被破坏或包含计算机病毒等不安全情况。 
********************************************************************************************************************************

Reply via email to