tkobayas commented on code in PR #6530:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6530#discussion_r2563144356


##########
drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/generator/visitor/pattern/ClassPatternDSL.java:
##########
@@ -123,6 +124,13 @@ protected void buildPattern(DeclarationSpec 
declarationSpec, List<PatternConstra
 
         if (pattern.isQuery()) {
             patternExpression = new MethodCallExpr( patternExpression, 
PASSIVE_CALL );
+        } else if (pattern.getSource() instanceof FromDescr fromDescr) {
+            String dataSourceText = fromDescr.getDataSource().getText();
+            boolean isEntryPoint = context.hasEntryPoint(dataSourceText);
+            boolean isRuleUnitVar = context.getRuleUnitVarType(dataSourceText) 
!= null;
+            if (!isEntryPoint && !isRuleUnitVar) {
+                patternExpression = new MethodCallExpr( patternExpression, 
PASSIVE_CALL );
+            }

Review Comment:
   This is the main fix. Followed the same approach as non-exec-model 
https://github.com/apache/incubator-kie-drools/blob/main/drools-compiler/src/main/java/org/drools/compiler/rule/builder/PatternBuilder.java#L300-L304
   
   If it's not passive, its segment is not considered as "eagerSegment", it 
misses to be masked (See `BuildtimeSegmentUtilities.updateNodeTypesMask`, 
`BuildtimeSegmentUtilities.requiresAnEagerSegment`, 
`SegmentMemorySupportImpl.initializePathMemory`), so results in "not fired".



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