Hi,
I'm trying to clone and WorkflowProcess object but I didn't found any way to do it.
That's because I need to modify a process (adding HT Activities, etc.. through UI) how is associated with each instance on runtime, having as many process as process instances.
I have tested some code like this,
String xml = XmlRuleFlowProcessDumper.INSTANCE.dump(
workflowProcessImpl, true);
WorkflowProcessImpl workflowProcessImpl = readProcessFromXml(xml);
where readProcessFromXml is
SemanticModules modules = new SemanticModules();
modules.addSemanticModule(new ProcessSemanticModule());
XmlProcessReader reader = new XmlProcessReader(modules,
ProcessHelper.class.getClassLoader());
reader.read(new InputStreamReader(new ByteArrayInputStream(xml
.getBytes())));
List<org.drools.definition.process.Process> processes = reader
.getProcess();
WorkflowProcessImpl process = (WorkflowProcessImpl) processes.get(0);
but some process information is lost.
Is there any way to clone a WorkflowProcessImpl object?
Thanks.