Originally posted by: repanzer
Ok so; you're running a map via your java api. That map is failing and it does was failing maps do; it takes the error text you supplied in the "FAIL("error text here" +LASTERRORMSG()+LASTERRORCODE())" function and puts them in the audit log. Problem is, you want the "error text" to be returned to the Java api, yes? So, you would want the "error text" to be put in one of the objects in the output card, or some other object in the failing map, so you can use it.
In an example map, I have two output cards. The first output card has one field and I move a value from the input into that field. The second output card also has one field, and the logic is;
If(field:outputcard1< 1000), FAIL("HAS TO BE HIGHER THEN 1000"). You run the map, the value for output card 1 is less then 1000, and your map fails, putting the error text in the audit log.
But if I wanted that information passed back to me, instead of running the map that is failing, I use the RUN statement to run it.
VALID(RUN("MapThatFails"), "MY ERROR TEXT").
Now the map stilled failed, but it was run by another map that does not fail. That control map (as some would call it) only runs the map and lets you know if it was successful, as opposed to running a map that fails.
Hope this helps.
#IBM-Websphere-Transformation-Extender#IBMSterlingTransformationExtender#DataExchange