use of org.knime.core.util.CheckedExceptionBiConsumer in project knime-core by knime.
the class WorkflowManager method setInputNodes.
/**
* Counterpart to {@link #getInputNodes()} - it sets new values into input nodes on the root level. All nodes as per
* map argument will be reset as part of this call.
*
* @param input a map from node's parameter name to its (JSON or string object value). Invalid entries cause an
* exception.
* @throws InvalidSettingsException If parameter name is not valid or a not uniquely defined in the workflow.
* @since 2.12
*/
public void setInputNodes(final Map<String, ExternalNodeData> input) throws InvalidSettingsException {
final CheckedExceptionBiConsumer<InputNode, ExternalNodeData, InvalidSettingsException> validateParamValue = (n, v) -> {
if (n.isInputDataRequired() && v == null) {
throw new InvalidSettingsException("An input for parameter '" + n.getInputData().getID() + "' is required.");
}
n.validateInputData(v);
};
setExternalParameterValues(input, InputNode.class, i -> i.getInputData().getID(), validateParamValue, (n, v) -> n.setInputData(v), true, true);
}
Aggregations