I have a nice post process script that has much potential for use. Here is the code:
if (properties.get("exitCode") != 0) { properties.put(new java.lang.String("Status"), new java.lang.String("Failure")); } else { properties.put("Status", "Success"); scanner.register("^OUTPUT", function(lineNumber, line) { var temp=line.split("|"); var out=temp[1]; properties.put("OutputVariable", out); }); scanner.scan(); }
This post process script sets a variable that other steps in the same process can access. The Variable will be accessible through the ${p:step-name/OutputVariable}. The output from the step can only have one line that starts with "OUTPUT|". More Scanners can be registered to gather more than one variable from the step if necessary.
Post-Processing Script