use of org.knime.core.node.workflow.WorkflowPersistor.NodeFactoryUnknownException in project knime-core by knime.
the class FileNativeNodeContainerPersistor method preLoadNodeContainer.
/**
* {@inheritDoc}
*/
@Override
public void preLoadNodeContainer(final WorkflowPersistor parentPersistor, final NodeSettingsRO parentSettings, final LoadResult result) throws InvalidSettingsException, IOException {
super.preLoadNodeContainer(parentPersistor, parentSettings, result);
m_parentPersistor = parentPersistor;
NodeSettingsRO settings = getNodeSettings();
String error;
NodeAndBundleInformation nodeInfo;
try {
nodeInfo = loadNodeFactoryInfo(parentSettings, settings);
} catch (InvalidSettingsException e) {
setDirtyAfterLoad();
throw e;
}
NodeSettingsRO additionalFactorySettings;
try {
additionalFactorySettings = loadAdditionalFactorySettings(settings);
} catch (Exception e) {
error = "Unable to load additional factory settings for \"" + nodeInfo + "\"";
setDirtyAfterLoad();
throw new InvalidSettingsException(error, e);
}
NodeFactory<NodeModel> nodeFactory;
try {
nodeFactory = loadNodeFactory(nodeInfo.getFactoryClass());
} catch (Exception e) {
// setDirtyAfterLoad(); // don't set dirty, missing node placeholder will be used instead
throw new NodeFactoryUnknownException(nodeInfo, additionalFactorySettings, e);
}
try {
if (additionalFactorySettings != null) {
nodeFactory.loadAdditionalFactorySettings(additionalFactorySettings);
}
} catch (Exception e) {
error = "Unable to load additional factory settings into node factory (node \"" + nodeInfo + "\")";
getLogger().error(error);
throw new NodeFactoryUnknownException(error, nodeInfo, additionalFactorySettings, e);
}
m_nodeAndBundleInformation = nodeInfo;
m_node = new Node(nodeFactory);
}
Aggregations