Rikkola opened a new issue, #7102:
URL: https://github.com/apache/incubator-kie/issues/7102

   ### Describe the bug
   
   `.bind(...)` variables inside a sequence → `NullPointerException` in RHS
   
   ```java
   Variable<String> toyName = declarationOf(String.class);
   
   sequence(
           pattern(toy)
                   .expr("ball", t -> t.getName().equals("ball"))
                   .bind(toyName, Toy::getName)
   ),
   on(toyName).execute(name -> results.add(name))
   ```
   
   `buildStepGate()` records only `patternImpl.getPatternVariable()` in 
`sequenceVarIndexes`; variables from `.bind(...)` are not recorded and are 
absent from the activation tuple too, so the consequence fails with:
   
   ```
   NullPointerException: Cannot invoke "Declaration.getTupleIndex()" because 
"declaration" is null
   ```
   
   Since the API accepts a full `PatternDef` as a `SequenceStep`, its bindings 
should work. If that's intentionally unsupported, `.bind(...)` should be 
rejected during model construction or compilation.
   
   **Relevant code:**
   - `KiePackagesBuilder.java:627-632`
   - `LambdaConsequence.java:251-258`
   
   ### Expected behavior
   
   _No response_
   
   ### Actual behavior
   
   _No response_
   
   ### How to Reproduce?
   
   _No response_
   
   ### Output of `uname -a` or `ver`
   
   _No response_
   
   ### Output of `java -version`
   
   _No response_
   
   ### GraalVM version (if different from Java)
   
   _No response_
   
   ### Kogito version or git rev (or at least Quarkus version if you are using 
Kogito via Quarkus platform BOM)
   
   _No response_
   
   ### Build tool (ie. output of `mvnw --version` or `gradlew --version`)
   
   _No response_
   
   ### Additional information
   
   _No response_


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