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

toString method is not applied to an object in a String rule constraint #986

Closed
baldimir opened this issue Mar 4, 2024 · 0 comments · Fixed by apache/incubator-kie-drools#5761
Assignees
Labels
area:engine Related to the runtime engines area:rules Related to Rules (DRL, DROOLS) type:bug Something is behaving unexpectedly

Comments

@baldimir
Copy link

baldimir commented Mar 4, 2024

When having constraints like this,

"    $p: Person() \n" +
"    String(this == \"someString\" + $p)\n"

the build ends with
Failed to coerce : InvalidExpressionErrorResult: Arithmetic operation requires compatible types. Found class java.lang.String and class org.drools.model.codegen.execmodel.domain.Person
and
Unable to Analyse Expression this == "someString" + $p

This works without using executable model.

Test case for this: https://gist.github.com/baldimir/c382da571b53f6faf2df96b245ff2add

@baldimir baldimir self-assigned this Mar 4, 2024
@baldimir baldimir added type:bug Something is behaving unexpectedly area:engine Related to the runtime engines labels Mar 4, 2024
@baldimir baldimir moved this from 📋 Backlog to ⏳ In Progress in 🦉 KIE Podling Board Mar 4, 2024
@yesamer yesamer added the area:rules Related to Rules (DRL, DROOLS) label Mar 5, 2024
@github-project-automation github-project-automation bot moved this from ⏳ In Progress to 🎯 Done in 🦉 KIE Podling Board Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:engine Related to the runtime engines area:rules Related to Rules (DRL, DROOLS) type:bug Something is behaving unexpectedly
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants