yurloc opened a new issue, #5900:
URL: https://github.com/apache/incubator-kie-drools/issues/5900

   ## Parent issue
   - #5678 
   
   ## Failing tests
   - 
`org.drools.testcoverage.regression.FusionAfterBeforeTest#testExpireEventsWhenSharingAllRules`
   
   ## Notes
   I did some preliminary investigation and I think the problem is in the FQN 
of the event class (EventB). It seems like it's incorrectly prefixed with 
`defaultpkg`, therefore the `MVELExprAnalyzer` fails to load the class and read 
the duration accessor.
   
   ## Rule code snippet
   ```java
               drlBuilder.append(" import " + EventA.class.getCanonicalName() + 
";\n");
               drlBuilder.append(" import " + EventB.class.getCanonicalName() + 
";\n");
               drlBuilder.append(" declare " + EventA.class.getName() + " 
@role( event ) @duration(duration) end");
               drlBuilder.append(" declare " + EventB.class.getName() + " 
@role( event ) @duration(duration) end");
               drlBuilder.append(" rule R" + i + " when \n");
               drlBuilder.append("   $event1: " + EventA.class.getName() + 
"()\n");
               drlBuilder.append("   $event2: " + EventB.class.getName() + 
"(this != $event1, this after [1,10] $event1)\n");
               drlBuilder.append( "then end\n" );
   ```
   
   ## Error output
   ```
   ### parse : ANTLR4_PARSER_ENABLED = true
   09:42:34.157 [Time-limited test] ERROR 
o.d.c.k.b.impl.AbstractKieProject.buildKnowledgePackages:280 - Unable to build 
KieBaseModel:defaultKieBase
   Error processing @duration for TypeDeclaration 
'defaultpkg.org.drools.testcoverage.common.model.org.drools.testcoverage.common.model.EventB':
 cannot access the field 'duration'
   Error processing @duration for TypeDeclaration 
'defaultpkg.org.drools.testcoverage.common.model.org.drools.testcoverage.common.model.EventA':
 cannot access the field 'duration'
   
   
   java.lang.RuntimeException: [Message [id=1, kieBase=defaultKieBase, 
level=ERROR, path=null, line=-1, column=0
      text=Error processing @duration for TypeDeclaration 
'defaultpkg.org.drools.testcoverage.common.model.org.drools.testcoverage.common.model.EventB':
 cannot access the field 'duration'], Message [id=2, kieBase=defaultKieBase, 
level=ERROR, path=null, line=-1, column=0
      text=Error processing @duration for TypeDeclaration 
'defaultpkg.org.drools.testcoverage.common.model.org.drools.testcoverage.common.model.EventA':
 cannot access the field 'duration']]
   
        at org.kie.internal.utils.KieHelper.getKieContainer(KieHelper.java:127)
        at org.kie.internal.utils.KieHelper.getKieContainer(KieHelper.java:119)
        at org.kie.internal.utils.KieHelper.build(KieHelper.java:79)
        at 
org.drools.testcoverage.regression.FusionAfterBeforeTest.testExpireEventsWhenSharingAllRules(FusionAfterBeforeTest.java:136)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to