Search in sources :

Example 16 with WorkflowLoadResult

use of org.knime.core.node.workflow.WorkflowPersistor.WorkflowLoadResult in project knime-core by knime.

the class BugAP7806_WorkflowSaveHooks method initWorkflowFromTemp.

private WorkflowLoadResult initWorkflowFromTemp() throws Exception {
    // will save the workflow in one of the test ...don't write SVN folder
    WorkflowLoadResult loadResult = loadWorkflow(m_workflowDir, new ExecutionMonitor());
    setManager(loadResult.getWorkflowManager());
    NodeID baseID = getManager().getID();
    m_jsonInput = new NodeID(baseID, 7);
    return loadResult;
}
Also used : ExecutionMonitor(org.knime.core.node.ExecutionMonitor) WorkflowLoadResult(org.knime.core.node.workflow.WorkflowPersistor.WorkflowLoadResult)

Example 17 with WorkflowLoadResult

use of org.knime.core.node.workflow.WorkflowPersistor.WorkflowLoadResult in project knime-core by knime.

the class WorkflowTestCase method loadWorkflow.

protected WorkflowLoadResult loadWorkflow(final File workflowDir, final ExecutionMonitor exec, final WorkflowLoadHelper loadHelper) throws Exception {
    WorkflowLoadResult loadResult = WorkflowManager.ROOT.load(workflowDir, exec, loadHelper, false);
    WorkflowManager m = loadResult.getWorkflowManager();
    if (m == null) {
        throw new Exception("Errors reading workflow: " + loadResult.getFilteredError("", LoadResultEntryType.Ok));
    } else {
        switch(loadResult.getType()) {
            case Ok:
                break;
            default:
                m_logger.info("Errors reading workflow (proceeding anyway): ");
                dumpLineBreakStringToLog(loadResult.getFilteredError("", LoadResultEntryType.Warning));
        }
    }
    return loadResult;
}
Also used : IOException(java.io.IOException) WorkflowLoadResult(org.knime.core.node.workflow.WorkflowPersistor.WorkflowLoadResult)

Aggregations

WorkflowLoadResult (org.knime.core.node.workflow.WorkflowPersistor.WorkflowLoadResult)17 ExecutionMonitor (org.knime.core.node.ExecutionMonitor)15 File (java.io.File)6 Test (org.junit.Test)6 IOException (java.io.IOException)4 InvalidSettingsException (org.knime.core.node.InvalidSettingsException)2 LoadVersion (org.knime.core.node.workflow.FileWorkflowPersistor.LoadVersion)2 Version (org.knime.core.util.Version)2 FileNotFoundException (java.io.FileNotFoundException)1 ReentrantLock (java.util.concurrent.locks.ReentrantLock)1 AssertionFailedError (junit.framework.AssertionFailedError)1 IStatus (org.eclipse.core.runtime.IStatus)1 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)1 Display (org.eclipse.swt.widgets.Display)1 BeforeClass (org.junit.BeforeClass)1 ReferencedFile (org.knime.core.internal.ReferencedFile)1 CanceledExecutionException (org.knime.core.node.CanceledExecutionException)1 NodeID (org.knime.core.node.workflow.NodeID)1 UnsupportedWorkflowVersionException (org.knime.core.node.workflow.UnsupportedWorkflowVersionException)1 WorkflowContext (org.knime.core.node.workflow.WorkflowContext)1