Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ public class PipelineExecutorDialog extends BaseTransformDialog {

private static final int FIELD_DESCRIPTION = 1;
private static final int FIELD_NAME = 2;
private static final String CONST_ERROR_LOADING_SPECIFIED_PIPELINE_TITLE =
"PipelineExecutorDialog.ErrorLoadingSpecifiedPipeline.Title";
private static final String CONST_ERROR_LOADING_SPECIFIED_PIPELINE_MESSAGE =
"PipelineExecutorDialog.ErrorLoadingSpecifiedPipeline.Message";
private static final String CONST_FILENAME_MISSING_MESSAGE =
"PipelineExecutorDialog.FilenameMissing.Message";

private PipelineExecutorMeta pipelineExecutorMeta;

Expand Down Expand Up @@ -377,15 +383,11 @@ public void getData() {
List<String> runConfigurations =
metadataProvider.getSerializer(PipelineRunConfiguration.class).listObjectNames();

try {
ExtensionPointHandler.callExtensionPoint(
HopGui.getInstance().getLog(),
variables,
HopExtensionPoint.HopGuiRunConfiguration.id,
new Object[] {runConfigurations, PipelineMeta.XML_TAG});
} catch (HopException e) {
// Ignore errors
}
ExtensionPointHandler.callExtensionPoint(
HopGui.getInstance().getLog(),
variables,
HopExtensionPoint.HopGuiRunConfiguration.id,
new Object[] {runConfigurations, PipelineMeta.XML_TAG});

wRunConfiguration.setItems(runConfigurations.toArray(new String[0]));
wRunConfiguration.setText(Const.NVL(pipelineExecutorMeta.getRunConfigurationName(), ""));
Expand All @@ -406,7 +408,7 @@ public void getData() {
LogChannel.UI.logError("Error getting pipeline run configurations", e);
}

// TODO: throw in a separate thread.
// throw in a separate thread.
//
try {
String[] prevTransforms = pipelineMeta.getTransformNames();
Expand Down Expand Up @@ -495,7 +497,7 @@ public void getData() {

try {
loadPipeline();
} catch (Throwable t) {
} catch (HopException t) {
// Ignore errors
}

Expand Down Expand Up @@ -624,6 +626,9 @@ protected void getParametersFromPipeline() {
// Load the specified pipeline metadata in executorPipelineMeta
//
loadPipeline();
if (executorPipelineMeta == null) {
throw new HopException(BaseMessages.getString(PKG, CONST_FILENAME_MISSING_MESSAGE));
}
String[] parameters = executorPipelineMeta.listParameters();
for (String name : parameters) {
TableItem item = new TableItem(wPipelineExecutorParameters.table, SWT.NONE);
Expand All @@ -636,9 +641,8 @@ protected void getParametersFromPipeline() {
} catch (Exception e) {
new ErrorDialog(
shell,
BaseMessages.getString(PKG, "PipelineExecutorDialog.ErrorLoadingSpecifiedPipeline.Title"),
BaseMessages.getString(
PKG, "PipelineExecutorDialog.ErrorLoadingSpecifiedPipeline.Message"),
BaseMessages.getString(PKG, CONST_ERROR_LOADING_SPECIFIED_PIPELINE_TITLE),
BaseMessages.getString(PKG, CONST_ERROR_LOADING_SPECIFIED_PIPELINE_MESSAGE),
e);
}
}
Expand All @@ -651,6 +655,9 @@ protected void mapFieldsToPipelineParameters() {
String[] inputFieldNames = inputFields.getFieldNames();

loadPipeline();
if (executorPipelineMeta == null) {
throw new HopException(BaseMessages.getString(PKG, CONST_FILENAME_MISSING_MESSAGE));
}
String[] parameters = executorPipelineMeta.listParameters();

// Get the current mapping...
Expand Down Expand Up @@ -687,8 +694,8 @@ protected void mapFieldsToPipelineParameters() {
} catch (Exception e) {
new ErrorDialog(
shell,
BaseMessages.getString(PKG, "WorkflowExecutorDialog.ErrorLoadingSpecifiedJob.Title"),
BaseMessages.getString(PKG, "WorkflowExecutorDialog.ErrorLoadingSpecifiedJob.Message"),
BaseMessages.getString(PKG, CONST_ERROR_LOADING_SPECIFIED_PIPELINE_TITLE),
BaseMessages.getString(PKG, CONST_ERROR_LOADING_SPECIFIED_PIPELINE_MESSAGE),
e);
}
}
Expand Down Expand Up @@ -1152,8 +1159,7 @@ private void ok() {
if (Utils.isEmpty(wPath.getText())) {
MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
mb.setText(BaseMessages.getString(PKG, "PipelineExecutorDialog.FilenameMissing.Header"));
mb.setMessage(
BaseMessages.getString(PKG, "PipelineExecutorDialog.FilenameMissing.Message"));
mb.setMessage(BaseMessages.getString(PKG, CONST_FILENAME_MISSING_MESSAGE));
mb.open();
return;
}
Expand All @@ -1171,10 +1177,8 @@ private void ok() {
} catch (HopException e) {
new ErrorDialog(
shell,
BaseMessages.getString(
PKG, "PipelineExecutorDialog.ErrorLoadingSpecifiedPipeline.Title"),
BaseMessages.getString(
PKG, "PipelineExecutorDialog.ErrorLoadingSpecifiedPipeline.Message"),
BaseMessages.getString(PKG, CONST_ERROR_LOADING_SPECIFIED_PIPELINE_TITLE),
BaseMessages.getString(PKG, CONST_ERROR_LOADING_SPECIFIED_PIPELINE_MESSAGE),
e);
}
}
Expand Down
Loading