private void unwire(Operator op, boolean recursive) throws PortException { op.getOutputPorts().disconnectAll(); if (recursive) { if (op instanceof OperatorChain) { for (ExecutionUnit subprocess : ((OperatorChain) op).getSubprocesses()) { subprocess.unwire(recursive); } } } }
/** * Connects the ports automatically in a first-fit approach. Operators are connected in their * ordering within the {@link #operators} list. Every input of every operator is connected to the * first compatible output of an operator "left" of this operator. This corresponds to the way, * IOObjects were consumed in the pre-5.0 version. Disabled operators are skipped. <br> * * @param level If level is {@link CompatibilityLevel#VERSION_5}, an input is considered * compatible only if it satisfies all meta data constraints. For {@link * CompatibilityLevel#PRE_VERSION_5} we only consider the classes. * @param keepConnections if true, don't unwire old connections before rewiring. */ public void autoWire(CompatibilityLevel level, boolean keepConnections, boolean recursive) throws PortException { if (!keepConnections) { unwire(recursive); } // store all outputs. Scan them to find matching inputs. LinkedList<OutputPort> readyOutputs = new LinkedList<OutputPort>(); addReadyOutputs(readyOutputs, getInnerSources()); List<Operator> enabled = new LinkedList<Operator>(); for (Operator op : getOperators()) { if (op.isEnabled()) { enabled.add(op); } } autoWire(level, enabled, readyOutputs, recursive, true); }
private void unwire(boolean recursive) { getInnerSources().disconnectAll(); for (Operator op : getOperators()) { unwire(op, recursive); } }