Shahad Ahmed wrote:
Okay, I've figured this out. There is a bug in the Guvnor that means it cannot open or perform operations on version 4 ruleflow assets in an v4 repository that was migrated to version 5 by the Guvnor. I've raised this as a JIRA  JBRULES-1945 and attached a patch to the JIRA. The patch also allows you to open, view and edit version 4 .rf (graphical) ruleflow files using the V5 Eclipse plugin, and also open v4 .rfm assets in the Guvnor. One of the classes in the patch (RuleFlowMigrator) can also be used as a command line application to migrate version 4 .rf files to version 5 if required.
I know kris added a patch to load v4 rulelfows, but I guess guvnor isn't aware of the properties switch that needs to be applied. We'll review your patch asap.

Thanks

Mark

Regards
Shahad


On Mon, Jan 12, 2009 at 11:10 AM, Shahad Ahmed <shahad.ahmed2@gmail.com> wrote:
Does anyone know if there is a way of specifying that the Guvnor 5.0M4 should migrate ruleflows from version 4.0 to 5.0 when importing a version 4.0 repository into the Guvnor, or is this bug/oversight in the Guvnor?

I'm trying to import a drools 4.0.7 repository into Guvnor 5.0M4 – the repository was originally exported out of a drools 4.0.7 BRMS (i.e. in XML format). However, when I try and build a package containing a ruleflow in the imported repository it fails, but the same repository builds under the drools 4.0.7 BRMS. Packages without ruleflows build okay, so it looks as if the failure has to do with the ruleflows in packages.

I know that drools 4 ruleflows are not compatible with drools 5 ruleflows, and that there's a drools property that allows the compiler to automatically migrate ruleflows from 4.0 to 5.0. I had assumed the Guvnor applies this migration as I see the following in the log when I import the repository, but a quick look at code in the drools trunk suggests that this migration simply changes version numbers in the repository, but does not migrate the ruleflows:

17:27:59,931 INFO  [STDOUT] AUTO MIGRATION: Performing drools.package migration.
17:28:00,369 INFO  [STDOUT] AUTO MIGRATION: drools.package migration completed.

The reason I suspect it's something to do with ruleflows is that when I try and do anything with the ruleflow assets in the Guvnor, I see the following error:

17:30:40,634 INFO  [STDOUT] (null: 1, 59): cvc-elt.1: Cannot find the declaratio
n of element 'org.drools.ruleflow.core.impl.RuleFlowProcessImpl'.

When I try and build a package with a ruleflow I see the following error in the log:

Caused by: java.lang.NullPointerException
        at org.drools.compiler.ProcessBuilder.buildProcess(ProcessBuilder.java:9
9)
        at org.drools.compiler.ProcessBuilder.addProcessFromFile(ProcessBuilder.
java:228)
        at org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.j
ava:435)
        at org.drools.compiler.PackageBuilder.addRuleFlow(PackageBuilder.java:40
7)
        at org.drools.guvnor.server.contenthandler.RuleFlowHandler.compile(RuleF
lowHandler.java:108)
        at org.drools.guvnor.server.builder.ContentPackageAssembler.buildAsset(C
ontentPackageAssembler.java:167)
        at org.drools.guvnor.server.builder.ContentPackageAssembler.buildPackage
(ContentPackageAssembler.java:154)
        at org.drools.guvnor.server.builder.ContentPackageAssembler.<init>(Conte
ntPackageAssembler.java:103)
        at org.drools.guvnor.server.builder.ContentPackageAssembler.<init>(Conte
ntPackageAssembler.java:116)
        at org.drools.guvnor.server.ServiceImplementation.buildPackage(ServiceIm
plementation.java:1370)
        at org.drools.guvnor.server.ServiceImplementation.buildPackage(ServiceIm
plementation.java:1354) 

Regards
Shahad



_______________________________________________ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users