diff --git a/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/javascript.adoc b/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/javascript.adoc index 955ceaacc9..54516c718e 100644 --- a/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/javascript.adoc +++ b/docs/hop-user-manual/modules/ROOT/pages/pipeline/transforms/javascript.adoc @@ -106,7 +106,7 @@ The available constants are: * SKIP_PIPELINE: Excludes the current row from the output row set and continues processing on the next row. * ERROR_PIPELINE: Excludes the current row from the output row set, generates an error, and any remaining rows are not processed. * CONTINUE_PIPELINE: Includes the current row in the output row set. -* ABORT_PIPELINE: Excludes the current row from the output row set, and any remaining rows are not processed, but does not generate an error. (This constant does not display in the transform dialog, but can be used in your script) +* ABORT_PIPELINE: Excludes the current row from the output row set, and any remaining rows are not processed, but does not generate an error. Transform Functions:: String, numeric, date, logic, special, and file functions you can use in scripts. These included functions are implemented in Java and execute faster than JavaScript functions. Each function has a sample script demonstrating its use. Double-click the function to add it to the Javascript pane. Right-click and choose Sample to add the sample to the Javascript pane. diff --git a/plugins/transforms/javascript/src/main/java/org/apache/hop/pipeline/transforms/javascript/ScriptValues.java b/plugins/transforms/javascript/src/main/java/org/apache/hop/pipeline/transforms/javascript/ScriptValues.java index 6ae186a23f..abc5385672 100644 --- a/plugins/transforms/javascript/src/main/java/org/apache/hop/pipeline/transforms/javascript/ScriptValues.java +++ b/plugins/transforms/javascript/src/main/java/org/apache/hop/pipeline/transforms/javascript/ScriptValues.java @@ -45,12 +45,22 @@ public class ScriptValues extends BaseTransform { private static final Class PKG = ScriptValuesMeta.class; + /** Excludes the current row from the output row set and continues processing on the next row. */ public static final int SKIP_PIPELINE = 1; + /** + * Excludes the current row from the output row set, and any remaining rows are not processed, but + * does not generate an error. + */ public static final int ABORT_PIPELINE = -1; + /** + * Excludes the current row from the output row set, generates an error, and any remaining rows + * are not processed. + */ public static final int ERROR_PIPELINE = -2; + /** Includes the current row in the output row set. */ public static final int CONTINUE_PIPELINE = 0; private boolean bWithPipelineStat = false; @@ -350,11 +360,12 @@ private boolean addValues(IRowMeta rowMeta, Object[] row) throws HopException { if (pipelineStatus != Scriptable.NOT_FOUND) { bWithPipelineStat = true; if (log.isDetailed()) { - logDetailed(("tran_Status found. Checking pipeline status while script execution.")); + logDetailed( + ("pipeline_Status found. Checking pipeline status while script execution.")); } } else { if (log.isDetailed()) { - logDetailed(("No tran_Status found. Pipeline status checking not available.")); + logDetailed(("No pipeline_Status found. Pipeline status checking not available.")); } bWithPipelineStat = false; } diff --git a/plugins/transforms/javascript/src/main/java/org/apache/hop/pipeline/transforms/javascript/ScriptValuesDialog.java b/plugins/transforms/javascript/src/main/java/org/apache/hop/pipeline/transforms/javascript/ScriptValuesDialog.java index 541d6c70ab..e9cb3855ef 100644 --- a/plugins/transforms/javascript/src/main/java/org/apache/hop/pipeline/transforms/javascript/ScriptValuesDialog.java +++ b/plugins/transforms/javascript/src/main/java/org/apache/hop/pipeline/transforms/javascript/ScriptValuesDialog.java @@ -115,6 +115,7 @@ public class ScriptValuesDialog extends BaseTransformDialog { "ScriptValuesDialogMod.TestFailed.DialogMessage"; public static final String CONST_SKIP_PIPELINE = "SKIP_PIPELINE"; public static final String CONST_ERROR_PIPELINE = "ERROR_PIPELINE"; + public static final String CONST_ABORT_PIPELINE = "ABORT_PIPELINE"; public static final String CONST_CONTINUE_PIPELINE = "CONTINUE_PIPELINE"; public static final String CONST_FUNCTION = "Function"; public static final String CONST_JS_FUNCTION = "jsFunction"; @@ -157,11 +158,6 @@ public class ScriptValuesDialog extends BaseTransformDialog { private static final String[] jsFunctionList = ScriptValuesAddedFunctions.jsFunctionList; - public static final int SKIP_PIPELINE = 1; - private static final int ABORT_PIPELINE = -1; - private static final int ERROR_PIPELINE = -2; - private static final int CONTINUE_PIPELINE = 0; - private final ScriptValuesMeta input; private ScriptValuesHelp scVHelp; private TextVar wOptimizationLevel; @@ -344,6 +340,7 @@ public String open() { wlPosition.setLayoutData(fdlPosition); folder = new CTabFolder(wTop, SWT.BORDER | SWT.RESIZE); + PropsUi.setLook(folder, Props.WIDGET_STYLE_TAB); folder.setUnselectedImageVisible(true); folder.setUnselectedCloseVisible(true); FormData fdScript = new FormData(); @@ -1206,10 +1203,10 @@ private boolean test(boolean getvars, boolean popup) { // Adding some Constants to the JavaScript try { - jsscope.put(CONST_SKIP_PIPELINE, jsscope, SKIP_PIPELINE); - jsscope.put("ABORT_PIPELINE", jsscope, ABORT_PIPELINE); - jsscope.put(CONST_ERROR_PIPELINE, jsscope, ERROR_PIPELINE); - jsscope.put(CONST_CONTINUE_PIPELINE, jsscope, CONTINUE_PIPELINE); + jsscope.put(CONST_SKIP_PIPELINE, jsscope, ScriptValues.SKIP_PIPELINE); + jsscope.put(CONST_ABORT_PIPELINE, jsscope, ScriptValues.ABORT_PIPELINE); + jsscope.put(CONST_ERROR_PIPELINE, jsscope, ScriptValues.ERROR_PIPELINE); + jsscope.put(CONST_CONTINUE_PIPELINE, jsscope, ScriptValues.CONTINUE_PIPELINE); } catch (Exception ex) { testException = new HopException( @@ -1441,6 +1438,10 @@ private void buildSpecialFunctionsTree() { itemT.setImage(GuiResource.getInstance().getImageLabel()); itemT.setText(CONST_CONTINUE_PIPELINE); itemT.setData(CONST_CONTINUE_PIPELINE); + itemT = new TreeItem(item, SWT.NULL); + itemT.setImage(GuiResource.getInstance().getImageLabel()); + itemT.setText(CONST_ABORT_PIPELINE); + itemT.setData(CONST_ABORT_PIPELINE); item = new TreeItem(wTree, SWT.NULL); item.setImage(guiresource.getImageFolder()); diff --git a/plugins/transforms/script/src/main/java/org/apache/hop/pipeline/transforms/script/ScriptDialog.java b/plugins/transforms/script/src/main/java/org/apache/hop/pipeline/transforms/script/ScriptDialog.java index b90e4275b6..bdb2aec069 100644 --- a/plugins/transforms/script/src/main/java/org/apache/hop/pipeline/transforms/script/ScriptDialog.java +++ b/plugins/transforms/script/src/main/java/org/apache/hop/pipeline/transforms/script/ScriptDialog.java @@ -295,6 +295,7 @@ public String open() { wlScript.setLayoutData(fdlScript); folder = new CTabFolder(wTop, SWT.BORDER | SWT.RESIZE); + PropsUi.setLook(folder, Props.WIDGET_STYLE_TAB); // This function does not allowed in the web that will lead to error // folder.setSimple(false);