How to create a write operation in file adapter dynamically in to a folder.

Hi all
i want to explain my scenario...
i am giving input to file adpter which is having read operation,and i am giving that input to an human work flow.i had two operations reject and resubmit in my task flow...i am editing the task with some changes...and resubmiting the task from the oracle bpm worklist.......now how can i give that task to again my input folder.....
and another question is,
if i am using three file adpters with 3 differnt folder structure having read operations.and i am giving only one file to one file adapter.and i am giving it to human work flow and i am editing it and i have to resubmit the file to the input folder.....so i i have to give back to input folder dynamically(with out hard coding the folder structure).....How can i give ?????
so any one can help me....please...
Thanks in advance...
varma.

ya...its gd....but i had a problem in my scenariou....
i used this concept as a error handling frame work....that means
i had so many composites which take purchase order as its input from a file adapter........if the input order differs from my xsd,i populated that input as a error file in another folder using some fault handlers... and i am giving that folder to human work flow and i a m editing that task and i am resubmiting it...so that it should go to the input folder of my composites as a input again...so how to differ ,for which composite i have to give as this task as input again.....dynamically it should vary in ...........
please help me....
thanks in advance....
varma

Similar Messages

  • How to create and write in a file

    Hello Gurus,
    I am creating a file based on the date and time and writing into that. But, I am still getting exception error and all. Kindly, please let me know.
    thanks for all the help...j
    Error:-
    C:\Usage\JavaFiles>java filename "abc"
    Exception in thread "main" java.io.FileNotFoundException:Detail09-2003-
    03:28:04.doc (The system cannot find the file specified)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:176)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
    at TowerDetail.main(TowerDetail.java:30)
    Code sample:-
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import java.sql.*;
    import java.text.*;
    public class TowerDetail{
    public static void main (String[] args) throws IOException{
    String userName = "user";
    String passwd = "pwd";
    String con_db = "jdbc:odbc:datasource";
    String ssn = args[0];
    Vector results = new Vector();
    Connection con = null;
    CallableStatement cstmt = null;
    java.util.TimeZone tz = java.util.TimeZone.getTimeZone("EST");
    java.util.Date now = new java.util.Date();
    DateFormat df = new SimpleDateFormat("MM-dd-yyyy-hh:mm:ss");
    df.setTimeZone(tz);
    String result = df.format(now);
    String fileName = "Detail"+result+".doc";
    File inputFile = new File(fileName);
    FileOutputStream fos = new FileOutputStream(inputFile);
    PrintWriter pw = new PrintWriter(fos);
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    }catch (Exception e) {
    System.out.println("JDBC Error: "+e.getMessage());
    return;
    try{
    con = DriverManager.getConnection(con_db, userName, passwd);
    cstmt = con.prepareCall("{call dbo.sp_usage_detail(?)}");
    cstmt.setString(1, ssn.trim());
    ResultSet rs = cstmt.executeQuery();
    pw.println("Report "+result);
    pw.println("------------------------------------------------------------------------------------
    while(rs.next()){
    .... write in the file...
    pw.println("------------------------------------------------------------------------------------
    pw.close();
    System.out.println("Your file Detail"+result+".doc is ready!!!");
    cstmt.close();
    con.close();
    }catch(SQLException ex){
    System.out.println("SQLException: ");
    System.out.println(ex.getMessage());
    }catch(NullPointerException e){
    System.out.println("Null Pointer Exception: ");
    System.out.println(e.getMessage());

    Now, I got out of the command prompt and reentered. I didn't set any classpath or anything. I have created a subdir \archive in the C:\ and writing an output file [DetailTower.....doc")into that.
    The DetailTower.class is in C:\Detail\ProjectClass dirctory.
    Now at,
    C:\Detail\ProjectClass\java -classpath . DetailTower "abc"
    I am getting this error:-
    C:\Detail\ProjectClass>java -classpath . DetailTower "999999"
    Exception in thread "main" java.io.FileNotFoundException: c:\archive\DetailTower09-10-2003-06:23:40.doc (The system cannot find the file specified)at java.io.FileOutputStream.open(Native Method)
            at java.io.FileOutputStream.<init>(FileOutputStream.java:176)
            at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
            at Detail.main(DetailTower.java:32)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to create a table in the file using java code.?

    HI,
    I should export the data from the view objects to a word document. I have done that but I should
    display the data in the form of a table.
    Kindly come up with the necessary information on how to create a table in the file using java.
    Thanks,
    Phani

    Hi, Thank you for responding to my query.
    The below are the details of my code.
    DCBindingContainer dcBindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding StudentDetailsContent =
    (DCIteratorBinding)dcBindings.get("StudentView1Iterator");
    OutputStreamWriter w = new OutputStreamWriter(outputStream, "UTF-8");
    Row currentRow =
    StudentDetailsContent.getRowSetIterator().first();
    Object a[]= currentRow.getAttributeValues();
    int i;
    for(i=0 ;i<=a.length;i++){
    w.write(a.toString());
    w.write(" ");
    w.flush();
    I am usning this coding to achieve the task of exporting data to file.
    I need to display this information in the table that is where I need help from you people.
    Thanks,

  • How to create and manage the log file

    Hi,
    I want to trace and debug the program process.
    I write the code for creating log file and debugging the process.
    But i am not able get the result.
    please help me how to create and manage the log file.
    Here i post sample program
    package Src;
    import java.io.*;
    import org.apache.log4j.*;
    import java.util.logging.FileHandler;
    public class Mylog
         private static final Logger log = Logger.getLogger("Mylog.class");
         public static void main(String[] args) throws Exception {
         try {
           // Create an appending file handler
            boolean append = true;
            FileHandler handler = new FileHandler("debug.log", append);
            // Add to the desired logger
            Logger logger = Logger.getLogger("com.mycompany");
            System.out.println("after creating log file");     
              catch (IOException e)
                   System.out.println("Sys Err");
            }Please give the your valuable suggesstion... !
    Thanks
    MerlinRoshina

    Just i need to write a single line in log file.

  • How to create report writer in sap?

    Hi Anybody,
      I want to create new report writer for finance report for ex: (p & L or balance sheet), i don't know how to create report writer in sap.
    anybody please tell me with example?
    Thanks
    Regards,
    S.Muthu.
    IT Dept.

    https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=createreportwriter&adv=false&sortby=cm_rnd_rankvalue

  • How to create Inbound Idoc from XML file-Need help urgently

    Hi,
    can any one tell how to create inbound Idoc from XML file.
    we have xml file in application server Ex. /usr/INT/SMS/PAYTEXT.xml'  we want to generate inbound idoc from this file.we are successfully able to generate outbound XML file from outbound Idoc by using the XML port. But not able to generate idoc from XML file by using we19 or we16.
    Please let me know the process to trigger inbound Idoc with out using  XI and any other components.
    Thanks in advance
    Dora Reddy

    Hi .. Did either of you get a result on this?
    My question is the same really .. I am testing with WE19 and it seems SAP cannot accept an XML inbound file as standard.
    I see lots of mention of using a Function Module.
    Am I correct in saying therefore that ABAP development is required to create a program to run the FM and process the idoc?
    Or is there something tht can be done with Standard SAP?
    Thanks
    Lee

  • How can I Read/write a ascii file?

    How can I Read/write a ascii file? like this:
    101     0.0000     -1.0000 +
    102     -0.1887     -0.9485 +
    103     -0.3578     -0.8639 +
    104     -0.5022     -0.7516 +
    105     -0.6177     -0.6177 +
    106     -0.7018     -0.4689 +
    107     -0.7533     -0.3120 +
    108     -0.7723     -0.1536 +
    109     -0.7603     -0.0000 +
    110     -0.7198     0.1432 +
    111     -0.6543     0.2710 +
    112     -0.5682     0.3796 +
    113     -0.4660     0.4660 +
    114     -0.3531     0.5284 +
    115     -0.2345     0.5660 +
    116     -0.1152     0.5791 +
    117     -0.0000     0.5689 +
    118     0.1069     0.5375 +
    119     0.2020     0.4876 +
    120     0.2823     0.4224 +
    121     0.3457     0.3457 +
    122     0.3911     0.2614 +
    123     0.4180     0.1732 +

    import java.util.*;
    import java.io.*;
    class BallB{
         public static void main (String args [])
         throws Exception {
              String str=" ";
              String myString="";
              try {
                FileReader fr = new FileReader("test.txt");
                BufferedReader br = new BufferedReader(fr);
                   FileWriter fw = new FileWriter("test1.txt");
                   while(str!=null){
                        myString = str+"\n";
                        str = br.readLine();
                        fw.write(myString);
                   br.close();
                   fw.close();
              }catch (Exception e) {
                   e.printStackTrace();
    }

  • Synchronous Read operation in File Adapter

    Hi All,
    Can anyone explain me on 'Synchronous Read' operation in File Adapter.
    Thanks,
    Rakes

    There are 3 options for the file adapter.
    - Read used for polling files to invoke a BPEL process
    - Write used writing out a file, generaly used to finish a process
    - Sync Read is used to read a file in the middle of a BPEL process.
    What I mean by middle of a process is, a BPEL process can be invoked using a WSDL. The BPEL process can perform some operations and may need to read a file as part of that process as a file provides some information important to the process.
    A real life example would be having a java progaram that invokes a BPEL process via a WSDL. This application asks to process a file xyz in directory abc. You would get this variables from WSDL and read the file approprately.
    This is also an example of processing a file based on business rules in your BPEL process.
    cheers
    James

  • Configure Sender File adapter dynamically

    Hi,
    I need to configure the sender file adapter dynamically. Ex: I will be providing the src dir , file name etc dynamically. I think this is not possible using module because module gets executed after file is picked (in my case file dir and file names need to be determined dynamically). I even don't won't to use directory API for craeting my file sender comm channel. Is there any other way to achive this.
    Regards,
    Rakesh

    Hi Rakesh,
         what is the Operating system of the PI server? Could you please kindly explain what conditions determine filename and source directory? I do not think there is anyway you can determine src file and dir names dynamically in PI.
    Here is what you can try.
    PI server is on windows system u need batch file. If its on unix or Linux you need scripts. Now what you have to do is place all files in a directory. Here the script/batch file will run continuously in background. Once it gets files it will rename files based on file content or file name then move them in different directories as per your conditions. your interface must have multiple communication channels and sender agreement (with diffrent parties) which will pick up those files from these directories.
    The name of directories will be fixed in each channel.
    regards
    Anupam

  • How to create new Sheet in Excel file and write into it

    Hi to all, my requirement is this:
    I have an excel file (.xls) with multiple sheets (three sheets for precision: sheet1, sheet2 and sheet3).
    I must create in the same excel file new sheet, say sheet4, read data from sheet1, sheet2 and sheet3 and write them into sheet4.
    How to realize this in SSIS?
    Expecially, Is it possible to realize this in SSIS?
    thanks in advance.

    You need to create the sheet with the required metadata. There's no use creating blank sheet.
    Also metadata has to be fixed using a sample sheet prior to start of the package for setting the mapping. You may create a excel template for this purpose to just set the mapping at design time.
    At runtime pass actual excel sheet path for ExcelFilePath property of the source to point to correct file.
    Also the create table statement should include the same metadata info (columns)
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
    Hi, well it works fine! I have used a sample sheet prior to start of the package for setting the mapping.
    Next at run time  pass actual excel sheet path for ExcelFilePath property of the source to point to correct file.
    However I have set also ValidateExternalMetadata properties of the Excel Destination to false and DelayValidation properties of the package to true.
    Now my problem is the following:
    I stored the three sheets name (sheet1, sheet2, sheet3) in the Object type user variable through a script task and the foreach loop loops through the three sheets stored in the variable.
    Now, I want that at each iteration the CURRENT VALUE of the Object type user variable is mapped into another user variable wich in turn is given in input to the Excel Source.
    Resuming:
    -) I have to copy the content of three sheets (sheet1, sheet2, sheet3) of excel file into another new sheet,   sheet4.
    -) I stored the three sheets name (sheet1, sheet2, sheet3) in the Object type user variable.
    -) With a  foreach loop container I loops the three sheets stored in the Object type user variable.
    -) Within a foreach loop container I have a Data Flow Task that transfer data from source sheet (sheet1, sheet2, sheet3) into destination sheet, sheet4.
    -) PROBLEM: how to change dinamically at each iteration of the foreach loop the name of source sheet? In the destination excel Task the sheet is always the same at each iteration, sheet4. But in the source excel task the name of sheet musts change at each
    iteration. In particular at the first iteration the name of the source sheet must be "sheet1$", at the second iteration "sheet2$", in the last iteration "sheet3$".
    How to change sheet name dinamically at each iteration?
    thanks.

  • How to use wildcard in filename , in SyncRead operation in File Adapter.

    Hi All,
    Is this possible to use wildcard character in file name while creating file adapter for SyncRead Operation.
    I used write*.txt as a file name to read. But got below error -->
    file:/C:/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_notification2_1.0_93d419d1ca67f87872914bf6daf16180.tmp/readfile3.wsdl [ SynchRead_ptt::SynchRead(Empty,Es) ] - WSIF JCA Execute of operation 'SynchRead' failed due to: No file to process.
    File d:\temp\temp1\write*.txt to be processed was not found or not available
    ; nested exception is:
         ORABPEL-11007
    No file to process.
    File d:\temp\temp1\write*.txt to be processed was not found or not available
    Check the error stack and fix the cause of the error. Contact oracle support if error is not fixable.
    Best Regards
    Vikash

    You cannot defined the wildcard for the file names. But you can provide the file name dynamically if you are on soa suite 10.1.3.4 minimum. You can get information about that in this link http://download.oracle.com/docs/cd/E12524_01/relnotes.1013/e12523/adapters.htm#CHDBBFBD

  • How to create JSF application from xsd files?

    Hi,
    We have many xsd files describing xml's which we are supposed to send to web services. Application which we are creating should allow user to fill xml documents with data and then we should send those xml files to some web service. We want to automatize as much as possible the process of application creation to avoid possible errors and to minimize our efforts (there are plenty of quite complex xsd files).
    Our first approach was: we used Oracle JSXB to generate java classes basing on xsd files (using JDeveloper 10.1.3.2.0.4066). Then we tried to generate DataControls, but this action fails with following error:
    Window title: Error in init bean
    Message: Could not complete initbean because it would result in an invalid document
    Details: oracle.bali.xml.model.XmlInvalidOnCommitException: SEVERE: Wartość atrybutu Name nie jest typu ID (Value of Name attribute is not of ID type)
    Wartość musi być następującego typu: (Value must be of following type)
    Nazwa typu: ID (Type name)
    Typ pierwotny: string (Primitive type)
    Z następującymi więzami: (With following constraints)
    zgodne z wzorcem: [\i-[:]][\c-[:]]* (Compliant with template)
    [ node = Name ]
    <JavaBean version="10.1.3.40.66" id="XSLStylesheet" BeanClass="oracle.xml.xslt.XSLStylesheet" Package="oracle.xml.xslt" isJavaBased="true">
    <Attribute Name="classMethodParams" IsUpdateable="0" Type="java.util.Hashtable" />
    We tried Sun implementation fo JAXB - it generated different java classes (with annotation mechanism). Creation of DataControls using those classes was successful. Then we created simple JSF page and tried to put those DataControls on it in order to let the user fill it with data. The thing is that those controls are read only as there is no row created in those DC. We can't create any row in those DC as there are only 'commit' and 'rollback' operations. When we try to call 'CreateInsert' operation on child elements of those DC we get error in JDeveloper log window:
    2007-05-29 10:08:46 oracle.adf.controller.faces.lifecycle.FacesPageLifecycle addMessage
    WARNING: JBO-29000: DataControl:createRowData
    2007-05-29 10:08:46 oracle.adf.controller.faces.lifecycle.FacesPageLifecycle addMessage
    WARNING: DataControl:createRowData
    new row is not created and controls are still read-only.
    The question is:
    1. is there another, more efficient way to create JSF application from xsd files?
    2. if this is the best way to do it, what do we do wrong?
    Leszek

    To anyone who might find it useful: our solution to mentioned problem.
    Few tips how to solve described problem:
    1. Do not use JAXB (we checked Oracle and Sun)
    2. Use castor http://www.castor.org/
    a) for each xsd generate java files in separated package
    b) use java 1.5 to let castor generate lists
    c) use mapping of xml namespaces to java packages to have only 1 implementation of each xsd
    3. Create facades - java files for you root-level java objects
    4. Right click those facades and choose 'Create DataControl' in jdev
    5. Now you may drag and drop you DataControls and use them in your JSF (or UIX) application
    I hope it will help someone :)
    Leszek

  • How to create a copy of a file

    Is there a method in Java API with which I can create a copy of a file (like running "copy" or "cp" at system command prompt), so that I don't have to use InputStream and OutputStream and create the new file byte by byte?

    I would never create an array with the size of the input file. What do you do, if the file is 2GB?
    I'd rather use buffered streams: BufferedInputStream in = new BufferedInputStream(new FileInputStream("inputfile.dat"));
    BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream("outputfile.dat"));
    byte[] buffer = new byte[4096];
    int b = in.read(buffer);
    while(b>=0)
      out.write(buffer, 0, b);
      b = in.read(buffer);
    in.close();
    out.close();I'm not sure if using an array to read from a BufferedInputStream really improves performance, but you can play around with it. If you know you have big files, you might want to play with the size of the buffer for the streams as well and see how it affects read/write performance. Setting a larger buffer then the default 64K for the output stream might speed up things.
    Thomas

  • How to create/read/write textfiles in a jar archive?

    Hi!
    I would like to know how to create, read and write text file in a jar file?
    //Marcus

    You want to update "files" that are inside a jar archive? You can't. At least not very easily; to modify a file you need to create a new version of the jar, copy over everything else, and add the new version of that file. Look for a different design that doesn't require updating a jar.
    PC&#178;

  • How to creating concurrent call in batch file

    Hallo,
    I want to write a batch file under windows to call 6 instances concurrently to test whether the program is thread-safe. Below is the shell script for linux to create parallel call, it works. But if I use the same syntax, i.e. "&" to connect "java" call in batch file under windows, it only creates serial call, not concurrent call.
    How can I write a windows script or a batch file under windows to build parallel call.
    Best Regards
    saarxfk
    parallelCall.sh
    # set the classpath
    export CLASSPATH=
    for i in jars/*jar; do export CLASSPATH=$CLASSPATH:$i; done
    java WinsServiceClient morganti.pdf morganti.pdf it &
    java WinsServiceClient alesi.pdf alesi.pdf it &
    java WinsServiceClient morganti2.pdf morganti2.pdf it &
    java WinsServiceClient alesi2.pdf alesi2.pdf it &
    java WinsServiceClient morganti3.pdf morganti3.pdf it &
    java WinsServiceClient alesi3.pdf alesi3.pdf it
    ------------------------------------------------------------------------------------------------

    Hallo,
    I want to write a batch file under windows to call 6
    instances concurrently to test whether the program is
    thread-safe. Below is the shell script for linux to
    create parallel call, it works. But if I use the same
    syntax, i.e. "&" to connect "java" call in batch
    file under windows, it only creates serial call, not
    concurrent call.
    How can I write a windows script or a batch file
    under windows to build parallel call.
    You can't do that in windows from one shell. Open 6 shells and do it manually

Maybe you are looking for