emailNodes = Maps.newHashMap();
build(flow.getStartPoint());
}
private OperationWrapperNode build(OperationWrapper op) {
OperationWrapperNode opNode = operationNodes.get(op);
if (opNode != null) {
return opNode;
}
opNode = createOperationNode(op);
if (startNode == null) {
startNode = opNode;
}
for (Route out : op.getOutgoingRoutes()) {
OperationActivityWrapper next = out.getTo();
AbstractGraphNode nextNode = null;
if (next instanceof OperationWrapper) {
nextNode = build((OperationWrapper) next);
} else if (next instanceof EmailWrapper) {
EmailWrapperNode emailNode = getEmailNodeFor((EmailWrapper) next);
emailNodes.put(emailNode.getDataObject(), emailNode);
nextNode = emailNode;
}
opNode.addOutgoingRoute(out, nextNode);
}
return opNode;
}