Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executable model fails to handle property reactive with null-safe-dereferencing #5957

Closed
tkobayas opened this issue May 17, 2024 · 2 comments
Assignees

Comments

@tkobayas
Copy link
Contributor

tkobayas commented May 17, 2024

When using null-safe-dereferencing !., exec-model fails to handle property reactive, so works like class reactive.

rule R 
when
    $p: Person(address!.street == "street1")
then
    modify($p) { setLikes("Cheese") };
end

This rule causes a loop.

@tkobayas tkobayas self-assigned this May 17, 2024
@tkobayas tkobayas changed the title executable model fails to handle property reactive with nested property executable model fails to handle property reactive with nested property and null-safe-dereferencing May 17, 2024
@tkobayas tkobayas changed the title executable model fails to handle property reactive with nested property and null-safe-dereferencing executable model fails to handle property reactive with null-safe-dereferencing May 17, 2024
@tkobayas
Copy link
Contributor Author

tkobayas commented May 17, 2024

Workaround:
Change (address!.street == "street1") to (address != null, address.street == "street1")

Note:
Ensure that ExpressionTyperContext.addReactOnProperties for the prop is called in https://github.com/apache/incubator-kie-drools/blob/main/drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/generator/visitor/pattern/ClassPatternDSL.java#L276-L280

@tkobayas
Copy link
Contributor Author

tkobayas commented Jun 6, 2024

Fixed by #5963

@tkobayas tkobayas closed this as completed Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🎯 Done
Development

No branches or pull requests

1 participant