Skip to content

Commit 3d20489

Browse files
committed
Can't believe I'm still doing this
1 parent eb5fb13 commit 3d20489

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

com.workflowconversion.knime2grid/src/com/workflowconversion/knime2grid/export/node/impl/GenericKnimeNodeConverter.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ public Job convert(final NativeNodeContainer nativeNodeContainer, final Workflow
107107
ctdFound = true;
108108
} else if (element instanceof ParametrizedCommandLineElement && !processedPortNames.contains(element.getKey())) {
109109
// we need to process only true parameters, not flags or option identifiers
110-
final Parameter<?> parameter = nodeConfiguration.getParameter(element.getKey());
110+
Parameter<?> parameter = nodeConfiguration.getParameter(element.getKey());
111+
if (parameter == null) {
112+
parameter = resolveParameter(nodeConfiguration, element.getKey());
113+
}
111114
job.addParameter(element.getKey(), parameter.getStringRep());
112115
} else if (element instanceof CommandLineFile) {
113116
// TODO: this seems to be dead code... only elements in the command line are the CTD and the flag...
@@ -128,6 +131,19 @@ public Job convert(final NativeNodeContainer nativeNodeContainer, final Workflow
128131
return job;
129132
}
130133

134+
// TODO: kind of do this right, I guess... Might be related to CLI sections, not sure, though
135+
private Parameter<?> resolveParameter(final INodeConfiguration nodeConfiguration, final String key) {
136+
// go through all motherfucking parameters and get the most similar one, whatever
137+
for (final String parameterKey : nodeConfiguration.getParameterKeys()) {
138+
// [NodeName].1.[key]
139+
if (parameterKey.endsWith(key)) {
140+
return nodeConfiguration.getParameter(parameterKey);
141+
}
142+
}
143+
144+
throw new ApplicationException("Parameter not found.");
145+
}
146+
131147
private void createInputsAndOutputsFromKnimeWorkflow(final NativeNodeContainer nativeNodeContainer, final WorkflowManager workflowManager,
132148
final INodeConfiguration nodeConfiguration, final Job job, final Set<String> processedPortNames,
133149
final Map<String, com.workflowconversion.knime2grid.model.Port> gknPortToConvertedPort) {

com.workflowconversion.knime2grid/src/com/workflowconversion/knime2grid/ui/wizard/ApplicationSelectionPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public class ApplicationSelectionPage extends WizardPage {
7070
*/
7171
public ApplicationSelectionPage(final Workflow workflow) {
7272
super("com.workflowconversion.knime2grid.ui.wizard.ApplicationSelectionPage", "Configure your jobs",
73-
ImageRepository.getImageDescriptor(SharedImages.Node));
73+
ImageRepository.getImageDescriptor(SharedImages.NewKnimeBig));
7474
Validate.notNull(workflow, "workflow is required and cannot be null");
7575

7676
this.allLocalJobs = workflow.getJobs().toArray(new Job[]{});

0 commit comments

Comments
 (0)