You are on page 1of 39

BPEL FILE ADAPTER TUTORIAL

Page 1 of 39

Articles

Questions

Subscribe

Testimonials

HO ME ARTICLES INTERV IEW QN'S VIDEO ARTICLES SCRIPTS

ABOUTUS

CONTACT

Login

Signup

Financials | Manufacturing | Tools | General | iExpenses | Payables | Receivables | Purchasing | Order Management | Forms | Reports | Workflow | PL/SQL | Personalization

Ads by Google

BizTalk

BizTalk SQL Adapter

Wizard

Process Control

Ads by Google Text File Editor Window XP Create XML SiteMap ERP Tutorial
Sponsored Links

BPEL File Adapter Tutorial


Test & Validate XML Automate Tests & Validate for Secure XML WS.
www.parasoft.com

Author
Name: E -mail: prudhvi prudhvi@erpschools.com

Translation Service 5-second online quote, including price and delivery date
http://www.translated.net

AJAX Client SOA Bind to WSDL / REST, XML or JSON. View live examples & full docs
www.SmartClient.com

WebLogic & AquaLogic Training, Architecture, Design, Implementation and Admin


www.crossvale.com

Open .PUB File Instantly Fix and Open/Run .PUB File. Free Download - takes 2 mins.
Driversdownloadhub.com/.pub

Free OTM (G-Log) Support Free OTM / G-Log GC3 Support Forums Learn from OTM Experts!
www.otmfaq.com

$79/Hr Job - 434 Openings Make $79/hr Working From Home. As Seen On CNN,NBC,& Fox News
www.TheNewsSearch.com/ms

In this tutorial I will explain how to read a CSV file using ReadFileAdapter and then to write a CSV file using WriteFileAdapter. We dont have tw o separate FileAdapters but based on the read and write operation we mention them as ReadFileAdapter or WriteFileAdapter. logic defined and post the XML messages. ReadFileAdapter will Receive the input data from file and translate the data based on the translation WriteFileAdapter will receive the XML messages and translate it into actual data Overview: In this tutorial I will explain how to read a CSV file using ReadFileAdapter and then to write a CSV file using WriteFileAdapter. We dont have two separate FileAdapters but based on the read and write operation we mention them as ReadFileAdapter or WriteFileAdapter. ReadFileAdapter will Receive the input data from file and translate the data based on the translation logic defined and post the XML messages. WriteFileAdapter will receive the XML messages and translate it into actual data and write to a file.

...

A&R Financial Associates Alex Araz - Partner Personal Income Tax Services
www.arfinancial.biz

Interpretext Translations Your Official Language Solution - 100% Satisfaction Guarantee


http://www.interpretext.com/

FileAdapter supports the following file formats. 1. 2. XML Delimited (Delimiter can be anything)

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 2 of 39

3.
Open Source BPEL Server Design with BPMN. Execute on our best of breed BPEL Engine
www.intalio.com

Fixed position Binary Data

4.

You dont need to use both ReadFileAdapter and WriteFileAdapter in a single process, for example you can read the data from file using ReadFileAdapter and write data to a database using DBAdapter. In other way you can get the data from a database and write it to a file using WriteFileAdapter. This is purely based on the business requirement and up to us how we are going to use them. System Requirements: 1. jDeveloper 10.1.3 SOA Suite 10.1.3 Start the SOA Suite Create Application Server Connection Create Integration Server Connection 2. 1. 2. 3.

Process Server UK based Process Servers Process Serving nationwide

Connections Required:

www.slsinvestigations.co.uk/

OSS Fast Infoset Tools Fast, compact XML without a schema Ideal for embedded devices. Evals.
www.oss.com

Start the SOA Suite: If you dont have SOA Suite already installed on your machine click here to download and install it. If you have SOA Suite installed on your machine navigate Start >> All Programs >> Oracle - >> Start SOA Suite

Free WebSphere Articles Detailed WebSphere Insights Written By Professionals


www.webspheretools.com

FileMaker XML FileMaker XML/XSLT Experts Products, Consultation, Training


www.chapsoft.com

Once your Application Server starts successfully you will see the screen below

Create Application Server Connection Navigate to Connection Navigator by clicking view >> Connections Navigator or by pressing Ctrl + Shift + o

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 3 of 39

Right click on Application Server and click New Application Server Connection

Wizard opens with welcome screen

Click Next

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 4 of 39

Connection Name: AppServerConnection1 (you can change it to anything) Connection Type: Oracle Application Server 10g 10.1.3

Click Next

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 5 of 39

Username: oc4jadmin Password: welcome1(this is the default password, if you have changed it use your own password) Click next

Leave everything as it is and click next And then press Test Connection

If you receive the Status as Success! You are good to proceed. If you get any errors make sure your application server is running and try again. Click Finish to close the wizard and return to Connection Navigator. Create Integration Server Connection Go to Connection Navigator by pressing Ctrl+Shift+o

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 6 of 39

Right click on Integration Server

By Clicking the New Integration Server Connection wizard opens up with welcome screen.

Click Next

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 7 of 39

You can leave the Name as it is or change it if needed Click Next

Application Server: Select the Application Server you created in first step. If you have only one application server it will be automatically selected. Hostname: localhost Port Number: 8888 Click Next

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 8 of 39

Click Test Connection

If you receive the following message you connection is successful. Application Server: OK BPEL Process Manager Server: OK ESB Server: OK Click finish to close the wizard Create New Application Open Application Navigator by clicking Ctrl+Shift+A or go to view >> Application Navigator

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 9 of 39

If you have any Application exists you can create your BPEL process under that if not creation new application by right clicking the Applications and selecting New

Change the application name as you need and leave all the remaining things as default and click OK

Click Cancel to cancel the project. We will create new project manually by selecting the BPEL Process project in next step. Create New BPEL Process Right Click on the Application that we created and click New Project

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 10 of 39

Wizard opens as shown

Select BPEL Process Project and click OK

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 11 of 39

Change the Name(optional) and Template: Empty BPEL Process Click Finish. If you expand the BPEL Process you can see the files below which are created by default.

Middle panel of jdeveloper opens BPELProcess.bpel file automatically if not open it by double clicking on the file shown in the above figure.

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 12 of 39

In the .bpel file you can see 3 regions 1. 2. 3. Services(Left Side) Main Activity Region Services(Right Side)

On the Right Side of your screen you can see the component palette.

From the dropdown select Services if it is not selected.

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 13 of 39

From services select File Adapter

Drag it to Services region on left and leave it. Automatically Adapter Configuration Wizard will pop up showing the welcome screen

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 14 of 39

Click Next

Enter Service Name as ReadFileAdapter since we are going to use this adapter for reading the file. Click Next

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 15 of 39

Select ReadFile and click Next

Select the Physical Path option and select the path where you CSV file is placed. I have placed by .CSV file in the C:\readfile directory Deselect the option Delte files after successful retrieval Click Next

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 16 of 39

Enter the patten name in Include Files with Name Pattern I have entered erpschools*.txt which means that all the files starting with erpschools word prefix will be picked for processing. Ex: erpschools.txt will be picked erpschools1.txt will be picked erpschools2.txt will be picked 1erpschools.com will not be picked. Click Next

Leave the default values and Click Next

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 17 of 39

Click on Define Schema for Native Format button

Navtive Format Builder Wizard will pop up with welcome screen. Click Next

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 18 of 39

Select Delimited option and Click Next

Select your delimited file. My Delimited file looks like this

Click Next

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 19 of 39

Since our file contains only one record select first option and Click Next

Namespace: leave default value Enter a name for element that will represent record: readrecord Click Next

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 20 of 39

Click Next

Change the column names and types as needed and Click Next

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 21 of 39

.xsd(XML Schema Definition) file will created by default Click next

Click Finish to go back to Adapter Wizard

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 22 of 39

Schema Location and Schema Element will be populated with the values that we created just now. Click next

Click Finish

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 23 of 39

Create Partner Link window will show up as above Click OK

Now you should be able to see the ReadFileAdapter in the services region as shown above Now in the component Palette select Process Activities

Select Receive component and drag it to main region When you move the component to main region it will change the color to yellow then you can drop it.

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 24 of 39

Double click on Receive_1 component to edit

Click on Flash light right to to the Partner Link Field

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 25 of 39

Select ReadFileAdapter and click O K

Now Partner Link and operation fields will be populated as shown Click on Auto Create button right to Variable to create new variable. If you dont understand which icon to click place your cursor on the icons and you can see the hint text

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 26 of 39

Click OK

Check Create Instance box and click apply Click OK Now the figure looks like this

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 27 of 39

There is a link created from ReadFileAdapter to Receive_1 component Create WriteFileAdapter Go to component palette and select services from drop down Select the drag FileAdapter to Services region on the right side FileAdapter Wizard will open with welcome screen as shown below

Click Next

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 28 of 39

ServiceName: WriteFileAdapter Click Next

Select Write File option Click Next

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 29 of 39

Enter Directory path and file naming convention as shown above. %SEQ% will increase the numbers from 1 onwards which means if you have 10 files to write then your file names will be erp_1.txt, erp_2.txt, erp_3.txt ..erp_10.txt Click Next

Click Browse to select the schema file that we already created before

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 30 of 39

Select readrecord Click OK

Click Next

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 31 of 39

Click Finish to close the wizard

Click Apply and OK

WriteFileAdapter will showup in the right Services region as show above Now go to Component palette and select Process Activites Select Invoke Component from component palette and drop it below the Receive_1 component

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 32 of 39

Double click on Invoke_1 component to edit it

Click Flash light to select the partner link

Click ok

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 33 of 39

Click Automatically create input variable icon to create new variable

Click ok

Click Apply and OK

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 34 of 39

Now drag and drop the Transform component below the Receive_1 component and above Invoke_1 component

Double click on Transform_1 component to edit the settings

Select as follows Source variable: Receive_1_Read_InputVariable Target variable: Invoke_1_Write_InputVariable

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 35 of 39

Click Apply and OK

Transformation_1.xsl file will open as show above select tns:readrecord in source and drag it to tns:readrecord on target to map the fields.

Auto Map Preferences will pop up as shown above Click OK to auto map

All fields will be mapped automatically as shown above Now select BPELProcess.bpel file on top and click validate icon to validate the process

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 36 of 39

Once it is validated with out errors we are ready to deploy the process Deploy BPEL Process Right click on BPEL Process and select Deploy option as shown below

If you have this process already on server it will pop up with version number if not it will start deploying the process

If your deployment is successful you will see the message BUILD SUCCESSFUL. Initiate BPEL Process Open your browser and type the following URL

http://localhost:8888/BPELConsole If your hostname is different change it in the URL

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 37 of 39

Username: oc4jadmin Password: welcome1(default) Login You can see the list of deployed BPEL Process on the left panel as shown below

Click on the process we deployed right now

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 38 of 39

You will be taken to Initiate screen where you have option to post XML Message Now your process has initiated Go to your writefile directory to see your file

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

BPEL FILE ADAPTER TUTORIAL

Page 39 of 39

Comments Box Name: Email:

c d e f g Receive email on comment updated

No comm ents yet! Post Cancel

Copyright 2007 www.erpschools.com

http://www.erpschools.com/Apps/oracle-applications/articles/Fusion-Middleware/SOA/BP... 9/25/2009

You might also like