[jboss-jira] [JBoss JIRA] (DROOLS-2699) Beta node indexes don't support type coercion

Toshiya Kobayashi (JIRA) issues at jboss.org
Tue Jul 3 01:41:00 EDT 2018


Toshiya Kobayashi created DROOLS-2699:
-----------------------------------------

             Summary: Beta node indexes don't support type coercion
                 Key: DROOLS-2699
                 URL: https://issues.jboss.org/browse/DROOLS-2699
             Project: Drools
          Issue Type: Bug
          Components: core engine
            Reporter: Toshiya Kobayashi
            Assignee: Mario Fusco


When there is a type mismatch (e.g. String vs Integer) in a constraint, usually a type is coerced and a rule is fired.

{code}
rule "R2"
    when
        $f : MyFactB( strData == 20 )
    then
        System.out.println( "R2 fired : $f = " + $f );
end
{code}

As far as I investigate, in case of AlphaNode, MVEL does the coercion. Also AlphaNode hashing does the coercion (https://github.com/kiegroup/drools/blob/7.5.0.Final/drools-core/src/main/java/org/drools/core/reteoo/CompositeObjectSinkAdapter.java#L748).

However, in case of JoinNode, it doesn't coerce so doesn't fire.

{code}
rule "R1"
    when
        MyFactA( $i : intData )
        $f : MyFactB( strData == $i )
    then
        System.out.println( "R1 fired : $f = " + $f );
end
{code}



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)


More information about the jboss-jira mailing list