[rules-users] write rule in xml format.

stefano corna illidan.guru at gmail.com
Mon Dec 14 10:08:03 EST 2009


hello,
i use drools 5.0 and i have a big problem while i try to write a rule in xml
format.
my example rule is the follow:
---------------------------------------------------------------------------

<rule-set name="cheese rules"
    xmlns="http://drools.org/rules"
    xmlns:java="http://drools.org/semantics/java"
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
    xs:schemaLocation="http://drools.org/rules rules.xsd
    				   http://drools.org/semantics/java java.xsd">

    <rule name="Bob Likes Cheese">
        <parameter identifier="bob">
            <class>org.drools.examples.simple.Bob</class>
        </parameter>
        <java:condition>bob.likesCheese() == true</java:condition>
        <java:consequence>
            System.out.println( "Bob likes cheese." );
        </java:consequence>
    </rule>

</rule-set>
-----------------------------------------------------------

and editor (eclipse) show me this error and im unable to run program:
[1,0]: [ERR 101] Line 1:0 no viable alternative at input '<'
java.lang.IllegalArgumentException: Could not parse knowledge.
    at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:67)
    at com.sample.DroolsTest.main(DroolsTest.java:24)

someone know how to fix it? is this cause eclipse see the '<' as a boolean
operator and not as xml opening tag?

thanks in advice.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20091214/47ac14a0/attachment.html 


More information about the rules-users mailing list