[jboss-jira] [JBoss JIRA] (DROOLS-702) Rule Inheritance fired the sub rule even the condition doen't match
Davide Sottara (JIRA)
issues at jboss.org
Sun Feb 1 12:42:49 EST 2015
[ https://issues.jboss.org/browse/DROOLS-702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13036648#comment-13036648 ]
Davide Sottara edited comment on DROOLS-702 at 2/1/15 12:42 PM:
----------------------------------------------------------------
Yacine,
"from" leads to this situation:
{code}
$p : Person( ... )
Person( ... ) from $p
{code}
This ensures that both patterns are applied to the same object.
In fact, the second will only be applied id an object passes the first.
unification is effectively an equality constraint:
{code}
$p Person( ... )
Person( this == $p, ... )
{code}
so it may even match two different objects that are equal to each other.
Pick the one that you prefer based on your actual use case
was (Author: dsotty):
Yacine,
"from" leads to this situation:
{code}
$p : Person( ... )
Person( ... ) from $p
{code}
This ensures that both patterns are applied to the same object.
In fact, the second will only be applied id an object passes the first.
unification is effectively an equality constraint:
{code}
$p Person()
Person( this == $p )
{code}
so it may even match two different objects that are equal to each other.
Pick the one that you prefer based on your actual use case
> Rule Inheritance fired the sub rule even the condition doen't match
> -------------------------------------------------------------------
>
> Key: DROOLS-702
> URL: https://issues.jboss.org/browse/DROOLS-702
> Project: Drools
> Issue Type: Bug
> Affects Versions: 6.1.0.Final
> Environment: Windows, Java6.0.29
> Reporter: Yacine Jaber
> Assignee: Davide Sottara
> Priority: Critical
> Attachments: wod-drools-test.7z
>
>
> You can find the attached a simple maven project that shows this error.
> You can run ExampleDrools class as main java application.
> The sub rules are fired even if the condition is not matched.
> There are a work arround by using <from $fact> into a sub rule to avoid firing this one.
> This simple project shows the failed and work arround test.
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)
More information about the jboss-jira
mailing list