Krishnan,

  May I ask you please to open a JIRA and attach your examples bellow? It
seems to be a bug...
  As a workaround, while we fix it, use primitive booleans and it shall
work...

   []s
   Edson

2007/5/21, Krishnan <[EMAIL PROTECTED]>:


Hi All,

I am using the 4.0.M2 version of jboss rules.

public class Device() {

private Boolean isCiscoVersion;
private Boolean sysNamePresent;
private Boolean isPixVersion;

}

When I write the rule as follows :-

rule "Cisco PIX Device"

    when
        d : Device ( isCiscoVersion == null,
                     sysNamePresent == true,
                     isPixVersion == true )
    then
        System.out.println("This is a cisco pix device.");

end

The rule works. However, when I write the same rule as

rule "Cisco PIX Device"

    when
        d : Device ( isCiscoVersion == false,
                     sysNamePresent == true,
                     isPixVersion == true )
    then
        System.out.println("This is a cisco pix device.");

end

It even fails to compile and add the rule into the package. Not sure what
is going on ?.

Following is the error I keep getting :-

java.lang.NullPointerException
    at org.drools.reteoo.CompositeObjectSinkAdapter$HashKey.setValue (
CompositeObjectSinkAdapter.java:501)
    at org.drools.reteoo.CompositeObjectSinkAdapter$HashKey.<init>(
CompositeObjectSinkAdapter.java:441)
    at org.drools.reteoo.CompositeObjectSinkAdapter.hashSinks(
CompositeObjectSinkAdapter.java :158)
    at org.drools.reteoo.CompositeObjectSinkAdapter.addObjectSink(
CompositeObjectSinkAdapter.java:72)
    at org.drools.reteoo.ObjectSource.addObjectSink(ObjectSource.java:104)
    at org.drools.reteoo.ObjectTypeNode.addObjectSink (ObjectTypeNode.java
:313)
    at org.drools.reteoo.AlphaNode.attach(AlphaNode.java:116)
    at org.drools.reteoo.builder.BuildUtils.attachNode(BuildUtils.java
:129)
    at org.drools.reteoo.builder.PatternBuilder.attachAlphaNodes (
PatternBuilder.java:119)
    at org.drools.reteoo.builder.PatternBuilder.attachPattern(
PatternBuilder.java:71)
    at org.drools.reteoo.builder.PatternBuilder.build(PatternBuilder.java
:55)
    at org.drools.reteoo.builder.GroupElementBuilder$AndBuilder.build (
GroupElementBuilder.java:111)
    at org.drools.reteoo.builder.GroupElementBuilder.build(
GroupElementBuilder.java:69)
    at org.drools.reteoo.builder.ReteooRuleBuilder.addSubRule(
ReteooRuleBuilder.java:143)
    at org.drools.reteoo.builder.ReteooRuleBuilder.addRule(
ReteooRuleBuilder.java:108)
    at org.drools.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:112)
    at org.drools.reteoo.ReteooRuleBase.addRule(ReteooRuleBase.java :266)
    at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java
:293)
    at com.sample.CfiTest.readRule(CfiTest.java:71)
    at com.sample.CfiTest.main(CfiTest.java:23)


Any ideas why this is happening ?.

-Krishnan.

--
Sivaramakrishna Iyer Krishnan (Anand)

Never assume the obvious is true.
- William Safire
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users




--
 Edson Tirelli
 Software Engineer - JBoss Rules Core Developer
 Office: +55 11 3529-6000
 Mobile: +55 11 9287-5646
 JBoss, a division of Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to