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.  How to populate filename dynamically

    Posted 09/21/11 08:12 AM

    Originally posted by: Bottle1234


    In our project, we have a scenario in which we will be receiving client files in a specific

    folder.

    We have a webservice which requires the filename as input to it and it provides us a response.

    This service provides us different responses based on the filename.

    So we have a scenario in which we need to feed-in the filename by reading it from the specific folder and
    provide it to the webservice.

    For this we have created a map which has one input card and 2 outputcards.
    The input card should get the filename from the specified folder and pass it on to the first output card which creates the Request xml, which in turn is passed on to the 2nd output card which calls the webservice and generates a response.

    The problem i am facing as of now is,i have hardcoded the filename value and passing it to the 1st output card, but my i/p card needs to fetch the filename every time a new file comes into the folder(i.e the filename will be changing dynamically).

    How can i acheive this using wtx ????

    If yes, can you please provide us some samples or provide a soln. for this.

    Thanks in advance.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 2.  Re: How to populate filename dynamically

    Posted 09/21/11 08:40 AM

    Originally posted by: SystemAdmin


    Use the GETRESOURCENAME function.

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


  • 3.  Re: How to populate filename dynamically

    Posted 09/21/11 01:32 PM

    Originally posted by: repanzer1


    If it's Windows;

    WORD( GETFILENAME(Input), "\", -1)

    If it's Unix/Linux

    WORD( GETFILENAME(Input), "\", -1)

    But GETRESOURCENAME (Input) would work as well.
    There are 10 types of people in this world. Those who understand binary and those who don't.
    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 4.  Re: How to populate filename dynamically

    Posted 09/21/11 02:16 PM

    Originally posted by: JGibby


    I use this because it will handle either Window or Unix/Linux.

    
    =TRIMLEFT(GETFILENAME(Input),GETDIRECTORY(Input))
    


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


  • 5.  Re: How to populate filename dynamically

    Posted 09/21/11 04:06 PM

    Originally posted by: repanzer1


    And I'm going to start using it, because it avoids the possibility of making the exact mistake of what I did in my post, where for Unix I should have said;

    WORD(GETFILENAME(Input), "/", -1)

    (backslash instead of forward slash)

    So Bottle1234 , I would use:

    =TRIMLEFT(GETFILENAME(Input),GETDIRECTORY(Input))

    If anyone asks this question in the future, I’m telling that I came up with that code all by myself Mr. Gibby.
    There are 10 types of people in this world. Those who understand binary and those who don't.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 6.  Re: How to populate filename dynamically

    Posted 09/22/11 03:52 AM

    Originally posted by: SystemAdmin


    I like to use this one :

    =WORD(GETFILENAME(Inputx), IF ("<NL>"="<LF>", "/", "\"), -1)

    I did see it in a map sometime ago, so I can't take credit for this, but it is very elegant IMO, and works both on Unix and Windows...
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 7.  Re: How to populate filename dynamically

    Posted 09/23/11 01:09 AM

    Originally posted by: Bottle1234


    sorry guys .. but i guess i wasn't really clear wid my question !! .. all the soln you all have provided seems to be picking up the file name from the path provided in the inputcard .. but that's not d case here .. here my path will only be till the specified folder, in which the file gets saved and from there i hav to pick the file automatically and hence the filename... i hope you all got the question this time :-):-)

    example->C:\Users\Sumit\Desktop\WORK -- here work is the name of the folder where the files are dumped.. My WTX has to look into the WORK folder and pick up the filename of the file ,considering that there is just one file in the folder(to make things easy for now)
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender


  • 8.  Re: How to populate filename dynamically

    Posted 09/23/11 01:25 AM

    Originally posted by: Rich_McFate


    You didn't mention how you were invoking the map. If you're using the Launcher to listen for files in a directory, then GETRESOURCENAME() is the right answer.

    If you're executing the map from the Command Server, you might try building a map with no input cards. The first output card uses the BATCH adapter to execute a DIR /B command. The contents of that card could be passed to a RUN map in output card #2, which would parse the filename(s) from the DIR command and then build your WSDL, invoke your web service, etc as you describe.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 9.  Re: How to populate filename dynamically

    Posted 09/23/11 01:57 AM

    Originally posted by: Bottle1234


    i will be using launcher..but i am not quite sure of how the it works since i have not worked on it. Can u throw some light on how to run a map from the Launcher. I will be using UNIX to launch it.

    If possible can you share some document which states how launcher is used(from the very basic)

    Thanks in advance
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 10.  Re: How to populate filename dynamically

    Posted 09/23/11 09:35 AM

    Originally posted by: repanzer1


    The question you are asking in regards to how to run a map via Launcher, is asking how to use an entire product in the Design Studio package. It’s like asking, “How do I build a type tree?”. You’re going to need to read the Launcher documentation that came with the software and also the documentation for the Integration Flow Designer.

    First you install Launcher on the server and set it up using Launcher Admin. Then you build the map. Then you put that map into a system file with the Integration Flow Designer. Once that is all setup, you then deploy that system to the Unix server, which is a fancy way to say all the files get FTPed to the server when you click the “deploy” function in the Integration Flow Designer. Then you add that system to Launcher via the Launcher Admin.

    It is actually pretty easy once you know how to do it, but there are many aspects to it that trying to train someone on how to do it via a message board is simply not practical. I believe IBM has an entire course that answers that one specific question.

    My suggestion is to read the documentation that came with Design Studio, then attempt to use the software, and if you have any struggles when you are doing that, ask questions on them here.

    There are 10 types of people in this world. Those who understand binary and those who don't.
    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender