Using Drools 4.x RuleFlow Processes

The XML format that was used in Drools4 to store RuleFlow processes was generated automatically, using XStream. As a result, it was hard to read by human readers and difficult to maintain and extend. The new Drools Flow XML format has been created to simplify this. This however means that, by default, old RuleFlow processes cannot simply be executed on the Drools5 engine.

We do however provide a Rule Flow Migrator that allows you to transform your old .rf file to the new format. It uses an XSLT transformation to generate the new XML based on the old content. You can use this class to manually transform your old processes to the new format once when upgrading from Drools4.x to Drools5.x. You can however also let the KnowledgeBuilder automatically upgrade your processes to the new format when they are loaded into the Knowledge Base. While this requires a conversion every time the process is loaded into the Knowledge Base, it does support a more seamless upgrade. To enact this automatic upgrade you need to set the "drools.ruleflow.port" system property to "true", for example by adding -Ddrools.ruleflow.port=true when starting your application, or by calling System.setProperty("drools.ruleflow.port", "true").

The Drools Eclipse plugin also automatically detects if an old RuleFlow file is opened. At that point, it will automatically perform the conversion and show the result in the graphical editor. You then need to save this result, either in a new file or overwriting the old one, to retain the old process in the new format. Note that the plugin does not support editing and saving processes in the old Drools4.x format.