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

Mike Melton (Created) (JIRA) jira-events at lists.jboss.org
Wed Dec 28 13:41:09 EST 2011


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: Mark Proctor
            Priority: Minor


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