12-20-2013 09:56 AM
BpmnModel model = new BpmnModel();
Process process;
try {
XMLInputFactory xif = XMLInputFactory.newInstance();
XMLStreamReader xtr = null;
InputStreamReader in = new InputStreamReader(getClass().getClassLoader().getResourceAsStream("myprocess.bpmn20.xml"), "UTF-8");
xtr = xif.createXMLStreamReader(in);
process = new ProcessParser().parse(xtr, model);
// I can modify here my process and add the TaskListeners
for (UserTask userTask : process.findFlowElementsOfType(UserTask.class)) {
// Add the listener, but how?
}
} catch (Exception e) {
throw new RuntimeException("Could create process from xml.", e);
}
String deploymentId = repositoryService
.createDeployment()
.addBpmnModel("dynamic-model.bpmn", model).name("Dynamic process deployment.")
.deploy()
.getId();
The two issue with this way is that 12-23-2013 06:37 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.