Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-800

KieBase compilation fails when @PropertyReactive declared in different DRL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.3.0.Beta1
    • 6.2.0.Final
    • core engine
    • None
    • Hide

      Clone the repo: https://github.com/DuncanDoyle/drools-propreactive-kiebase-build-issue
      Run 'mvn clean test'
      1 test fails.

      Rename 'a.drl' in the 'notOK' folder in 'src/main/resources' directory to 'ab.drl' .
      Run 'mvn clean test'
      All tests pass.

      Show
      Clone the repo: https://github.com/DuncanDoyle/drools-propreactive-kiebase-build-issue Run 'mvn clean test' 1 test fails. Rename 'a.drl' in the 'notOK' folder in 'src/main/resources' directory to 'ab.drl' . Run 'mvn clean test' All tests pass.

      I declare my events in a DRL that is different from the DRL that contains my rules. I declare my event with @propertyReactive. In my rule I use an @watch annotation. In JBoss BRMS 6.1 / Drools 6.2+, this causes an error when building my KieBase:

      java.lang.RuntimeException: Error while creating KieBase[Message [id=1, level=ERROR, path=rules.drl, line=7, column=0
         text=Wrong usage of @Watch annotation on class org.jboss.ddoyle.drools.propreactive.model.Event1 that is not annotated as @PropertyReactive]]
      	at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:418)
      	at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:396)
      

      The interesting thing is that the error only occurs if I give my DRL with my 'declare' a certain name. I.e. if I name it 'a.drl', building the KieBase fails, if I name it 'ab.drl', it succeeds.

      A reproducer can be found here: https://github.com/DuncanDoyle/drools-propreactive-kiebase-build-issue

      Just run a 'mvn clean test' on the project.

              mfusco@redhat.com Mario Fusco
              rhn-gps-ddoyle Duncan Doyle (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: