use of org.apache.syncope.common.rest.api.service.WorkflowService in project syncope by apache.
the class WorkflowRestClient method getDiagram.
public byte[] getDiagram(final String key) {
WorkflowService service = getService(WorkflowService.class);
WebClient.client(service).accept(RESTHeaders.MEDIATYPE_IMAGE_PNG);
Response response = service.exportDiagram(AnyTypeKind.USER.name(), key);
byte[] diagram;
try {
diagram = IOUtils.readBytesFromStream((InputStream) response.getEntity());
} catch (Exception e) {
LOG.error("Could not get workflow diagram", e);
diagram = new byte[0];
}
return diagram;
}
Aggregations