Bug 1059478

Summary: jcr2Vfs migration tool does not correctly transform tech and biz rules
Product: [Retired] JBoss BRMS Platform 6 Reporter: jbride <jbride>
Component: Migration ToolAssignee: Neus Miras <nmirasch>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Široký <psiroky>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: kverlaen, psiroky, rrajasek, vigoyal
Target Milestone: ER1   
Target Release: 6.0.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Trying to migrate a BRMS5 rule into BRMS6 using the migration tool causes an error due to incorrect scanning of the rdrl file. This creates an invalid file for import which fails compilation in BRMS6. The issue is seen on rules from BRMS5 which contain an import statement. Cause: Consequence: Fix: Result:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 19:58:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
rdrl with problems none

Description jbride@redhat.com 2014-01-29 22:54:15 UTC
Created attachment 857289 [details]
rdrl with problems

Hi.
  Given this rule that works correctly in BRMS5:

//created on: Sep 6, 2012
import org.acme.insurance.Policy;
import org.acme.insurance.Driver;

rule "pricemultiplevehicles"
	salience -10
	ruleflow-group "total"
    when
        //conditions
        driver: Driver()
        policyM: Policy(policyType=="MASTER", driver==driver, price == 0)
        total : Number(doubleValue > 0)   from accumulate  
			( 	Policy(policyType=="AUTO", driver == driver, p:price)
                             sum( p ) 
			)
    then
        //actions
        modify (policyM) {setPrice(total.intValue())}
end



... the migration tool transforms to the rule attached to this BZ containing structural problems making it unable to compile.

To reproduce the problem, try migrating the repo found here:  http://people.redhat.com/jbride/bldw/policy_quote_scenario_export.zip

.... and take a look at the resulting 'pricemultiplevehicles.rdrl' .

thanks!  jeff

Comment 2 Petr Široký 2014-01-30 16:05:23 UTC
It seems that the technical rules in BRMS 5.x can be saved both with and without the initial "rule" statement (and the "end" statement at the end). The migration tool should scan the DRL and only add the "rule" and "end" if they are missing. Also the import statements should be handled in a right way.

Comment 3 Neus Miras 2014-02-03 17:42:25 UTC
There was a problem related with rules with import statements and the sequence adding imports and adding the package name.
This has been fixed at:

Commit:
6.0.x
https://github.com/droolsjbpm/drools-wb/commit/16848d90aa190b2d989f22a71038bff56d9f8594

Comment 4 Petr Široký 2014-02-20 16:58:09 UTC
Verified fixed in 6.0.1-ER1.