-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
None
-
-
-
NEW
-
NEW
-
---
-
---
Building a rule written in MVEL dialect like (*1) in executable rule model, the order of the statements described in action (then) part of the rule changes after model generation like (*2). The generated code looks like that all statements outside the modify blocks come first, followed by all statements inside the modify blocks, and finally update statements for the modified properties are called together. The original order of the statements in action part should keep after model generation.
(*1)
package com.example.reproducer dialect "mvel" rule "rule14a" when $manufacturer : Manufacturer() $model : Model( manufacturer == $manufacturer ) $car : Car( model == $model ) then System.out.println("***** Action of rule14a"); modify($model) { count = $model.count + 1 } System.out.println("$model = " + $model + ", count = " + $model.count); modify($manufacturer) { totalCount = $manufacturer.totalCount + 1 } System.out.println("$manufacturer = " + $manufacturer + ", totalCount = " + $manufacturer.totalCount); end
(*2) LambdaConsequence<hash>.java generated from the action (then) part of the rule.
@Override() public void execute(org.drools.model.Drools drools, com.example.reproducer.Model $model, com.example.reproducer.Manufacturer $manufacturer) throws java.lang.Exception { System.out.println("***** Action of rule14a"); System.out.println("$model = " + $model + ", count = " + $model.getCount()); System.out.println("$manufacturer = " + $manufacturer + ", totalCount = " + $manufacturer.getTotalCount()); $model.setCount($model.getCount() + 1); $manufacturer.setTotalCount($manufacturer.getTotalCount() + 1); drools.update($model, mask_$model); drools.update($manufacturer, mask_$manufacturer); }
- clones
-
RHDM-1548 Order of statements described in rule action part does not keep after model generation in executable model.
- Closed