Rikkola opened a new issue, #7101:
URL: https://github.com/apache/incubator-kie/issues/7101
### Describe the bug
### Named consequence before a later sequence → wrong anchor skip
When a named consequence sits between two sequences:
```java
pattern(person),
sequence(pattern(toy).expr("ball", ...)),
when("always", person, p -> true).then(
on(toy).breaking().execute(...)
),
sequence(pattern(relationship).expr("go", ...))
```
`buildSequenceVarIndexesForConsequence()` calculates `skip = totalSeqs - 1 -
sequenceIndex`, but `totalSeqs` counts every sequence in the rule, including
those after the named-consequence terminal. When the first sequence completes,
its consequence has only one sequence anchor in the tuple chain but the
compiler recorded `skip=1`, producing:
```
IllegalStateException: SequencerFactSupplier: no SequencerMemory anchor
found at skip=1
```
The metadata should be calculated relative to each consequence terminal
rather than the rule-wide total. Recording a sequence/node identity instead of
a positional skip count would be more robust.
**Relevant code:**
- `KiePackagesBuilder.java:434-441`
- `LambdaConsequence.java:396-406`
### 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]