As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
@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(); }