[jboss-jira] [JBoss JIRA] (DROOLS-1737) Rule is ignored after migration from 6.5.0.Final to 7.2.0.Final
Nikolay Plekhanov (JIRA)
issues at jboss.org
Wed Sep 20 09:36:01 EDT 2017
[ https://issues.jboss.org/browse/DROOLS-1737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13466322#comment-13466322 ]
Nikolay Plekhanov commented on DROOLS-1737:
-------------------------------------------
It helped, thank you!
> 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