if (firstTransition != null) {
res.add(firstTransition);
}
}
StateNode sn = (StateNode) processGraphElements.get(activityName);
ArrayList<StateNode> arrayList = new ArrayList<StateNode>();
Collection<GraphElement> values = processGraphElements.values();
for (GraphElement graphElement : values) {
if(graphElement instanceof StateNode){
arrayList.add((StateNode) graphElement);
}
}
if (sn == null) continue;
sn = sn.cloneNode();
sn.setUnfinished(activity.getEndTime() == null);
sn.setLabel(activityName + ": " + hpi.getDuration() + "ms");
res.add(sn);
//look for transition
TransitionArc ta = (TransitionArc) processGraphElements.get(activityName + "_" + activity.getTransitionName());
if (ta == null) { //look for default!
ta = (TransitionArc) processGraphElements.get("__AWF__default_transition_" + activityName);
}
if (ta == null) {
continue;
}
res.add(ta.cloneNode());
} else {
loger.severe("Unsupported entry: " + hpi);
}
}
addJoinAndForkElements(res,processGraphElements);
HistoryProcessInstanceQuery historyProcessInstanceQuery = processEngine.getHistoryService()
.createHistoryProcessInstanceQuery().processInstanceId(pi.getInternalId());
HistoryProcessInstance historyProcessInstance = historyProcessInstanceQuery.uniqueResult();
if (historyProcessInstance != null && historyProcessInstance.getEndActivityName() != null) {
StateNode sn = (StateNode) processGraphElements.get(historyProcessInstance.getEndActivityName());
if (sn != null) {
StateNode e = sn.cloneNode();
e.setUnfinished(true);
res.add(e);
}
}