Drools version 7.70.0.Final
Hi,
I have a lambda expression in the RHS of a rule that fails to compile if code blocks are used. The example below is a simplified example that doesn't need to use them but is just to illustrate the problem.
// Example 1, working
$list.stream().forEach(evd -> System.out.println("Here"));
modify($someFact) {
// ...
}; // Example 2, failing to compile with:
$someFact cannot be resolved to a variable $list.stream().forEach((i) -> {System.out.println("Here");});
modify($someFact) {
// ...
};
Looking at the generated code for Example 2, the modify block has not been translated in the generated java code, instead being transferred as is which is causing the compilation issue.
Is there another way this is supposed to be written?
Thanks