IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Capture map error messages using WTX java api

    Posted 01/11/10 06:21 AM

    Originally posted by: anjaliSN


    Hi,

    I am using WTX java api to execute a map. The map exeution is aborted using FAIL function based on certain condition in input. I am passing an error text in FAIL function, but that message is getting logged in Audit log. How do i get this information in one of the data objects? Or how can i get this in my java application?

    thanks.
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 2.  Re: Capture map error messages using WTX java api

    Posted 01/11/10 03:08 PM

    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


  • 3.  Re: Capture map error messages using WTX java api

    Posted 01/11/10 04:12 PM

    Originally posted by: SystemAdmin


    You may want to create map ("auditlog") that reads the audit log and provides with the completion status and then change the java to run "auditlog" when the transformaiton map fails. This "auditlog" map would return the completion message from the audit log to the app. That will provide a pretty flexible way to capture custom messages created in conjunction with the FAIl function. For example, if there were more than one error condition that would cause the map to issue the FAIL function on different map rules, the one "auditlog" map would work for all cases.

    There is a example map under the \examples\general\audit folder that is helpful in getting started reading and mapping a map audit log.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 4.  Re: Capture map error messages using WTX java api

    Posted 01/14/10 03:53 AM

    Originally posted by: phil2030


    Call the "getTextProperty" method on the MMap instance. e.g.

    _map.getTextProperty(MConstants.MPIP_OBJECT_ERROR_MSG,0)
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender