{
InputStreamReader isr = new InputStreamReader(is);
KnowledgeBuilderConfigurationImpl configuration = new KnowledgeBuilderConfigurationImpl();
SemanticModules modules = configuration.getSemanticModules();
modules.addSemanticModule(new ProcessSemanticModule());
XmlProcessReader xmlReader = new XmlProcessReader( modules, Thread.currentThread().getContextClassLoader() );
//Migrate v4 ruleflows to v5
Reader reader = null;
try
{
String xml = RuleFlowMigrator.convertReaderToString(isr);
if (RuleFlowMigrator.needToMigrateRFM(xml))
{
xml = RuleFlowMigrator.portRFToCurrentVersion(xml);
MessageDialog.openInformation(this.getSite().getShell(),
"Incompatible RuleFlow Version",
"WARNING! The selected RuleFlow is Drools version 4 format.\n\n" +
"Any changes made to this RuleFlow will be saved in Drools 5 format, which is " +
"not compatible with Drools 4. To convert this RuleFlow " +
"to Drools 5 format, select Save As from the File menu and overwrite this " +
"file - the new RuleFlow file will be saved in Drools 5 format.");
}
reader = new StringReader(xml);
List<Process> processes = xmlReader.read(reader);
if (processes == null || processes.size() == 0) {
setModel(createModel());
} else {
RuleFlowProcess process = (RuleFlowProcess) processes.get(0);
if (process == null) {