private void initOutput(Operator graphOp) throws GraphException { for (Node node : getGraph().getNodes()) { NodeContext nodeContext = getNodeContext(node); if (nodeContext.isOutput()) { initNodeContext(nodeContext, graphOp); addOutputNodeContext(nodeContext); } } }
private void initNodeContext(final NodeContext nodeContext, Operator graphOp) throws GraphException { if (nodeContext.isInitialized()) { return; } for (NodeSource source : nodeContext.getNode().getSources()) { NodeContext sourceNodeContext = getNodeContext(source.getSourceNode()); Product sourceProduct = null; if (sourceNodeContext != null) { initNodeContext(sourceNodeContext, graphOp); sourceProduct = sourceNodeContext.getTargetProduct(); } else { if (graphOp != null) { sourceProduct = graphOp.getSourceProduct(source.getSourceNodeId()); } } if (sourceProduct == null) { throw new GraphException(getMissingSourceMessage(nodeContext.getNode(), source)); } nodeContext.addSourceProduct(source.getName(), sourceProduct); } Node node = nodeContext.getNode(); DomElement configuration = node.getConfiguration(); OperatorConfiguration opConfiguration = this.createOperatorConfiguration(configuration, new HashMap<String, Object>()); nodeContext.setOperatorConfiguration(opConfiguration); nodeContext.initTargetProduct(); getInitNodeContextDeque().addFirst(nodeContext); }