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

   ## Parent issue
   - #5678 
   
   ## Failing tests
   - 
`org.drools.mvel.integrationtests.EdgeCaseNonExecModelTest#testNamedConsequencesInsideOR1`
   - 
`org.drools.mvel.integrationtests.EdgeCaseNonExecModelTest#testNamedConsequencesInsideOR2`
   
   ## Notes
   The new parser creates a slightly more flat descr structure compared to the 
old parser. I think that's the cause of the later compilation error.
   
   ### Old parser output (expected)
   ```
   lhs : [AND [[OR [[AND [[Pattern: id=$a; objectType=Cheese], do[t1]] ], 
[Pattern: id=$b; objectType=Cheese]] ], [Pattern: id=$c; objectType=Cheese]] ]
   - 0 :       [OR [[AND [[Pattern: id=$a; objectType=Cheese], do[t1]] ], 
[Pattern: id=$b; objectType=Cheese]] ]
   - 1 :                                                                        
                                  [Pattern: id=$c; objectType=Cheese]
   ```
   
   Note that the first pattern `$a : Cheese()` and its consequence `t1` are 
AND-connected `($a AND t1) OR $b`.
   
   ### New parser output (actual)
   ```
   lhs : [AND [[OR [[Pattern: id=$a; objectType=Cheese], do[t1], [Pattern: 
id=$b; objectType=Cheese]] ], [Pattern: id=$c; objectType=Cheese]] ]
   - 0 :       [OR [[Pattern: id=$a; objectType=Cheese], do[t1], [Pattern: 
id=$b; objectType=Cheese]] ]
   - 1 :                                                                        
                         [Pattern: id=$c; objectType=Cheese]
   ```
   
   Flat OR structure connecting three elements (`$a OR t1 OR $b`).
   
   ## Rule code snippet
   ```
   rule R1 when
       ( $a: Cheese ( type == "stilton" ) do[t1] or $b: Cheese ( type == 
"gorgonzola" ) )
       $c: Cheese ( type == "cheddar" )
   then
       results.add( $c.getType() );
   then[t1]
       results.add( $a.getType() );
   end
   ```
   
   ## Error output
   ```
   ### parse : ANTLR4_PARSER_ENABLED = true
   12:48:17.268 [main] ERROR 
o.d.c.k.b.impl.AbstractKieProject.buildKnowledgePackages:280 - Unable to build 
KieBaseModel:KieBaseModelName
   Rule Compilation error : [Rule name='R1']
        $a cannot be resolved
   
   
   12:48:17.269 [main] ERROR 
o.d.testcoverage.common.util.KieUtil.getKieBuilderFromKieFileSystem:165 - 
KieBuilder errors: [Message [id=1, kieBase=KieBaseModelName, level=ERROR, 
path=rules1.drl, line=4, column=0
      text=Rule Compilation error $a cannot be resolved]]
   
   java.lang.AssertionError: [[Message [id=1, kieBase=KieBaseModelName, 
level=ERROR, path=rules1.drl, line=4, column=0
      text=Rule Compilation error $a cannot be resolved]]] 
   Expecting empty but was: [Message [id=1, kieBase=KieBaseModelName, 
level=ERROR, path=rules1.drl, line=4, column=0
      text=Rule Compilation error $a cannot be resolved]]
   
        at 
org.drools.testcoverage.common.util.KieUtil.getKieBuilderFromKieFileSystem(KieUtil.java:169)
        at 
org.drools.testcoverage.common.util.KieUtil.getKieBuilderFromKieFileSystem(KieUtil.java:134)
        at 
org.drools.testcoverage.common.util.KieUtil.buildAndInstallKieModuleIntoRepo(KieUtil.java:78)
        at 
org.drools.testcoverage.common.util.KieUtil.buildAndInstallKieModuleIntoRepo(KieUtil.java:72)
        at 
org.drools.testcoverage.common.util.KieUtil.getKieModuleFromResources(KieUtil.java:249)
        at 
org.drools.testcoverage.common.util.KieUtil.getKieModuleFromResources(KieUtil.java:238)
        at 
org.drools.testcoverage.common.util.KieBaseUtil.getKieBaseFromKieModuleFromResources(KieBaseUtil.java:102)
        at 
org.drools.testcoverage.common.util.KieBaseUtil.getKieBaseFromKieModuleFromDrl(KieBaseUtil.java:115)
        at 
org.drools.mvel.integrationtests.EdgeCaseNonExecModelTest.executeTestWithDRL(EdgeCaseNonExecModelTest.java:105)
        at 
org.drools.mvel.integrationtests.EdgeCaseNonExecModelTest.testNamedConsequencesInsideOR1(EdgeCaseNonExecModelTest.java:73)
   ```


-- 
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