[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:52:00 EST 2020
[ https://issues.redhat.com/browse/DROOLS-5023?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Toshiya Kobayashi updated DROOLS-5023:
--------------------------------------
Description:
With a rule like this, (see that white spaces around "==" in the second rule 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.
was:
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.
> 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 white spaces around "==" in the second rule 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