HistoricProcessInstance historicProcessInstance = Context
.getCommandContext().getHistoricProcessInstanceEntityManager()
.findHistoricProcessInstance(processInstanceId);
String processDefinitionId = historicProcessInstance
.getProcessDefinitionId();
Graph graph = new ActivitiHistoryGraphBuilder(processInstanceId)
.build();
for (Edge edge : graph.getEdges()) {
drawSequenceFlow(image, processDefinitionId, edge.getName());
}