How to use the BPEL file adapter to load data into Oracle

Andre Crone 4

This post shows a simple example about how to use Oracle’s BPEL server to load and parse a datafile. The data in the file is then inserted into a database table. We use the file adapter and the database adapter to accomplish this task. The nice thing of this BPEL process is that we don’t have to instantiate the BPEL process ourselves. A BPEL process is started as soon as the file holding the data is detected by the BPEL engine.

The following pictures shows the BPEL process in jDeveloper:
Process overview

Note that the process has no user interaction. The process has no manual input. A BPEL process is instantiated as soon as a file is detected. This is accomplished by entering the “Receive instance” flag on the file receiving activity:

The input file is detected and parsed by a file adapter. This is a special add-on to the Oracle BPEL engine which is based on WSIF. The file adapter acts like a partner link in the BPEL diagram. Note that the actual adapter is running in the BPEL engine, it’s not an external partner link. Creating a file adapter is very simple. The following shows some screenshots of the wizzard:

The file adapter holds it’s own parser. This parser is XSD based. There is even a wizzard that helps you create a XSD file:

The previous steps result in a XSD file which can be used by the file parser of the file adapter.

I finally created a (very very simple) PL/SQL procedure. The data found in the file is passed to this procedure and inserted in the database.

create or replace procedure fillAndre(a number, b number, c number, d number)
insert into andre values(a,b,c,d);

The invoke activity in the diagram invokes this procedure and that finishes up the BPEL process.

4 thoughts on “How to use the BPEL file adapter to load data into Oracle

  1. I am getting this error:

    <invalidVariables xmlns=””><part name=”code”><code>9710</code>
    </part><part name=”summary”><summary>Invalid xml document.
    According to the xml schemas, the xml document is invalid.
    The reason is: Error::cvc-complex-type.2.4.b: The content of element ‘readrecord’ is not complete. One of ‘{“”:C1}’ is expected.
    Please make sure that the xml document is valid against your schemas.

    any clue

  2. Hi

    Can you please give me links for the XML examples like “read xml filed using FileAdapter and then insert into DB”

    Thx in adv

Comments are closed.

Next Post

Citius, Altius, Fortius - Java Development met Oracle ADF en JHeadstart

We just published an article on ADF and JHeadstart 10.1.2 on our website: “Citius, Altius, Fortiusâ€? –Java Development met Oracle ADF en JHeadstart. It is written for and will be published in the June issue of Optimize, a Dutch Oracle Developer’s magazine. Unfortunately for some of you, it is in […]
%d bloggers like this: