File Adapter - how to get the file count from a folder

Hi All,
I have a requirement that have to poll a directory when the file count is reached to number N (ex:number of files avilable in folder is 5) otherwise it should wait and not pick any of the files. Is it possible to get the file count from a folder using file adapter ?? otherwise please suggest me an approach to achieve this requirement.
Thanks,
JJ

Hi Sarath,
Thank you for your reply.
Go with the list files operation of file adapter it will gives you the number of files in the specified folder as you given. . - this step is already done.
When the number of files reaches your count startup your webservice that which can polls the files. . . - how can i acheive this?? Have to poll the directory and process the number files - please let me know, what could be added to the webservice which is being invoked after cheking file count from parent process.
The reason for the above question is - we cannot use ReadFile operation in second webservice because it will be automatically triggered when the file is avilable. Also SyncRead operation supports reading one file in b/w bpel process. Kindly explain me the implementation steps.
Thanks,
JJ

Similar Messages

  • File adapter polling and getting the file name 11g Jdeveloper

    I am using JDeveloper 11g. My process is something like;
    A file adapter reads a XML file
    This triggers the BPM process, file content is sent to start activity as message
    I have to get the file name that is read by file adapter.
    How to do that? Any help is appreciated.
    I have seen couple of answers like bellow in forum but did not help me much
    This is a very simple task in JDeveloper 11g, file adapters are linked to the receive activity, here there is a tab called Properties which you can use to extract the file name. Please follow the steps below:
    1. Create a Simple Type variable of string type, call it fileName_var or any name you wish.
    2. Open the Receive activity in your bpel project.
    3. Scroll down to jca.file.FileName and double click on the value column, click on the browse button (...), select Variable, then click the search icon
    4. Locate your recently created variable
    5. Now when your project runs it will assign the file name to this variable, you can use this same approach also to pull the directory, file size, etc.
    *************************/

    hi,
    Like you said.. steps are simple and clearly mentioned in guide.
    1. create a variable of type string
    2. after configuring the file adapter , go to corresponding receive activity , go to properties tab
    3. search for a property with name as jca.file.FileName . This basically keeps track of file name
    4. for this property, give the value as name of variable created in step 1 above
    5. Use this variable anywhere in assign / transform
    HTH,
    Ketan

  • File adapter polling and getting the file name

    I have a requirement where I have to poll a file and dump the data into the DB. But while polling a file for a particular file name, I also need to get the name of the file to do some operations on the file. The file name should be passed from the adapter in order to do some operations based on the file name. Is it possible to get the file name by any chance?

    Hi,
    its easy to get the file name..by creating the variable for the fileAdapterInboundHeader.wsdl
    just follow the below link.
    http://abhishek-soablog.blogspot.com/2008/06/bpel-getting-file-name-from-file.html
    Edited by: Oraacler on Mar 19, 2010 2:59 AM

  • Get the record count from a query

    Hi,
    does anyone know how to get the record count from a sql query?
    e.g: I've got a ResultSet from the Statement.excuteQuery(), and I want to know how many records this ResultSet contains, how to get this?
    I'd read thoughout the documents of Statement and ResultSet, but couldn't find a solution, do I have to use another seperate query such as "select count(*)" to do this?
    thanks.
    Yang Liu

    If you are not using a scrollable result set then the following is the best way to do it.
    there are several key words in SQL that can be used, the one you are interested in is count();
    so if your query at the moment is
    "select col1, col2, col3 from my_table where col2=? and col3=?"you can work out how many rows will be returned by executing this command first
    "select count(col1) from my_table where col2=? and col3=?"this will return a result set with one row and one column, you can get the row count as follows:
    ResultSet rs = ps.executeQuery();
    int rowCount = rs.getInt(1);I hope this helps :)

  • How to get the files in presentation server while uploading?

    how to get the files in presentation server while uploading?
    give me the function module name

    Hi,
    PARAMETERS:  P_FILE LIKE RLGRAP-FILENAME DEFAULT C_PRES.  "Prsnt Srvr
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          DEF_PATH         = P_FILE
          MASK             = ',..'
          MODE             = '0 '
          TITLE            = 'Choose File'
        IMPORTING
          FILENAME         = P_FILE
        EXCEPTIONS
          INV_WINSYS       = 1
          NO_BATCH         = 2
          SELECTION_CANCEL = 3
          SELECTION_ERROR  = 4
          OTHERS           = 5.

  • [CS3][JS] How to get the file type of current document

    Hi,
    How to get the file type of current opening document (e.g., tif, jpeg, png) using JavaScript with Photoshop CS3.
    I am using file object the open the files one by one in the folder (the files sometimes don't have the extensions).
    If the current document is in tiff format then I need to convert to 8-bit, if its an Jpg image then needs to ignore the file.
    Regards,
    Karthik

    Do you really need to know the file type? What about just checking the bit depth?
    var doc = activeDocument;
    if (doc.bitsPerChannel != BitsPerChannelType.EIGHT) {//Not 8 bit
    doc.bitsPerChannel = BitsPerChannelType.EIGHT;
    //do your save etc
    }else{
        //Ignore

  • How to get the file size (in bytes) for all files in a directory?

    How to get the file size (in bytes) for all files in a directory?
    The following code does not work. isFile() does NOT recognize files as files but only as directories. Why?
    Furthermore the size is not retrieved correctly.
    How do I have to code it otherwise? Is there a way of not converting f-to-string-to-File again but iterate over all file objects instead?
    Thank you
    Peter
    java.io.File f = new java.io.File("D:/todo/");
    files = f.list();
    for (int i = 0; i < files.length; i++) {
    System.out.println("fn=" + files);
    if (new File(files[i]).isFile())
         System.out.println("file[" + i + "]=" + files[i] + " size=" + (new File(files[i])).length() ); }

    pstein wrote:
    ...The following code does not work. Work?! It does not even compile! Please consider posting code in the form of an SSCCE in future.
    Here is an SSCCE.
    import java.io.File;
    class ListFiles {
        public static void main(String[] args) {
            java.io.File f = new java.io.File("/media/disk");
            // provides only the file names, not the path/name!
            //String[] files = f.list();
            File[] files = f.listFiles();
            for (int i = 0; i < files.length; i++) {
                System.out.println("fn=" + files);
    if (files[i].isFile()) {
    System.out.println(
    "file[" +
    i +
    "]=" +
    files[i] +
    " size=" +
    (files[i]).length() );
    }Edit 1:
    Also, in future, when posting code, code snippets, HTML/XML or input/output, please use the code tags to retain the indentation and formatting.   To do that, select the code and click the CODE button seen on the Plain Text tab of the message posting form.  It took me longer to clean up that code and turn it into an SSCCE, than it took to +solve the problem.+
    Edited by: AndrewThompson64 on Jul 21, 2009 8:47 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Sender file adapter is not polling the file.

    Dear all,
       Sender file adapter is not polling the file.(But Receiver file adapter is getting the file)
    we have installed SP15.
    It was worked fine for previous SP14.
    I have cheked in Adapter monioring also.
    Can you help me out of this problem
    Regards
    Dhanabal

    Hi Dhanabal,
    Is the XI system running on a unix machine ?
    If yes, from the OS level for the folder you are using in the file comm. channel, execute the command
    <b>chmod 777 <folder_name></b>
    The reason for the file to show up in receiver side and not get deleted might be that the xi user mighht be having only read access to the folder...
    Thanks,
    Renjith.

  • Sener file adapter has read/pick the files first in first out method.

    HI
    In my Interface I am Using Sender as File adapter. As per my requirement Sender file adapter has to read the file from file directory. This directory having 1000u2019s of files with some files are same name (time stamp is different) and some files are different name here file adapter has to pick the file with mentioned name   in File sender adapter like ZMPSMSGSTATUSMST-.xml .
    But source file name is like <TABLENAME>-<TIME_STAMP>.XML (ZMPSWRKFLOWHIST-20090527-150522-628) in file directory.
    The file adapter in XI will poll to this directory and picks the file in first- in first-out by sorting according to timestamp.
    To do this configuration what I have to do in sender file adapter please give me your valuable inputs.

    HI Abhi,
    Thank you for your spot replay.
    I tested now but i am geting below error.
    Putting message into send queue failed, due to: com.sap.aii.af.ra.ms.api.DuplicateMessageException: Message ID f4ca4f86-9c5d-4bdd-1fb1-a6bd7cda99a8(OUTBOUND) already exists in database: com.sap.sql.DuplicateKeyException: [NWMss][SQLServer JDBC Driver][SQLServer]Violation of PRIMARY KEY constraint 'PK__XI_AF_MSG__491A1D0B'. Cannot insert duplicate key in object 'dbo.XI_AF_MSG'..
    Could not archive file 'E:\file\in\ZMPSMSGSTATUSMST-20090527-150522-628.xml' after processing
    but i am able to see this file in Archive foleder. once file is archivied sucessfully the same file is delted from source directory?
    I given processing parametes queue name is TEST.
    Thanks
    srinivas
    Edited by: srinivasreddy p on May 28, 2009 8:43 AM
    Edited by: srinivasreddy p on May 28, 2009 8:52 AM

  • How to get the row Count of a ResultSet

    How to get the row Count of a ResultSet

    Hi
    I'v tried rennie1's way ,but I only get zero,my code is:
    rs.executeQuery("select count(*) from t_test");
    if (rs.next()) int rowCount=rs.getInt(1);
    I also tried barni's way ,but the method rs.last() and rs.beforeFirst() throw a same Exception
    I tried another way,the code is:
    while rs.next(){
    // Do nothing ,just move the cursour to the last row
    int rowCount=rs.getRow()
    However,the rowCount still equal zero
    Any help would be greatly apprecite!
    note:
    I get connection by DataSource's JNDI name from client, the Server is Weblogic Server 6, the DBMS is Oracle.

  • I have a Macbook Pro Apple . My photos are in iPhoto files. How do transfer the file I want to work on onto Photoshop?

    I have a Macbook Pro Apple . My photos are in iPhoto files. How do transfer the file I want to work on onto Photoshop?

    Where iPhoto Pictures are Located and How to Access the iPhoto Library and Picture Files

  • How to get the column count at the bottom of the column

    Hi Friends,
    How to get the column count at the bottom of the column
    Thanks
    Raj

    You mean row count? Add another column, click on the fx button and type RCOUNT(1).
    If you want just the total you can make it MAX(RCOUNT(1)), hide this column and then add a Narrative View after your report and enter "Total Number of Records: @n" where "n" represents what order your column is from the left side.

  • How to get the extension Info from firefox? Do we have any firefox API to communicate with the browser? I couldnt see the HTML of the widget displayed in the toolbar how to access the widget using JS or any way

    How to get the extension Info from firefox? Do we have any firefox API to communicate with the browser? I couldnt see the HTML of the widget displayed in the toolbar how to access the widget using JS or any way

    Hi,
    Thanks for the suggestion. I've been playing around with some of the classes of the java.net package and java.io
    Using the URL class i can get the content of the data from a STATIC page and output that response to file so that is does not display to the client broswer.
    But this only works if the URL i give points to a static html page.
    So the problem i'm getting is if i'm righting in arguments in the URL, this means that server needs to process the arguments i give and its sends back a dynamic result. Because its dynamic the URL class can not handle this and throws me an exception everytime :(
    Have u ever tried to do some things like this?
    Rahul

  • How to get the return values from a web page

    Hi all :
       how to get the return values from a web page ?  I mean how pass values betwen webflow and web page ?
    thank you very much
    Edited by: jingying Sony on Apr 15, 2010 6:15 AM
    Edited by: jingying Sony on Apr 15, 2010 6:18 AM

    Hi,
    What kind of web page do you have? Do you have possibility to for example make RFCs? Then you could trigger events (with parameters that could "return" the values) and the workflow could react to those events. For example your task can have terminating events.
    Regards,
    Karri

  • How to get the current week from sysdate?

    Hi sir,
    i want to know how to get the current week from sysdate?
    thanks

    Hi Nicolas
    It seems you like to check my post and also make commend ;) thanks for your attention
    Have you ever read the posts above and given solutions ?Yes, I did
    Have you read the docs ? Yes, I checked
    What's the added value here ?Did youYou shared doc with solution(long one), I shared short one which point same solution(Check what Joel posted)..So what is benefit, As you can guess oracle docs are sometimes become so complicated as specialy for beginner...(At least it was like that for me and Belive me somedocs are still sooo complicated even for oracle coworkers ) But for you I dont know ;)
    => Why writting the PS in bold ?Why.. Let me think... Ohh Maybe I am looking some questions(many) and even user get answer they should not changed status so I am reading some posts and try to get problem and loosing time..
    So I am putting that PS wiht BOLD because I dont wanna lose time my friend ;) Because While I am trying to help ppl here In same time I am trying to giving support to my customer prod systems. Which mean time is very important for me...
    Hope my answer could satisfy you..
    One important PS for you.. You may not like my posts (or someone) but my friend I become tired to read&answer and make commend to on your comment which is about my posts.
    I am not newbie in forum(At least I fell like that) and I belive I know how I should make post..
    Thank you
    Regards
    Helios

Maybe you are looking for

  • Ipod going haywire...?

    My ipod alternates between the sad icon and the apple logo and won't turn on. It doesn't show up in itunes or my computer, and won't go into disk mode. Because it doesn't show up on my computer, i can't reset or update it. When it's plugged into the

  • Reset the master password through applescript

    I understand that the correct procedure to reset the master password is to delete these two files from the computer: /Library/Keychains/FileVaultMaster.cer /Library/Keychains/FileVaultMaster.keychain The next step is to go into system preferences and

  • I want to download digital stamps but would need to change the size to fit my project. Does keynote have the ability to change picture size?

    I'm trying to find a app that will allow me to change the size of a digital stamp. I have heard that Adobe Photoshop will allow me to do this but that is outside of my price range right now. Would Keynote allow me to do this?

  • Alpha Channel / Media Encoder Question

    Hello All, I have a question that I think is just something I'm overlooking. I have a Comp with a logo. The logo is made up of various files and does not have a solid background. It's very similar to a lower third.When I render it out in AE via the R

  • Can I run the emulator in -Xautotest mode with an external API?

    Hello, I am currently creating an implementation to a JSR and I want to test the implementation with the test harness. I start the harness and then the test agent. I want to start the agent in autotest mode, using the -Xautotest switch, like this: em