public NodeLevelMap apply(ValueStreamMap valueStreamMap) { Node rootNode = valueStreamMap.getCurrentPipeline() != null ? valueStreamMap.getCurrentPipeline() : valueStreamMap.getCurrentMaterial(); rootNode.setLevel(0); if (!rootNode.getParents().isEmpty()) { assignLevelsToDependencies(rootNode, new Upstream()); } if (!rootNode.getChildren().isEmpty()) { assignLevelsToDependencies(rootNode, new Downstream()); } return levelToNodesMap(valueStreamMap); }
@Override public List<Node> getRelatedNodes(Node node) { return node.getChildren(); }