10-26-2015 01:25 PM
ObjectMapper mapper = new ObjectMapper();
BpmnJsonConverter converter = new BpmnJsonConverter();
JsonNode procDefJson = mapper.readTree(processDefJson.toString());
BpmnModel procDefModel = converter.convertToBpmnModel(procDefJson);
//getting the process instance history
JsonObject jsonRequest = new JsonObject();
jsonRequest.addProperty("processInstanceId", processInstanceId);
Representation requestBodyObject = new StringRepresentation(jsonRequest.toString(), MediaType.APPLICATION_JSON);
Representation resource = WorkflowUtils.getClientResource("query/historic-activity-instances").post(requestBodyObject);
JsonObject processHistoryJson = WorkflowUtils.getAsJsonElement(resource).getAsJsonObject();
JsonArray processHistory = processHistoryJson.get("data").getAsJsonArray();
List<String> highLightedActivities = Lists.newArrayList();
List<String> highLightedFlows = Lists.newArrayList();
for(JsonElement element : processHistory) {
highLightedActivities.add(element.getAsJsonObject().get("id").getAsString());
}
ProcessDiagramGenerator processDiagramGenerator = new DefaultProcessDiagramGenerator();
InputStream generatedDiagram = processDiagramGenerator.generateDiagram(procDefModel, "png", highLightedActivities, highLightedFlows);
10-28-2015 03:14 PM
10-29-2015 05:34 AM
11-03-2015 07:16 AM
11-04-2015 03:13 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.