Topic
  • 3 replies
  • Latest Post - ‏2010-12-25T01:27:17Z by Charlize.Fraser
Roberto_Mascarenhas
Roberto_Mascarenhas
3 Posts

Pinned topic Retrieving / Handling filenames flowing through WPG

‏2009-03-26T15:02:56Z |
Hello;

How do I retrieve just the filename and build a new ASCII file just with that content : the filename ? And place it in the same directory (destination) of the original file.

I had just found the Programmer's Guide and it shows a possibility to set or access a constant :
public static final String BCG_OUT_DOC_FILENAME = ″X-out-filename″. This constant can be used to set or access the output file name in the business document. For example, you can write a pre-process handler, set the output file name to user defined, and then configure it with the File Sender. When File Sender writes the document to the target location, it is written with the name that was set to the OUT_DOC_FILENAME attribute.
1) Is there any sample showing how to use it ?

2) Can someone send me a sample of that ?

3) Is it possible to retrieve the filenames in a window time of 30 min ?

We need to write a new file that will contain just the filenames, so this will be an input to WESB to read and know which files it will pick up to be processed. Actually, the WESB will call a WTX map.

Thanks a lot.

Roberto Mascarenhas.
Updated on 2010-12-25T01:27:17Z at 2010-12-25T01:27:17Z by Charlize.Fraser
  • gbalu1
    gbalu1
    12 Posts

    Re: Retrieving / Handling filenames flowing through WPG

    ‏2009-04-14T23:04:38Z  
    Hi,
    In the Sender pre-process handler, if you use x-out-filename to set your new file, wpg will replace the original destination file with your new file -- I am assuming thats not what you want to do.
    To write a new file that contains just the payload file name, you have to create a new file and write it to the Destination directory (or any directory). You can extract the payload file name from x-out-filename attribute (or x-aux-in-filename). This can be a simple file i/o java code within Sender preprocess handler structure.
    If you are looking to gather/write files within 30 minute window, you can still use the Sender pre-process handler and keep appending to the same file.

    Regards,
    gbalu1
  • SystemAdmin
    SystemAdmin
    527 Posts

    Re: Retrieving / Handling filenames flowing through WPG

    ‏2010-08-05T20:52:45Z  
    Hello Roberto,

    we have a similar kind of requirement to process and is there any way you can share some code or document on this like how to process and what steps required and how to update handlers like that .............
    1) Is there any sample showing how to use it ?

    2) Can someone send me a sample of that ?

    Thanks in advance ..
    >Hello;

    >How do I retrieve just the filename and build a new ASCII file just with that content : the filename ? And place it in the same directory (destination) of the original file.

    >I had just found the Programmer's Guide and it shows a possibility to set or access a constant :
    >public static final String BCG_OUT_DOC_FILENAME = ″X-out-filename″. This constant can be used to set or access the output file name in the >business document. For example, you can write a pre-process handler, set the output file name to user defined, and then configure it with the >File Sender. When File Sender writes the document to the target location, it is written with the name that was set to the OUT_DOC_FILENAME >attribute.

    >1) Is there any sample showing how to use it ?

    >2) Can someone send me a sample of that ?

    >3) Is it possible to retrieve the filenames in a window time of 30 min ?

    >We need to write a new file that will contain just the filenames, so this will be an input to WESB to read and know which files it will pick >up to be processed. Actually, the WESB will call a WTX map.

    >Thanks a lot.

    Roberto Mascarenhas.
  • Charlize.Fraser
    Charlize.Fraser
    1 Post

    Re: Retrieving / Handling filenames flowing through WPG

    ‏2010-12-25T01:27:17Z  
    gbalu1 wrote:
    Hi,
    In the Sender pre-process handler, if you use x-out-filename to set your new file, wpg will replace the original destination file with your new file -- I am assuming thats not what you want to do.
    To write a new file that contains just the payload file name, you have to create a new file and write it to the Destination directory (or any directory). You can extract the payload file name from x-out-filename attribute (or x-aux-in-filename). This can be a simple file i/o java code within Sender preprocess handler structure.
    If you are looking to gather/write files within 30 minute window, you can still use the Sender pre-process handler and keep appending to the same file.

    Regards,
    gbalu1

    It's helpful to me, Thanks for your sharing!