-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Enhance ConstraintOperator capability #6104
Enhance ConstraintOperator capability #6104
Conversation
…ares incompatible types
@mariofusco This PR is not a clear separation as you mentioned in kiegroup/drools-ansible-rulebook-integration#112 (comment) This PR enhances |
- Add unit test
Updated with beta index support and unit test |
// alpha index hashing is effective, so the predicated is not called | ||
assertThat(customConstraintOperator.counter).isZero(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If alpha index is effective, the predicate in the CustomConstraintOperator
is not executed.
// When beta index is used, the predicate in the custom operator is not actually called | ||
assertThat(customConstraintOperator.counter).isZero(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If beta index is effective, the predicate in the CustomConstraintOperator
is not executed.
As commented above, if alpha/beta index is effective, the predicate in the I guess alpha index is a more possible use case. For example, A user mistakenly wrote wrong rules like this.
Then, an incoming event has We can do type check in a predicate in a custom If we want to rescue the situation, we need to implement type check at |
drools-model/drools-canonical-model/src/main/java/org/drools/model/ConstraintOperator.java
Outdated
Show resolved
Hide resolved
drools-model/drools-canonical-model/src/main/java/org/drools/model/ConstraintOperator.java
Outdated
Show resolved
Hide resolved
* [DROOLS-7635] ansible-rulebook : Raise an error when a condition compares incompatible types * - Add beta index support - Add unit test * changed method names
* [DROOLS-7635] ansible-rulebook : Raise an error when a condition compares incompatible types * - Add beta index support - Add unit test * changed method names
* [DROOLS-7635] ansible-rulebook : Raise an error when a condition compares incompatible types * - Add beta index support - Add unit test * changed method names
…ares incompatible types
This PR is to enhance
ConstraintOperator
to be able to use alpha/beta index.