org.drools.guvnor.server.repository
Class MigrateRepository

java.lang.Object
  extended by org.drools.guvnor.server.repository.MigrateRepository

public class MigrateRepository
extends Object

This class is used to migrate version 4 ruleflow assets in a version 4 or 5 drools repository into version 5 ruleflow assets. IMPORTANT: the current code only performs the transformations if the Drools system property drools.ruleflow.port is true, just as the drools compiler only transforms version 4 ruleflows to 5 if this property is set.

If a ruleflow is migrated, it is checked in as new version so that the previous version is preserved. The current code checks-in the new version as the admin user with an appropriate comment indicating that the flow has been migrated. Hover, the code could also be changed to check-in each migrated ruleflow using the credentials of the last person to check-in the ruleflow, however, in future there may be a danger that the person who last checked in the file may have lost privileges to check-in the file, so we use the admin user for now.


Constructor Summary
MigrateRepository()
           
 
Method Summary
static void migrateRuleflows(RulesRepository repo)
          ********************************************************************** Iterates through all the packages in the given repository migrating all drools 4 .rfm and .rf ruleflow assets that need to be migrated to 5.
static boolean needsRuleflowMigration(RulesRepository repo)
          ********************************************************************** Returns true if the drools system property drools.ruleflow.port is true indicating that ruleflow migration should be performed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MigrateRepository

public MigrateRepository()
Method Detail

needsRuleflowMigration

public static boolean needsRuleflowMigration(RulesRepository repo)
                                      throws javax.jcr.RepositoryException
********************************************************************** Returns true if the drools system property drools.ruleflow.port is true indicating that ruleflow migration should be performed.

Parameters:
repo -
Returns:
true if the drools system property drools.ruleflow.port is true indicating that ruleflow migration should be performed.
Throws:
javax.jcr.RepositoryException - **********************************************************************

migrateRuleflows

public static void migrateRuleflows(RulesRepository repo)
                             throws javax.jcr.RepositoryException
********************************************************************** Iterates through all the packages in the given repository migrating all drools 4 .rfm and .rf ruleflow assets that need to be migrated to 5. Note that archived assets, and assets in snapshots are also migrated.

Parameters:
repo -
Throws:
javax.jcr.RepositoryException - **********************************************************************


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.