[jboss-jira] [JBoss JIRA] (DROOLS-1737) Rule is ignored after migration from 6.5.0.Final to 7.2.0.Final
Mario Fusco (JIRA)
issues at jboss.org
Wed Sep 20 06:58:00 EDT 2017
[ https://issues.jboss.org/browse/DROOLS-1737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mario Fusco resolved DROOLS-1737.
---------------------------------
Resolution: Rejected
This is not a bug but the consequence of having enabled by default property reactivity in drools 7.x. See http://docs.jboss.org/drools/release/7.0.0.Final/drools-docs/html_single/#_property_reactivity_enabled_by_default
In your case you probably may want to disable it. In fact if you (for instance) add the following to your main class also drools 7.2.0 will work as you expect.
{code}
System.setProperty( "drools.propertySpecific", "ALLOWED" );
{code}
> Rule is ignored after migration from 6.5.0.Final to 7.2.0.Final
> ---------------------------------------------------------------
>
> Key: DROOLS-1737
> URL: https://issues.jboss.org/browse/DROOLS-1737
> Project: Drools
> Issue Type: Bug
> Reporter: Nikolay Plekhanov
> Assignee: Mario Fusco
> Attachments: drools720issue.zip
>
>
> We are trying to migrate project on newest version of drools, but had regression testing failure. We have extracted simplest scenario to reproduce it.
> {code}
> package demo
> import demo.DataRow;
> import demo.ExpectedError;
> import demo.Dark;
> rule "rule-1"
> salience 130
> no-loop true
> when
> $a: DataRow(viewId == Dark.Xantor.$ID, $d: row[Dark.Xantor.wand] != null)
> $b: DataRow(viewId == Dark.Aragorn.$ID, row[Dark.Aragorn.sword] == $d)
> $c: DataRow(viewId == Dark.Tant.$ID, row[Dark.Tant.crown] == $d)
> then
> $a.setField(Dark.Xantor.sword, $c.getField(Dark.Tant.sword));
> $a.setField(Dark.Xantor.chainmail, $c.getField(Dark.Tant.tower));
> update($a);
> end
> rule "rule-2"
> salience 110
> no-loop true
> when
> $a: DataRow(viewId == Dark.Xantor.$ID,
> $b: row[Dark.Xantor.wand] != null,
> row[Dark.Xantor.sword] == "claymore",
> row[Dark.Xantor.bow] == null)
> then
> throw new ExpectedError();
> end
> {code}
> initial facts:
> {code}
> Dark.Tant( crown: 123, sword: claymore )
> Dark.Aragorn( sword: 123 )
> Dark.Xantor( wand: 123 )
> {code}
> Expected to catch ExpectedError (rule-2 to be fired), but nothing happens.
> Detailed exploit attached as Maven project with two executable modules. Main650 class demonstrates positive scenario (it run rules with 6.5.0.Final), Main720 (runs the same rules with 7.2.0.Final) - negative. "Main" class contains basic scenario without link to drools version
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
More information about the jboss-jira
mailing list