File Adapter: Multiple Records, Multiple Types to Multiple DB Tables

Hi there,
I have a proof-of-concept scenario which I am trying to model in ESB:
I have a single flat file with one invoice header record and multiple invoice lines.
I want to read this file via the File Adapter, and insert the different records into different database tables: the invoice header in an invoice table, and the invoice lines into a line item table.
If I tackle the lines in isolation no problem (i.e. single file with only invoice lines in to the invoice lines table). Things break down when I add the invoice header into the mix.
Does anyone have an example of this or something similar?
Would I need to use seperate database adapters for the two tables, or is this achievable with a single database adapter?
Thanks in advance!

Thanks for that Abhi.
I actually tried that, but I'd find that I would only get the header record added properly; the multiple invoice lines would not get written to the invoice line table properly.
I found that I would either get the same invoice line added many times, or I would get null values.
I played around with the for-each statement, and I even tried creating my own xsd for the data file (instead of using the native format tool).
Any ideas what the issue might be?
Thanks,
Richard

Similar Messages

  • Inserting multiple records into a database from a table

    I have a dynamic table with rows upto 10. i am trying to insert all the records in these rows into a database ( msaccess)
    table name: Table1 ( in my form )
    Database table : movies_comments ( as posted in stefan's forums ).
    table columns: username, movieid, comments
    i am using the following code.
    Database.ExecSQL() function is as posted in stefcamerons forums.
    var tlength = xfa.resolveNode("form1.#subform[0].Table1.Row1[*]").length;
    xfa.host.messageBox("tlength is :" +tlength);
    for ( var i = 1; i <= tlength; i++)
    var username = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].user_name").rawValue;
    var movieID = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].movie_id").rawValue;
    var commentS = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].comment_").rawValue;
    Database.ExecSQL("INSERT INTO movie_comments (username, movieId, comment) VALUES ('username','movieID', 'commentS');");
    i am trying to insert multiple records using the code above. But i am getting error
    GeneralError: Operation failed.
    XFAObject.resolveNode:1:XFA:form1[0]:#subform[0]:Button1[0]:click
    SOM expression returned list when single result was expected
    suggest me an alternate way to insert multiple records from a table into a database.
    thank Q

    figured it out. I changed the ...OR (alternative names = colname) in the recordset to ...OR (alternative names LIKE %colname%). Works like a charm now- the result of a good night's sleep.

  • How to select multiple records from a TREE in the table

    HI,
    I have a tree structure which is in the table.When I open the node of the tree,all the subnodes are coming as one-one records in the table.I want to slect multiple record from this table.I applied onLeadSelect for this table,I can select only 1 record from the table.
    Can any one plz suggest me how to select multiple records from the table so that I can get all the data of those selected record.
    Regards
    -Sandip

    Rashmi/Kukku,
    First of all, Thanks for your help!
    Is there any other way in which we can access tables other than using BAPIs or RFCs?
    In my case, there is a table structure which has to be updated with values after validating a key. i don't think there is any RFC available now. do i need to create bapi/rfc for that?
    Krishna Murthy

  • Insert multiple records at the same time to table

    hi,
    My page has,
    1. MessageStyledBean showing a foreign key(say FID) that is passed from previous page.
    2. Advanced table, showing 2 poplist in each of its column, named poplist1 and poplist2.
    3. I have a primary key which should be populated in sequence, i am not displaying it anywhere inthe page(is this right and fine).
    4. I have 'Add another row' button in my advanced table.
    5. I have apply submit button at the bottom of my page.
    So for the same FID at the same time, a user can add multiple rows of poplist1 and poplist2 values using Add another row. Once the user clicks Apply, say after he assigns 2 rows to the same FID in the same page at same time, 2 rows with same FID, different primary ID(in seq), with selected poplist values should be added in the database table.
    I have no clue of how to do this. Pls sombody help me out in doing this.
    Thanking you
    ri

    1. In EOImpl, you can override create(AttributeList nameValuePair) method and set the primary key and FID value.
    This will be called for each row creation.
    you can do
    getOADBTransaction() .getSequenceValue(String pSequenceName)
    to get teh sequence in EO.
    Hope it helps.
    Cheerz,
    Rathna

  • Receiver file adapter to handle multiple structure

    Hi all,
    I have an issue writing file to the file server using receiver file adpater, I am using file content conversion and my file adapter.
    My data type of the output file has 3 hierarchy.
    header
    Item
      subitem
    for every item ,multile subitem would occur, but i am getting error in the communication channel, the adapter takes the fixed field length of the "Item" and looks for the subitem while writing the file.
    Let me know if any one has come across this issue.
    thankx in advance,
    Shree

    Hello!
    Is there really no possibility to convert a structure with a deeper hierarchy of 2?
    I'm trying to convert a structure like this into a flat csv-file
    <root>
    <STRUCTURE1>
      <value1>value</value1>
      <value2>value</value2>
      <value3>value</value3>
        <STRUCTURE2>
          <valuea>value</valuea>
          <valueb>value</valueb>
          <valuec>value</valuec>
            <STRUCTURE3>
              <valueZ>value</valueZ>
              <valueY>value</valueY>
              <valueX>value</valueX>
            </STRUCTURE3>
        </STRUCTURE2>
    </STRUCTURE1>
    </root>
    I implemented that the values are printed in lines separated by ";". A new dataset is printed in a new line. I'm just missing my headerline. That won't work.
    Any idea?

  • Insert Multiple Records and newest record id

    The problem I have is I am using a somewhat normalized
    database and I am trying to enter multiple records from a form into
    a table called catfit. It also needs to add information to another
    table called prodmat and pull the id of the record I just added to
    the prodmat table and insert it into the catfit table in one shot.
    Promat - Holds all of the products
    columns in this table
    prodid
    mold
    desc
    features
    pic
    Catfit - Table that links Prodmat and Modcats
    columns in this table
    prodid
    catid
    modlid
    Now the form I have
    <form method="post" action="action.cfm">
    <select name="modlid">
    <option value ="#modlid#"
    selected="selected">#modlid#</option>
    <option value="1">Sewing Machines</option>
    <option value="9">Vacuums</option>
    <option value="12">Air Purifiers</option>
    </select>
    <select name="catid">
    <option value ="#catid#"
    selected="selected">#catid#</option>
    <option value="None">None</option>
    <option value="1">Sewing
    Machines-Embroidery</option>
    <option value="2">Sewing
    Machines-Computerized</option>
    <option value="3">Sewing
    Machines-Professional</option>
    <option value="4">Sewing
    Machines-Quilting</option>
    <option value="5">Sewing
    Machines-Electronic</option>
    <option value="6">Sewing Machines-Value
    Machines</option>
    <option value="7">Sewing
    Machines-Sergers</option>
    <option value="8">Sewing
    Machines-Specialty</option>
    <option value="9">Air Purifier</option>
    <option value="10">Vacuums-Upright</option>
    <option value="11">Vacuums-Canister</option>
    <option value="12">Vacuums-Central</option>
    </select>
    <select name="catid">
    <option value ="#catid#"
    selected="selected">#catid#</option>
    <option value="None">None</option>
    <option value="1">Sewing
    Machines-Embroidery</option>
    <option value="2">Sewing
    Machines-Computerized</option>
    <option value="3">Sewing
    Machines-Professional</option>
    <option value="4">Sewing
    Machines-Quilting</option>
    <option value="5">Sewing
    Machines-Electronic</option>
    <option value="6">Sewing Machines-Value
    Machines</option>
    <option value="7">Sewing
    Machines-Sergers</option>
    <option value="8">Sewing
    Machines-Specialty</option>
    <option value="9">Air Purifier</option>
    <option value="10">Vacuums-Upright</option>
    <option value="11">Vacuums-Canister</option>
    <option value="12">Vacuums-Central</option>
    </select>
    <select name="catid">
    <option value ="#catid#"
    selected="selected">#catid#</option>
    <option value="None">None</option>
    <option value="1">Sewing
    Machines-Embroidery</option>
    <option value="2">Sewing
    Machines-Computerized</option>
    <option value="3">Sewing
    Machines-Professional</option>
    <option value="4">Sewing
    Machines-Quilting</option>
    <option value="5">Sewing
    Machines-Electronic</option>
    <option value="6">Sewing Machines-Value
    Machines</option>
    <option value="7">Sewing
    Machines-Sergers</option>
    <option value="8">Sewing
    Machines-Specialty</option>
    <option value="9">Air Purifier</option>
    <option value="10">Vacuums-Upright</option>
    <option value="11">Vacuums-Canister</option>
    <option value="12">Vacuums-Central</option>
    </select>
    <input type="text" name="modl" value="#modl#"
    style="form">
    <input type="text" name="pic" value="#pic#"
    style="form">
    <textarea name="desc" rows="25" cols="60" wrap="virtual"
    value="#desc#">#desc#</textarea>
    <textarea name="features" rows="25" cols="60"
    wrap="virtual" value="#features#">#features#</textarea>
    <input type="submit" value="Submit" style="form"
    name="submit">
    </form>
    I have worked with the action.cfm page to no avail what so
    ever so I won't even post it. Now the prodmat table is the table
    where I need to get the prodid (Autonumber column) for the record
    that was just inserted so I can insert that number into the catfit
    table under the prodid column (number column). So this what I
    hoping to get in the end.
    When someone submits this form it will add the data to the
    prodmat table and grab the prodid generated from the new record.
    Then instert a new record for each of the catid select boxes into
    the catfit table. so something like this.
    If they select all three categories upon the submit it would
    add to the catfit table for each record:
    molid = 1
    catid = 2
    prodid = 16 (for instance this would be the newest record
    added to the prodmat table)
    molid = 1
    catid = 6
    prodid = 16
    molid = 1
    catid = 8
    prodid = 16
    Please help I am loosing my hair over this!

    Azadi Saryev wrote:
    > instead of
    > AND CID=#form.CDI#
    > you have to use something like
    > AND CID IN (<cfqueryparam cfsqltype="cf_sql_varchar"
    value="#form.CDI#"
    > list="yes">)
    > since #form.CDI# contains a list of values, not a single
    value
    No. Don't do that. It would produce the same results you were
    getting before ie. the values for all three records would be the
    same.
    Number the CDI fields just like you're doing with form.catID.
    So each set of values is grouped by number
    form.catId1, form.CDI1
    form.catId2, form.CDI2
    form.catId3, form.CDI3
    Then extract the values inside your loop and use them in your
    UPDATE
    <cfloop index="LoopCount" from=1
    to=#Val(form.locCount)#>
    <cfset variables.locID= form["locID"& LoopCount] >
    <cfset variables.catid = form["catid" &
    LoopCount]>
    <cfset variables.CDI = form["CDI" & LoopCount]>
    </cfloop>
    Though you may not actually need an UPDATE here. Another
    option might be to do a DELETE of all existing records for a
    product, followed by an INSERT.

  • Combining multiple records into a single record (View)

    Okay so here is my scenerio:
    There is a table I have made that details SQL jobs and the various details about them. What i wan't to do is make a view with specific logic implemented. Fields that will be taken across to this view will be: LastRunDate, LastRunTime and Step_Status.
    JobName will also be used to define the logic but will not be a column in itself.
    What i wan't is an additional column using this logic, called 'DataSet'. For each Dataset there are multiple jobs that are unique to it, so there are multiple records being brought over from the table to view for one particular dataset. For example,
    for 'ExampleDataSet' there are three jobs, i wan't it so these jobs are combined and named as 'ExampleDataSet' under a calculated column called 'Dataset'. For the following fields i would like it so that LastRunDate and LastRunTime are the time in whichever
    job was last to be intitiated is the date and time set. For Step_Status, there are three possible results, 'Running', 'Failed' or 'Succeeded'. If any of the three jobs are 'Running', then 'Running'. If neither are running yet one has failed then 'Failed'.
    Only when all three have succeeded should it then be set to 'Succeeded'.
    I hope i have made that clear enough, please feel free to ask any questions if not. I am relatively new to SQL but i thought to at least try least try (I knew it wouldn't work) and it didn't work. But it may give you a better idea of
    what i wan't:
    CREATE VIEW [dbo].[vw_DataAvailabilityAnalysts] AS
    SELECT CASE
    WHEN JobName in ('Job1','Job2','Job3') and step_status='Running' THEN 'Running'
    WHEN JobName in ('Job1','Job2','Job3') and step_status='Failed' THEN 'Failed'
    WHEN JobName in ('Job1','Job2','Job3) and step_status='Succeeded' THEN 'Succeeded'
    END as StatusCheck,
    CASE WHEN JobName in ('Job1','Job2','Job3') THEN 'ExampleDataSet'
    END as DATASET,
    LastRunDate,
    lastruntime,
    step_status,
    FROM [CDS_Common].[dbo].[DataAvailability]
    Many Thanks,
    Plain_Clueless
    Plain_Clueless

    Okay so here is what my table looks like (Simplified). There are four columns and the data within is extracted via a Stored Procedure.
    JobName
    LastRunDate
    LastRunTime
    Step_Status
    Job1
    11/06/2014
    09:30:00
    Succeeded
    Job1
    10/06/2014
    09:37:20
    Succeeded
    Job2
    11/06/2014
    04:05:00
    Succeeded
    Job1
    09/06/2014
    02:17:41
    Succeeded
    As you can see there are 3 jobs which are all 'Job1'. This jobs are obviously different within the table however this represents that they are jobs which all update the same DataSet within our local warehouse. Whereas Job2 updates a different dataset alltogether.
    I wan't to create a view which will alagmate the jobs that are of the same DataSet, which will disclude the column JobName but would create a whole new column that looks like this:
    DataSet
    LastRunDate
    LastRunTime
    Step_Status
    DataSet2
    11/06/2014
    04:05:00
    Succeeded
    DataSet1
    11/06/2014
    09:30:00
    Succeeded
    Bascically what this shows you is all the Job 1's combined so they are one record, Amaglamated. The last time any of these jobs were run is the LastRunDate & LastRunTime, which was the first record in the first table provided. Again for Step_Status,
    there are three possible results, 'Running', 'Failed' or 'Succeeded'. If any of the three jobs are 'Running', then 'Running' (Absolute). If none of the three jobs are running yet one has failed then 'Failed'. If one has failed yet another is also running then
    'Running'.Only when all three have succeeded should it then be set to 'Succeeded'. (This last bit isn't as important).
    Hope this clears it up a bit,
    Plain_Clueless
    Plain_Clueless

  • Get only one record for an id for a date if multiple record exists

    Hi,
    I need help with below mentioned scenario.
    DB Version: 11.2.0.3.0.
    Requirement:
    Fetch account records that were created after last run of program
    Get latest record for an account on a given date if there are multiple records for same account.
    If there is a gap of more than 1 day from last run of program, then get latest record for an account for each date if there are multiple records for same account.
    Create table t_test
      Id           number not null,
      cust_id      number not null,
      cust_Acct_id number not null,
      ins_date     date   not null
    insert into t_test values
    (1, 12345, 678905, to_date('05/31/2012 12:05:10 PM','MM/DD/YYYY HH:MI:SS PM'));
    insert into t_test values
    (2, 12345, 678905, to_date('05/31/2012 05:25:46 PM','MM/DD/YYYY HH:MI:SS PM'));
    insert into t_test values
    (3, 12345, 678905, to_date('05/31/2012 11:48:00 PM','MM/DD/YYYY HH:MI:SS PM'));
    insert into t_test values
    (4, 12345, 678905, to_date('06/01/2012 12:05:10 PM','MM/DD/YYYY HH:MI:SS PM'));
    insert into t_test values
    (5, 12345, 678905, to_date('06/01/2012 05:25:46 PM','MM/DD/YYYY HH:MI:SS PM'));
    insert into t_test values
    (6, 12345, 678905, to_date('06/01/2012 11:48:00 PM','MM/DD/YYYY HH:MI:SS PM'));
    insert into t_test values
    (7, 12345, 678905, to_date('06/02/2012 12:05:10 PM','MM/DD/YYYY HH:MI:SS PM'));
    insert into t_test values
    (8, 12345, 678905, to_date('06/02/2012 05:25:46 PM','MM/DD/YYYY HH:MI:SS PM'));
    insert into t_test values
    (9, 12345, 678905, to_date('06/02/2012 11:48:00 PM','MM/DD/YYYY HH:MI:SS PM'));
    create table t_log
      id            number not null,
      prgrm_id      number not null,
      last_run_date date   not null
    insert into t_log values
    (1,1009,to_date('5/30/2012 07:05:12 AM','MM/DD/YYYY HH:MI:SS PM'));Result required:
    id cust_id cust_acct_id ins_date
    3 12345 678905 '05/31/2012 11:48:00 PM'
    6 12345 678905 '06/01/2012 11:48:00 PM'
    9 12345 678905 '06/02/2012 11:48:00 PM'
    I tried below sql but it will return only id 9 record.
    select
        id,
        cust_id,
        cust_acct_id,
        ins_date
    from
        select
            id,
            cust_id,
            cust_acct_id,
            ins_date,
            row_number() over (partition by cust_acct_id order by ins_date desc) rn
        from
            t_test t
        where
            t.ins_date > (
                          select
                              last_run_date
                          from
                              t_log l
                          where
                              l.prgrm_id = 1009
    where rn = 1;Thanks in advance.

    Try:
    SQL> select
      2      id,
      3      cust_id,
      4      cust_acct_id,
      5      ins_date
      6  from
      7      (   
      8      select
      9          t.id,
    10          t.cust_id,
    11          t.cust_acct_id,
    12          t.ins_date,
    13          row_number() over (partition by cust_acct_id, trunc(ins_date) order by ins_date desc) r
    n
    14      from
    15          t_test t
    16      ,   t_log l 
    17      where
    18          t.ins_date >= l.last_run_date
    19      and l.prgrm_id = 1009
    20      )
    21  where rn = 1;
            ID    CUST_ID CUST_ACCT_ID INS_DATE
             3      12345       678905 31-05-2012 23:48:00
             6      12345       678905 01-06-2012 23:48:00
             9      12345       678905 02-06-2012 23:48:00But I now see that Bob already nailed it, while I was testing it ;)

  • File Adapter - Exception / Error handling

    We are using File Adapter in BPEL process to read multiple records from the file. Additionally, we have also handled rejectedMessageHandlers & fatalErrorFailoverProcess exception to lunch custom BPEL process. The process is running fine and also successfully launches custom handler processes too.
    Need help / direction in addressing following issues.
    1. While reading from file, if a records errors out, the custom BPEL process is launched (as specified in rejectedMessageHandlers property). In such instance, the previously read valid records are processed but remaining records are marked as errored out. Our requirement is to make entire record set as invalid and would like to perform rollback of entire process.
    2. Whenever an error occurs during reading the records using File adapter, the associated data file is being deleted from the input directory and also NOT available in archive directory also.
    Are we missing any set up ? We are on 10.1.3.1
    thanks
    -Yj
    Sample Log file:
    <2009-04-20 11:46:14,080> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::init - Initializing the JCA activation agent, processId='bpel://localhost/default/TestFileRead~1.0/
    <2009-04-20 11:46:14,080> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::initiateInboundJcaEndpoint - Creating and initializing inbound JCA endpoint for:
    process='bpel://localhost/default/TestFileRead~1.0/'
    domain='default'
    WSDL location='Read.wsdl'
    portType='Read_ptt'
    operation='Read'
    activation properties={portType=Read_ptt, rejectedMessageHandlers=bpel://default|AdapterError2|initiate|payload}
    <2009-04-20 11:46:14,096> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Adapter Framework instance: OraBPEL - endpointActivation for portType=Read_ptt, operation=Read
    <2009-04-20 11:46:14,143> <INFO> <default.collaxa.cube.activation> <File Adapter::Inbound> Endpoint Activation called in File Adapter for endpoint: c:\temp\yj
    <2009-04-20 11:46:14,143> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Adapter Framework instance: OraBPEL - successfully completed endpointActivation for portType=Read_ptt, operation=Read
    <2009-04-20 11:46:30,580> <WARN> <default.collaxa.cube.activation> <File Adapter::Inbound> PollWork::run exiting, Worker thread will die
    <2009-04-20 11:47:14,158> <INFO> <default.collaxa.cube.activation> <File Adapter::Inbound> Translated inbound batch index 1 of file {testdata6.txt} with corrupted message count = 1
    <2009-04-20 11:47:14,158> <INFO> <default.collaxa.cube.activation> <File Adapter::Inbound> Sending message to Adapter Framework for rejection to user-configured rejection handlers : {
    fileName=C:\temp\yj\testdata6.txt, startLine=3, startColumn=1, endLine=-1, endCol=-1, Exception=ORABPEL-11168
    Error while reading native data.
    [Line=3, Col=5] Expected "|" for the data starting at the specified position, while trying to read the data for "element with name C2", using "style" as "terminated" and "terminatedBy" as "|", but not found.
    Ensure that "|", exists for the data starting at the specified position.
    <2009-04-20 11:47:14,158> <WARN> <default.collaxa.cube.activation> <AdapterFramework::Inbound> [Read_ptt::Read(Root-Element)]onReject: Sending invalid inbound message to Exception Handler: bpel://default|AdapterError2|initiate|payload
    <2009-04-20 11:47:14,315> <INFO> <default.collaxa.cube.activation> <File Adapter::Inbound> Setting last error record to : -1
    <2009-04-20 11:47:14,658> <ERROR> <default.collaxa.cube.activation> <AdapterFramework::Inbound> onBatchFailure: Batch 'bpel://localhost/default/TestFileRead~1.0//testdata6.txt_1240205493408' (C:\temp\yj\testdata6.txt) has failed due to: ORABPEL-11168
    Error while reading native data.
    [Line=3, Col=5] Expected "|" for the data starting at the specified position, while trying to read the data for "element with name C2", using "style" as "terminated" and "terminatedBy" as "|", but not found.
    Ensure that "|", exists for the data starting at the specified position.

    Any light / idea on the following issue ?
    1. While reading from file, if a records errors out, the custom BPEL process is launched (as specified in rejectedMessageHandlers property). In such instance, the previously read valid records are processed but remaining records are marked as errored out. Our requirement is to make entire record set as invalid and would like to perform rollback of entire process. Even, if we do not configure rejectedMessageHandlers, the behavior is that valid rows are processed with the rest of BPEL process and for Invalid rows, the records are rejected. Our requirement, is that, even if there is one invalid record, the entire set of record should NOT move ahead with the BPEL process
    2. Whenever an error occurs during reading the records using File adapter, the associated data file is being deleted from the input directory and also NOT available in archive directory also. Note, in case of all valid record the file is available in archive directory

  • Sender File Adapter (FTP Protocol)

    Hi Every Body,
    I have a problem in using Sender File Adapter of (FTP Protocol Type)
    I have given all required settings to get connected to the FTP Server.
    When i give ( Source Directory and Exact File Name ex : MDMERP.xml)
    File gets picked up.
    But When i give (Source Directory and Exact File Name ex : *.xml)
    it gives below exception
    Error occurred while connecting to the FTP server "mdmerp6:21": java.net.ConnectException: Connection refused: connect
    Strange any guess !! :(((
    Regards
    Srinivas

    Hi,
    If that is connection error then it should have not allowed to pick up when i have given the specifif file name ,
    .xml is too not working
    my problem all starts if i use other than file name declarartion it throws error
    of below kind
    Error occurred while connecting to the FTP server "mdxxxp6:21": java.net.ConnectException: Connection refused: connect
    Can i use " Advanced Selection of Source File" and make it run\
    With regards
    Srini

  • Testcase problem using two file adapter and a transformation

    We've got an input which looks like this :
    <?xml version="1.0" encoding="UTF-8"?>
    <rows>
    <row>
    <id>10</id>
    <naam>A</naam>
    </row>
    <row>
    <id>20</id>
    <naam>B</naam>
    </row>
    </rows>
    I've created an XSD for this message which looks like this ( straightforward ) :
    <?xml version="1.0" encoding="UTF-8"?>
    <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.test.nl/testschema" xmlns:test="http://www.test.nl/testschema" elementFormDefault="unqualified">
         <element name="row">
              <complexType>
                   <sequence>
                        <element ref="test:id"/>
                        <element ref="test:naam"/>
                   </sequence>
              </complexType>
         </element>
         <element name="rows">
              <complexType>
                   <sequence>
                        <element ref="test:row" maxOccurs="unbounded"/>
                   </sequence>
              </complexType>
         </element>
         <element name="naam">
              <simpleType>
                   <restriction base="string">
                   </restriction>
              </simpleType>
         </element>
         <element name="id">
              <simpleType>
                   <restriction base="byte">
                   </restriction>
              </simpleType>
         </element>
    </schema>
    I've imported this XSD in my ESB project and created a file adapter which reads this type op files.
    I've created another file adapter to write the files 1:1 to an output dir.
    In the routingservice I've created a very straightforward XSL mapping which maps everything 1:1.
    Now the problem
    When I use this input :
    <?xml version="1.0" encoding="UTF-8"?>
    <rows>
    <row>
    <id>10</id>
    <naam>Martin</naam>
    </row>
    <row>
    <id>20</id>
    <naam>Edward</naam>
    </row>
    </rows>
    my output result is:
    <?xml version="1.0" ?><imp1:rows xmlns:imp1="http://www.test.nl/testschema"/>
    I know this is a namespace issue. When I add the namespace
    <?xml version="1.0" encoding="UTF-8"?>
    <rows xmlns="http://www.test.nl/testschema">
    <row>
    <id>10</id>
    <naam>Martin</naam>
    </row>
    <row>
    <id>20</id>
    <naam>Edward</naam>
    </row>
    </rows>
    I get the correct ( and 1:1 output ).
    The problem is. In the scenario I'm about to build the input xml messages do not have an namespace. How can I alter my xsd file or anything within my ESB project that all files will be picked up correctly and processed without having an default namespace?
    Any help is appreciated!

    True,
    But its the other way around what is causing my problem.
    Because the input xml files contain no namespace at all the xml messages are transformed but result in an almost empty xml message. ( e.g. the root element is there and thats it ).
    This is because the XML transformation mapper in ESB ( as well as BPEL ) excplicitly needs a namespace.
    I solved it by editing the XSL by hand, removing the :imp1 namespace prefixes in the select="" tags. e.g.
    <xsl:for-each select="/imp1:rows/imp1:row"> is updated in
    <xsl:for-each select="/rows/row">
    As far as I know this is the only workaround at the moment that I could find.

  • How to get the name of file was read from file adapter ?

    Hello!
    I make a pooling into one directory to read all *.fat files in this directory, and I want the name of this file
    is it possible ?
    God bless all!

    it is mentioned in the sample code.. look at the pdf guide inthe sample code document for file adapter.
    you need to define a variable of message type of the file adapter inbound header message type and assign the variable to the apapters tab in the receive activity..
    the variable will have file name now

  • Weird problem in File Adapter polling

    Hi Guys,
    My BPEL process is working fine not until today wherein the File Adapter cannot poll for new files in the target directory. I tried restarting the bpel server and still my bpel process was not able to poll for new files. I tried creating a test bpel process and configure the file adapter (see below):
    Operation Type: Read
    Archive processed files: Enable
    Delete files after successfule: Enable
    Include files with pattern: *.csv
    Publish messages in batches of: 1000
    Polling frequency: 5 seconds
    Minimum file age: 0 seconds
    Sample File: test.csv
    12345,12345,12345
    When I tried testing it, the file was deleted but it was not able to archive the file and bpel process did not appear in the instance tab of BPEL console. I have check the domain.log and orabpel.log files and it didn't show any exceptions or error (log level is set to error)
    Any idea how to fix this problem?
    FYI, I'm using the version 10.1.3.1.
    thanks,

    What does your process do other than poll files, does it call any other adapter / service. This is more likely the issue although I have seen issues with the file and ftp adapter in 10.1.3.3 and 10.1.3.1. I never sorted the issue it just seemed to affect that process.
    10.1.3.1 is really out of date and has a number of issues you should look at upgrading to 10.1.3.4 or 10.1.3.5 but I have seen some posts that have issues with 10.1.3.5.
    cheers
    James

  • Target directory in file adapter

    Hi,
    Please let me know how can we set the target directory in the receiver file adapter by reading the database (maybe from a table in the database).
    regards,
    Raghu

    try to avoid variable substitution. You can make use of adapter specific attributes in this case. For example for the same file name you can ref:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Similar logic can be used for directory also.
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm

  • Reading a multiple record types from a single File using BPEL file adapter

    Hi all.
    We have a requirement where we want to read a CSV file using the BPEl adapter.
    Following is the sample of csv file
    HDR,1,2,3
    ---- First transaction starts----
    TH,1,2,3
    RSD,1,1
    RSD,1,1
    TD,1
    -------Second transaction starts---
    TH,1,2,3
    RSD,1,1
    RSD,1,1
    RSD,1,1
    RSD,1,2
    TD,1
    TD,1
    -------------Third Transaction starts---
    TH,1,2,3
    RSD,1,1
    TD,1
    TD,1
    TD,1
    TD,1
    -------------Fourth Transaction starts---
    TH,1,2,3
    LN,1,1,1,1,2
    -----End of File---
    TAIL
    I have modified the file with some comments to have some clear understanding.
    Basically our file is a transactions file from legacy system & contains mutliple transactions
    First line will be a Header record starting "HDR" & contains all summary details about the file.
    After it is details of all transactions thorughout the day, each transaction begins with record starting "TH".As shown in all transactions above.EAch transaction can have other multiple records like the RSD & TD shown above.
    Our need is to read each transaction from the file & create an instance.How can we configure BPEL to grab the data starting with TH till it encounter's another TH.
    Please advise
    Krunal

    You can't use the wizard to create a schema if a file as complex as this. the good news is that you can create one yourself. What you need to do is create standard xsd that will handle your file, then what you do is add the terminators that determine when a field stops.
    Here is an example, hopefully this provides you enough infor for you to make your own.
    <?xml version="1.0" encoding="UTF-8" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
    targetNamespace="http://Invoice"
    xmlns:tns="http://Invoice"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    nxsd:encoding="ASCII"
    nxsd:stream="chars"
    nxsd:version="NXSD">
    <xsd:element name="Invoice">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="InvoiceHeader" nxsd:startsWith="000" maxOccurs="unbounded">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="tns:InvoiceHeaderDetails" />
    <xsd:element ref="tns:LineItem" nxsd:startsWith="001" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="InvoiceHeaderDetails">
    <xsd:complexType>
    <xsd:sequence nxsd:style="array" nxsd:arrayTerminatedBy="${eol}">
    <xsd:element name="BusinessUnit" type="xsd:string" nxsd:style="fixedLength" nxsd:length="13" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
    <xsd:element name="InvoiceNo" type="xsd:string" nxsd:style="fixedLength" nxsd:length="16" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="InvoiceDate" type="xsd:string" nxsd:style="fixedLength" nxsd:length="15" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="VendorNo" type="xsd:string" nxsd:style="fixedLength" nxsd:length="29" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="OriginCode" type="xsd:string" nxsd:style="fixedLength" nxsd:length="3" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="OperatorID" type="xsd:string" nxsd:style="fixedLength" nxsd:length="8" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="LineCount" type="xsd:integer" nxsd:style="fixedLength" nxsd:length="34" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="GrossAmount" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="17" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="DiscountAmount" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="50" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="FreightAmount" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="93" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="TaxAmount" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="50" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="DiscountFlag" type="xsd:string" nxsd:style="fixedLength" nxsd:length="1" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="LineItem">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="LineItemDetails">
    <xsd:complexType>
    <xsd:sequence nxsd:style="array" nxsd:arrayTerminatedBy="${eol}">
    <xsd:element name="BusinessUnit" type="xsd:string" nxsd:style="fixedLength" nxsd:length="13" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
    <xsd:element name="InvoiceLineNo" type="xsd:integer" nxsd:style="fixedLength" nxsd:length="5" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="DistributionCount" type="xsd:integer" nxsd:style="fixedLength" nxsd:length="5" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="BusinessUnitPO" type="xsd:string" nxsd:style="fixedLength" nxsd:length="5" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
    <xsd:element name="PONo" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
    <xsd:element name="POLineNo" type="xsd:integer" nxsd:style="fixedLength" nxsd:length="38" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
    <xsd:element name="InvoiceLineAmount" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="17" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element ref="tns:Distribution" nxsd:startsWith="002" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    <xsd:element name="Distribution">
    <xsd:complexType>
    <xsd:sequence nxsd:style="array" nxsd:arrayTerminatedBy="${eol}">
    <xsd:element name="BusinessUnit" type="xsd:string" nxsd:style="fixedLength" nxsd:length="13" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
    <xsd:element name="InvoiceLineNo" type="xsd:integer" nxsd:style="fixedLength" nxsd:length="5" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="DistributionLineNo" type="xsd:integer" nxsd:style="fixedLength" nxsd:length="10" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="GLAccountCode" type="xsd:string" nxsd:style="fixedLength" nxsd:length="84" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
    <xsd:element name="DistributionAmount" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="162" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="DistributionTaxAmount" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="62" nxsd:paddedBy=" " nxsd:padStyle="tail" />
    <xsd:element name="GLDepartmentCode" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" nxsd:paddedBy=" " nxsd:padStyle="tail"/>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    cheers
    James

Maybe you are looking for