07-07-2014 10:06 AM
ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity)
((RepositoryServiceImpl) activiti.getRepositoryService()).getDeployedProcessDefinition(instance
.getProcessDefinitionId());
if (processDefinition != null && processDefinition.isGraphicalNotationDefined()) {
InputStream in = ProcessDiagramGenerator.generateDiagram(activiti.getRepositoryService().getBpmnModel(instance.getProcessDefinitionId()), "png",
activiti.getRuntimeService().getActiveActivityIds(instance.getId()));
try {
OutputStream out = new FileOutputStream(new File("d:\\Diagram.png"));
IOUtils.copy(in, out);
in.close();
out.flush();
out.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
InputStreamReader reader = new InputStreamReader(in);
OutputStream out = new FileOutputStream(new File("d:\\Diagram.png"));
IOUtils.copy(reader, out,"utf-8");
07-08-2014 10:43 PM
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.