Bug 1059478 - jcr2Vfs migration tool does not correctly transform tech and biz rules
Summary: jcr2Vfs migration tool does not correctly transform tech and biz rules
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Migration Tool
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER1
: 6.0.1
Assignee: Neus Miras
QA Contact: Petr Široký
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-29 22:54 UTC by jbride@redhat.com
Modified: 2014-08-06 19:58 UTC (History)
4 users (show)

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:
Clone Of:
Environment:
Last Closed: 2014-08-06 19:58:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
rdrl with problems (46.94 KB, image/png)
2014-01-29 22:54 UTC, jbride@redhat.com
no flags Details

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.


Note You need to log in before you can comment on or make changes to this bug.