[jboss-jira] [JBoss JIRA] (DROOLS-4956) Normarize rule constraints for property reactivity and indexing
Toshiya Kobayashi (Jira)
issues at jboss.org
Fri Jan 24 04:48:56 EST 2020
[ https://issues.redhat.com/browse/DROOLS-4956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13956055#comment-13956055 ]
Toshiya Kobayashi commented on DROOLS-4956:
-------------------------------------------
Note: Person( "Toshiya" == name ) works for property reactivity thanks to MvelConstraint.getPropertyNameFromSimpleExpression()/StringUtils.extractFirstIdentifier() which intelligently detects the property name. However, it doesn't work for indexing because CompositeObjectSinkAdapter.isHashable() returns false (indexableConstraint.fieldValue == null in this case).
> Normarize rule constraints for property reactivity and indexing
> ---------------------------------------------------------------
>
> Key: DROOLS-4956
> URL: https://issues.redhat.com/browse/DROOLS-4956
> Project: Drools
> Issue Type: Bug
> Components: core engine, executable model
> Affects Versions: 7.31.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Toshiya Kobayashi
> Priority: Major
>
> Having a constraint like
> {code:java}
> Person( name == "Toshiya" )
> {code}
> is not really the same thing as
> {code:java}
> Person( "Toshiya" == name )
> {code}
> In the second case not only you don't have property reactivity, but also you don't have indexing. This an inconsistent behaviour and hoping to fix it with a "normalization" phase where the second constraint got rewritten like the first before being analyzed by property reactivity and indexing.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list