use of org.knime.core.node.NodeSettings in project knime-core by knime.
the class UngroupNodeModel method saveInternals.
/**
* {@inheritDoc}
*/
@Override
protected void saveInternals(final File nodeInternDir, final ExecutionMonitor exec) throws IOException, CanceledExecutionException {
if (m_enableHilite.getBooleanValue()) {
final NodeSettings config = new NodeSettings("hilite_mapping");
final DefaultHiLiteMapper mapper = (DefaultHiLiteMapper) m_trans.getMapper();
if (mapper != null) {
// the mapper is null if the node produces an empty data table
mapper.save(config);
}
config.saveToXML(new GZIPOutputStream(new FileOutputStream(new File(nodeInternDir, "hilite_mapping.xml.gz"))));
}
}
use of org.knime.core.node.NodeSettings in project knime-core by knime.
the class ValueCounterNodeModel method saveInternals.
/**
* {@inheritDoc}
*/
@Override
protected void saveInternals(final File nodeInternDir, final ExecutionMonitor exec) throws IOException, CanceledExecutionException {
if (m_settings.hiliting()) {
NodeSettings s = new NodeSettings("Hiliting");
((DefaultHiLiteMapper) m_translator.getMapper()).save(s);
File f = new File(nodeInternDir, "Hiliting.conf.gz");
OutputStream out = new GZIPOutputStream(new BufferedOutputStream(new FileOutputStream(f)));
s.saveToXML(out);
out.close();
}
}
use of org.knime.core.node.NodeSettings in project knime-core by knime.
the class EndifNodeModel method saveInternals.
/**
* {@inheritDoc}
*/
@Override
protected void saveInternals(final File nodeInternDir, final ExecutionMonitor exec) throws IOException, CanceledExecutionException {
if (m_enableHiliting) {
final NodeSettings config = new NodeSettings("hilite_mapping");
((DefaultHiLiteMapper) m_hiliteTranslator.getMapper()).save(config);
config.saveToXML(new GZIPOutputStream(new FileOutputStream(new File(nodeInternDir, "hilite_mapping.xml.gz"))));
}
}
use of org.knime.core.node.NodeSettings in project knime-core by knime.
the class TestWorkflowLoopReset method testChangeConfigInExecutedLoop.
@Test
public void testChangeConfigInExecutedLoop() throws Exception {
NodeSettings s = new NodeSettings("groupByModel");
WorkflowManager m = getManager();
m.saveNodeSettings(m_groupByInLoopNode3, s);
executeAllAndWait();
m.loadNodeSettings(m_groupByInLoopNode3, s);
checkState(m_groupByInLoopNode3, InternalNodeContainerState.CONFIGURED);
checkState(m_loopEndNode4, InternalNodeContainerState.CONFIGURED);
checkState(m_loopStartNode2, InternalNodeContainerState.CONFIGURED);
}
use of org.knime.core.node.NodeSettings in project knime-core by knime.
the class TestWizardExec_Loop_Simple method testWizardStepThrough.
@Test
public void testWizardStepThrough() throws Exception {
final WorkflowManager wfm = getManager();
assertTrue("should have new wizard execution", WebResourceController.hasWizardExecution(wfm));
checkState(m_tableCreateNode1, InternalNodeContainerState.CONFIGURED);
WizardExecutionController wizardController = wfm.getWizardExecutionController();
wizardController.stepFirst();
waitWhile(wfm, new WizardHold(wfm));
assertTrue("should have steps", wizardController.hasCurrentWizardPage());
checkState(m_subnodeQueryStringBool15, InternalNodeContainerState.EXECUTED);
// outside loop
WizardPageContent currentWizardPage = wizardController.getCurrentWizardPage();
// TODO: load something real
wizardController.loadValuesIntoCurrentPage(Collections.<String, String>emptyMap());
// TODO check IDs
// assertEquals(m_subnodeQueryStringBool15.toString(), currentWizardPage.getPageNodeID());
wizardController.stepNext();
waitWhile(wfm, new WizardHold(wfm));
checkState(wfm, InternalNodeContainerState.CONFIGURED_MARKEDFOREXEC, InternalNodeContainerState.UNCONFIGURED_MARKEDFOREXEC);
checkState(m_subnodeQueryStringBool15, InternalNodeContainerState.EXECUTED);
checkState(m_subnodeInLOOPQueryInt14, InternalNodeContainerState.EXECUTED);
assertTrue("should have steps (loop iteration 0)", wizardController.hasCurrentWizardPage());
// inside loop 1st time
currentWizardPage = wizardController.getCurrentWizardPage();
// assertEquals(m_subnodeInLOOPQueryInt14.toString(), currentWizardPage.getPageNodeID());
wizardController.stepNext();
waitWhile(wfm, new WizardHold(wfm));
checkState(m_subnodeInLOOPQueryInt14, InternalNodeContainerState.EXECUTED);
checkState(m_loopEnd11, InternalNodeContainerState.CONFIGURED_MARKEDFOREXEC);
assertTrue("should have steps (loop iteration 1)", wizardController.hasCurrentWizardPage());
// inside loop 2nd time
currentWizardPage = wizardController.getCurrentWizardPage();
// assertEquals(m_subnodeInLOOPQueryInt14.toString(), currentWizardPage.getPageNodeID());
wizardController.stepNext();
waitWhile(wfm, new WizardHold(wfm));
assertFalse("should have no more pages", wizardController.hasCurrentWizardPage());
checkState(wfm, InternalNodeContainerState.EXECUTED);
NodeSettings settings = new NodeSettings("test");
wizardController.save(settings);
int[] prompted = settings.getIntArray("promptedSubnodeIDs");
assertTrue("should have saved prompted node ids (15) to settings", Arrays.equals(new int[] { 15 }, prompted));
}
Aggregations