09-09-2014 10:37 PM
@RequestMapping("/picture")
public void picture(HttpServletRequest request, HttpServletResponse response)
throws Exception {
String procDefId = request.getParameter("procDefId");
ProcessDefinition procDef = repositoryService
.createProcessDefinitionQuery().processDefinitionId(procDefId)
.singleResult();
String diagramResourceName = procDef.getDiagramResourceName();
InputStream imageStream = repositoryService.getResourceAsStream(
procDef.getDeploymentId(), diagramResourceName);
byte[] data = new byte[imageStream.available()];
imageStream.read(data);
imageStream.close();
response.setContentType("image/png");
OutputStream stream = response.getOutputStream();
stream.write(data);
stream.flush();
stream.close();
}
09-10-2014 10:06 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.