Sie sind auf Seite 1von 16

Here we are going to demonstrate how to merge (insert + update) data into the database

We have to read data from the file and insert the data into the table.

Create a BPEL with Define service later.

Now your Composite.xml should look like below:

Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com
Open the BPEL. Your BPEL should look like below:

Now create a File adapter to read the data(either physical path or logical path). Wire the adapter to BPEL.

Now your Composite.xml will look like below.

Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com
Now create employee table to store the employee file content.

Run the following script.

create table employee(eno varchar2(5),

ename varchar2(30),

esal varchar2(10),

ephoneNumber varchar2(20));

Now take database adapter and navigate till operation window:

Here select the Inser or update (merge) as shown below:

Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com
Click on Next>

Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com
Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com
Click on Import Tables and import the employee table you have created just now.

After importing your window will look like below:

Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com
Click on Next>

In the next screen select eno as the primary key as shown below:

Click on Next>

Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com
Click on Next>

In the next screen select all the columns as shown below:

Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com
Click on Next>

Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com
Click on Next>

Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com
Click on Finish.

Now your composite.xml will look like below:

Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com
Now wire the dbadapter to BPEL.

Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com
Now open the BPEL. Your BPEL should look like below:

Now take a receive activity, wire to file adapter and configure it as shown below:

Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com
Now click on apply and ok.

Now your BPEL should look like below:

Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com
Now take invoke activity after receive activity and wire it to database adapter.

Your Invoke configuration will look like below:

Now click on Apply.

Your BPEL should look like below:

Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com
Now take a transform activity and transform file content to invoke(DB).

Now your BPEL should look like below:

Now make, deploy and test the service.

Now modify the file content as shown below and test the service again

1,murali,20000,9848054321 this record will be updated.

2,mohan,20000,9848012342

3,pradeep,20000,9848012343

4,rajesh,20000,9848012344

5,pandu,20000,9848012346

6,krishna,45000,984804563 this record will be inserted.

Friendz Corps
Suit #203, B S Residency, B K Guda Road, S R Nagar, Hyderabad-16
Mob: +91 8143 649946, Lnd: +91 40 66733228, Mail: training@friendzcorps.com
www.friendzcorps.com