Error while parsing xml with <and-constraint-connective> within <pattern>
-------------------------------------------------------------------------
Key: JBRULES-2672
URL:
https://jira.jboss.org/browse/JBRULES-2672
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler
Affects Versions: 5.1.0.FINAL
Environment: Jboss 5.1.0, Drools 5.1.0, Jdk 1.6.0_14
Reporter: Veit Guna
Assignee: Mark Proctor
Hi.
I'm using drools 5.1.0 together with .xdrl files. I encountered a possible bug in the
AndHandler class when
parsing the following .xdrl file:
--cut here--
<dro:pattern object-type="EMail">
<dro:and-constraint-connective>
<dro:field-constraint field-name="foo">
<dro:literal-restriction evaluator="!="
value="null"/>
</dro:field-constraint>
<dro:field-constraint
field-name="foo.toLowerCase">
<dro:literal-restriction evaluator="=="
value="test"/>
</dro:field-constraint>
</dro:and-constraint-connective>
</dro:pattern>
--cut here--
Parsing this seems to fail when adding the package from xml:
Caused by: org.drools.compiler.DroolsParserException: org.xml.sax.SAXParseException:
<and-constraint-connective> has an invalid parent element [[Pattern: id=null;
objectType=EMail]]
at org.drools.compiler.PackageBuilder.addPackageFromXml(PackageBuilder.java:304)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:468)
... 142 more
According to the .xsd (4.0) this should be no problem. Looking at the OrHandler it seems
that simply the
PatternDescr is missing from the validParents.
Also tried to disable xml validation with:
System.setProperty("drools.schema.validating","false");
but with no luck. So find attached the _very_ complex patch that adds PackageDescr to the
AndHandler :).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira