The Drools Update tools is a simple program to help with the upgrade of DRL files from Drools 3.0.x to Drools 4.0.x.
Currently its main purpose is to upgrade the memory action calls from 3.0.x to 4.0.x, but future versions will conver additional scenarios. It is important to note that it does not perform a simple search and replace in the rules file, but parses the rules file to ensure it is not doing anything unexpected. For this reason it is a safe tool to use for upgrade large sets of rule files.
The drools update tool can be found as a maven project in the following Subversion source repository http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/experimental/drools-update/
To build the update tool:
Checkout the Drools Update Tool Maven project from its Subversion repository:
$ svn co http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/experimental/drools-update
execute the maven clean install action with the project's pom.xml file
$ mvn clean install
After you resolve any class path dependencies you are able to run the tool with the following command:
java -cp $CLASSPATH org.drools.tools.update.UpdateTool -f <filemask> [-d <basedir>] [-s <suffix>]
The program parameters are very easy to understand as following.
-h,--help, Shows a very simple list the usage help
-d your source base directory
-f pattern for the files to be updated. The format is the same as used by ANT: * = single file, directory ** = any level of subdirectories EXAMPLE: src/main/resources/**/*.drl = matches all DRL files inside any subdirectory of /src/main/resources
-s, --suffix, The suffix to be added to all updated files