[jboss-jira] [JBoss JIRA] (JBRULES-3321) isA operator does not work as expected with POJO facts

Davide Sottara (JIRA) jira-events at lists.jboss.org
Mon Jan 30 17:31:49 EST 2012


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

Davide Sottara resolved JBRULES-3321.
-------------------------------------

    Fix Version/s: 5.4.0.Beta2
       Resolution: Done

    
> isA operator does not work as expected with POJO facts
> ------------------------------------------------------
>
>                 Key: JBRULES-3321
>                 URL: https://issues.jboss.org/browse/JBRULES-3321
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-core  (expert)
>    Affects Versions: 5.3.0.Final
>            Reporter: Mike Melton
>            Assignee: Davide Sottara
>            Priority: Minor
>             Fix For: 5.4.0.Beta2
>
>         Attachments: declared-fact-trait-test.drl, pojo-fact-trait-test.drl, PojoFact.java, TraitTest.java
>
>
> Pasted from the rules-users list:
> I am having trouble getting the isA operator to work with POJO facts. The problem manifests in the IsAEvaluator.evaluate(...) method, line 163 (5.3.0.Final). This line checks whether the objectValue class is annotated with @Traitable. For a @Traitable fact fully declared in DRL, this line correctly evaluates to true. For a POJO fact which is declared @Traitable in DRL, this line evaluates to false. (I tried adding @Traitable to the POJO fact itself, which results in the line evaluating true, but the next line which casts to a TraitableBean fails.) I have attached a test demonstrating the problem. There are two DRL files, one which declares a fact entirely, and another which adds @Traitable to a POJO fact. The declared fact and the POJO fact have identical structure, and the rules are also otherwise identical. However, the declared test passes, while the POJO test fails.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list