that may have been fixed in 3.0.5 (which will be release Real Soon Now) -
you can build 3.0.x branch from SVN if you are keen to try (and also in
trunk of course).

Michael.

On 11/17/06, weily li <[EMAIL PROTECTED]> wrote:

Here is the sample rules:

rule "level_pressure_2"
 when
>  exists Person();
>  $person : Person (dangerLevel <3, upBloodPressure >=180 ,
downBloodPressure >=90 )
 then
  #actions
>  $person.setDangerLevel($person.getDangerLevel() +1);

end


rule "level_pressure_3"
 when
#>  exists Person();
>  $person : Person (hisAge : age -> (safeAge(hisAge, 27,20)));
 then
>  System.out.println("----------->"+hisAge);
end

---- end ---

Now when I commented out one "exists" line, it works fine. But when there
are more than one "exists" in one drl, it throws following exception:

java.lang.ClassCastException
 at org.drools.reteoo.CompositeTupleSinkAdapter.addTupleSink(
CompositeTupleSinkAdapter.java:17)
 at org.drools.reteoo.TupleSource.addTupleSink(TupleSource.java:79)
 at org.drools.reteoo.RightInputAdapterNode.attach (
RightInputAdapterNode.java:100)
 at org.drools.reteoo.ReteooBuilder.attachNode(ReteooBuilder.java:808)
 at org.drools.reteoo.ReteooBuilder.attachExists(ReteooBuilder.java:515)
 at org.drools.reteoo.ReteooBuilder.addRule (ReteooBuilder.java:329)
 at org.drools.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:176)
 at org.drools.reteoo.ReteooRuleBase.addRule(ReteooRuleBase.java:238)
 at org.drools.common.AbstractRuleBase.addPackage (AbstractRuleBase.java
:278)
 at com.sample.DangerDiagnose.main(DangerDiagnose.java:42)
Exception in thread "main"



any suggestion or comments?

Thanks in advance

rgds

weily



Reply via email to