[jboss-jira] [JBoss JIRA] Updated: (JBRULES-2672) Error while parsing xml with <and-constraint-connective> within <pattern>

Veit Guna (JIRA) jira-events at lists.jboss.org
Thu Mar 24 06:13:57 EDT 2011


     [ https://issues.jboss.org/browse/JBRULES-2672?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Veit Guna updated JBRULES-2672:
-------------------------------

    Attachment: drools-compiler.patch


Updated patch that allows NOT to be parent of OR and AND elements according to the .xsd.


> Error while parsing xml with <and-constraint-connective> within <pattern>
> -------------------------------------------------------------------------
>
>                 Key: JBRULES-2672
>                 URL: https://issues.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
>         Attachments: drools-compiler.patch, drools-compiler.patch, drools-compiler.patch, drools-compiler.patch, drools-compiler.patch
>
>
> 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--
> {code:xml}    
>                 <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>
> {code}
> --cut here--
> Parsing this seems to fail when adding the package from xml:
> {code}
> 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
> {code}
> 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:
> {code}
> System.setProperty("drools.schema.validating","false");
> {code}
> but with no luck. So find attached the _very_ complex patch that adds PackageDescr to the AndHandler :).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list