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

Wire Adapter using PUT function in WTX

  • 1.  Wire Adapter using PUT function in WTX

    Posted Sat September 28, 2013 05:02 AM

    Originally posted by: sunil0548


    Hi anyone briefly explain me how WIRE adapter can be used using PUT function while configured with WMB.


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


  • 2.  Re: Wire Adapter using PUT function in WTX

    Posted Thu October 10, 2013 08:10 AM

    Originally posted by: paul.brett


    In the map, you would use the syntax as follows:

    
    
    
    =PUT("
    WIRE", "
    output_terminal_name",
    data)
    

    Optionally, you can specify that the message is to be sent immediately. The -NOW argument sends the message to the output terminal as soon as the PUT rule is processed. When you omit the -NOW argument, a map primitive sends the data to the output terminal when the map completes, and a RUN map sends a message to the output terminal when the top map completes. If you omit the -NOW argument and the map or RUN map fails, the message is not sent.

    
    
    
    =PUT("
    WIRE", "
    output_terminal_name -NOW",
    data)
    

     

    (from http://pic.dhe.ibm.com/infocenter/wtxdoc/v8r4m0/topic/com.ibm.websphere.dtx.wtx4esb.doc/references/r_wtx4esb_put_rule_syntax.htm?resultof=%22%77%69%72%65%22%20%22%61%64%61%70%74%65%72%22%20%22%61%64%61%70%74%22%20)

     

    Then in the Toolkit, you right-click the output terminals of the map node, and choose 'Add Outut Terminal' from the pop-up menu.  You name this new terminal to match the rule (output_terminal_name above).

     

    After that, all you need to do is wire this new output terminal as you would any other output terminal.

     

    Thank-you.

    Paul

    Follow me on Twitter


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


  • 3.  Re: Wire Adapter using PUT function in WTX

    Posted Tue December 29, 2015 12:21 PM

    Originally posted by: IBMDEVELOPER


    Hi Paul,

     

    How can we get the data from PUTWIRE card to java?

    I have to get the out data as a stream of bytes from Putwire card that need to be written to a output file in java code.

     

    Thanks,


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


  • 4.  Re: Wire Adapter using PUT function in WTX

    Posted Wed December 30, 2015 04:12 AM
      |   view attached

    Originally posted by: paul.brett


    I enclose an example that uses the PUT() function and the WIRE adapter.  The next node is a Java Compute Node, and I have limited Java skills.

    I wrote out (in append mode) to a file ('WritingToFile.out'):

    +---------- Begin log entry ----------+
    Now=Wed Dec 30 09:07:06 GMT 2015MbMessageAssembly
    (
      Message:
        com.ibm.broker.plugin.MbMessage@43614361
    
      Local environment:
        com.ibm.broker.plugin.MbMessage@507a507a
    
      Global environment:
        com.ibm.broker.plugin.MbMessage@51935193
    
      Exception list:
        com.ibm.broker.plugin.MbMessage@52df52df
    )
    +---------- End log entry   ----------+
    

    Obviously, a proper Java programmer could do a lot more with the message stream.

    Thank-you.

    Paul

    Follow me on Twitter


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

    Attachment(s)

    zip
    ProjectInterchange.zip   6 KB 1 version


  • 5.  Re: Wire Adapter using PUT function in WTX

    Posted Wed December 30, 2015 09:21 AM
      |   view attached

    Originally posted by: IBMDEVELOPER


    Hello Paul,

     

    Thanks for the quick reply.

    Here I am attaching you the java code that takes the input from a file system and pass it to the map(.mmc) , execute the .mmc map and returns the output to the java program. Now the java program writes the output data to a file system. 

    Problem with this is, when i am giving the main outcard number(ex. 1) it is fetching the data.When i am giving the putwire card number(ex. 2) , it unable to fetch the data. Because it unable to get the data through PUT function.(=PUT("FILE","wtxout",CTEXT(Output2,"Native"))).

     

    Can you give any suggestion??


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

    Attachment(s)

    txt
    javacode_for_wtx.txt   1 KB 1 version


  • 6.  Re: Wire Adapter using PUT function in WTX

    Posted Wed December 30, 2015 10:10 AM

    Originally posted by: paul.brett


    This code indicates that you are calling a WTX map using the Java API, and not using the WebSphere TX Node in WebSphere Message Broker at all.

    Did you import my project?  Do you have the IBM WebSphere TX for Integration Servers embedded in your WMB Toolkit?

    If you are seeking assistance with using the WIRE adapter to send a data stream back to a calling Java program, then I am sorry to report that this cannot be done.  The WIRE adapter can ONLY be used when the map is called from the WTX Node.

    Thank-you.

    Paul

    Follow me on Twitter


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


  • 7.  Re: Wire Adapter using PUT function in WTX

    Posted Wed December 30, 2015 11:04 AM

    Originally posted by: IBMDEVELOPER


    Hello Paul,

     

    yes, I am not using any WMB technology. I have integrated the WTX with Java API without any other technologies.(No IIB/WMB)

    Atcually, in java code getoutputobject(1) , we need to specify the outcard number to get the data. but as per java perspective we dont know which card is the main outcard? 

    we can know how many outcards present and for the particular card number the data can be fetched.

     

    So, you are saying that this cannot be done through PUT function?


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


  • 8.  Re: Wire Adapter using PUT function in WTX

    Posted Thu December 31, 2015 08:55 AM

    Originally posted by: RichMcFate


    Two questions:

     

    1. If all you're going to do with the data is write it to a file, why not just let WTX do it?  Why do you need to bring it back to the calling code at all?  You could certainly pass in the name of the file you want to create.

     

    2. Have you looked at the java class adapter?  You can invoke any public method.  Perhaps you can encapsulate your 'file writer' code into a public method and invoke it directly from the map using the PUT("JAVA"..

     

    Documentation is here:

    http://www-01.ibm.com/support/knowledgecenter/SSVSD8_8.4.1/com.ibm.websphere.dtx.adapjavcls.doc/concepts/c_java_Overview_.htm


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


  • 9.  Re: Wire Adapter using PUT function in WTX

    Posted Wed December 30, 2015 01:15 PM

    Originally posted by: paul.brett


    I do not believe this is possible.  For a more complete answer, including some workaround suggestions, please could you raise a Service Request with IBM?

    Thank-you.

    Paul

    Follow me on Twitter


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