IBM Sterling Transformation Extender

Sterling Transformation Extender

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

 View Only
Expand all | Collapse all

Execute map using Java Program

  • 1.  Execute map using Java Program

    Posted Sat July 19, 2014 04:43 AM

    Originally posted by: Bhoju


    Dear happy programmers,

    I am in a process to transform our batch process to run the WTX maps using a java process rather running them with command servers, we are doing a POC now to see if we gain some performance improvement by doing this. .

    Now to get started, i written a simple java program which can run the map, program shown below. However my requirements are input and output cards overriding, most of the input card of our maps are fetching data from database and the output cards are mostly creating files or calling a shell scripts on unix environment. 

    I am seeking some help how to override the cards using a java program and leverage all the features which command server provides in a java process (Audit logging, work files, card overrideing, adapter overriding etc)  . Any help and quick answers would be highly appreciated as the POC indeed have some deadlines and i want to approach fast towards the concept proof so that we can allocate some budjet and have the developers further explore this opportunity.

    ** Code with which i got a jump start **

    import com.ibm.websphere.dtx.dtxpi.MMap;
    import com.ibm.websphere.dtx.dtxpi.MConstants;
    import com.ibm.websphere.dtx.dtxpi.MException;

    public class RunMap {

    public static void main(String args[]) {

    // Initialize the API
    try {
            MMap.initializeAPI(null);

            // Create a map
            MMap map = new MMap("Test.aix");

            // Run the map
            map.run();

            // Check the return status
            int iRC = map.getIntegerProperty(MConstants.MPIP_OBJECT_ERROR_CODE, 0);
            String szMsg = map.getTextProperty(MConstants.MPIP_OBJECT_ERROR_MSG, 0);
            System.out.println("Map status: " + szMsg + " (" + iRC + ")");

            // Clean up
            map.unload();
            MMap.terminateAPI();
    }
    catch (MException e) {
            e.printStackTrace();
    }
    }
    }

    Thanks


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


  • 2.  Re: Execute map using Java Program

    Posted Mon July 21, 2014 07:22 AM

    Originally posted by: GKearney


    hi,

    Have you tried to look at the java examples provided with the WTX Examples in the following location ?.

    C:\IBM\WebSphere Transformation Extender 8.4.1\examples\dk\dtxpi\java

    For example Example5.java - Using Streams to Override Inputs and Outputs

    I hope that this information is of help to you.


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