[jboss-jira] [JBoss JIRA] (DROOLS-5023) executable model doesn't fire when Or with trimmed duplicate constraints
Toshiya Kobayashi (Jira)
issues at jboss.org
Fri Feb 7 00:36:24 EST 2020
[ https://issues.redhat.com/browse/DROOLS-5023?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13966144#comment-13966144 ]
Toshiya Kobayashi commented on DROOLS-5023:
-------------------------------------------
ReteDumper shows that the AlphaNode are not shared
{noformat}
[EntryPointNode(1) EntryPoint::DEFAULT ]
[ObjectTypeNode(2)::EntryPoint::DEFAULT objectType=[ClassObjectType class=org.drools.core.reteoo.InitialFactImpl] expiration=-1ms ]
[ObjectTypeNode(3)::EntryPoint::DEFAULT objectType=[ClassObjectType class=org.drools.modelcompiler.domain.Person] expiration=-1ms ]
[AlphaNode(13) constraint=Constraint for '2775D4065FCB4B990148A0A19FFDC558' (index: AlphaIndex #14 (EQUAL, left: lambda 267098351, right: Mario))]
[LeftInputAdapterNode(14)]
[RuleTerminalNode(15): rule=R2]
[AlphaNode(7) constraint=Constraint for '593440B7603CA900F1A34F18497AB0EA' (index: AlphaIndex #14 (EQUAL, left: lambda 267098351, right: Mario))]
[LeftInputAdapterNode(8)]
[RuleTerminalNode(9): rule=R1]
[AlphaNode(10) constraint=Constraint for '85DD981B78E0370C2E48B21F2BB8D1DF' (index: AlphaIndex #14 (EQUAL, left: lambda 267098351, right: Mark))]
[LeftInputAdapterNode(11)]
[RuleTerminalNode(12): rule=R2]
[AlphaNode(4) constraint=Constraint for '7A9C8DF5A1F36ECE3F75D8DA7E5C8E40' (index: AlphaIndex #14 (EQUAL, left: lambda 267098351, right: Mark))]
[LeftInputAdapterNode(5)]
[RuleTerminalNode(6): rule=R1]
{noformat}
> executable model doesn't fire when Or with trimmed duplicate constraints
> ------------------------------------------------------------------------
>
> Key: DROOLS-5023
> URL: https://issues.redhat.com/browse/DROOLS-5023
> Project: Drools
> Issue Type: Bug
> Components: executable model
> Affects Versions: 7.32.0.Final
> Reporter: Toshiya Kobayashi
> Assignee: Luca Molteni
> Priority: Major
>
> With a rule like this, (see that the second rule's constraints are trimmed)
> {noformat}
> rule R1 when
> Person( $name: name == "Mark", $age: age ) or
> Person( $name: name == "Mario", $age : age )
> then
> list.add( $name + " is " + $age);
> end
> rule R2 when
> $p: Person( name=="Mark", $age: age ) or
> $p: Person( name=="Mario", $age : age )
> then
> list.add( $p + " has " + $age + " years");
> end
> {noformat}
> when you insert a fact,
> {code:java}
> ksession.insert( new Person( "Mark", 37 ) );
> {code}
> only one rule fires.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list