465 total views, 0 views today

How to Read a File using Oracle BPEL File Adapter Example

 

In this post, I have explained how to read a File using Oracle BPEL File Adapter. The Oracle BPEL process explained in this post do the following steps

 

1. Looking for any new text file in a directory

2. Read the text file and prints it to the Audit trail

3. Deletes the file

 

Let’s begin the example. This project is available at the end of the post. 

 

Oracle BPEL Read File

 

First, I inserted a File adapter in the composite so that we can use it in the BPEL process; To include a File Adapter,  Open the composite, right-click on the Exposed Services >> Insert >> File

 

 

121117_0550_HowtoReadaF1 How to Read a File using Oracle BPEL File Adapter Example

 

 

2. Input a Name and click Next

 

121117_0550_HowtoReadaF2 How to Read a File using Oracle BPEL File Adapter Example

 

3. Select as shown below as Next

 

121117_0550_HowtoReadaF3 How to Read a File using Oracle BPEL File Adapter Example

 

4. Accept the default and click Next

 

121117_0550_HowtoReadaF4 How to Read a File using Oracle BPEL File Adapter Example

 

5. Select Read File and click Next

 

121117_0550_HowtoReadaF5 How to Read a File using Oracle BPEL File Adapter Example

 

6. Specify a directory where you want to read files; If you enable Delete Files after successful retrieval then the BPEL process delete the file after the read completed.

 

121117_0550_HowtoReadaF6 How to Read a File using Oracle BPEL File Adapter Example

 

7. Input file pattern; It reads the file as per the pattern specified

 

121117_0550_HowtoReadaF7 How to Read a File using Oracle BPEL File Adapter Example

 

8. I used Polling Frequency as 5 seconds so every 5 seconds it looks for a new file

 

121117_0550_HowtoReadaF8 How to Read a File using Oracle BPEL File Adapter Example

 

9. I used Native format. We can select XSD as well; Click Next and Finish

 

121117_0550_HowtoReadaF9 How to Read a File using Oracle BPEL File Adapter Example

 

10. Wire the File adapter and the BPEL process

 

121117_0550_HowtoReadaF10 How to Read a File using Oracle BPEL File Adapter Example

 

11. The BPEL process receives the File payload in a variable ‘File’ which is an Opaque data type;

 

121117_0550_HowtoReadaF11 How to Read a File using Oracle BPEL File Adapter Example

 

12. Next, the File payload is copied over to a new variable ‘encodedData’ of base64Binary datatype

 

121117_0550_HowtoReadaF12 How to Read a File using Oracle BPEL File Adapter Example

 

13. Below is the Java Embedded activity which decode the base64Binary into String type and prints it in the Audit trail

 

 

 

 

14. Here I have created a file 121.txt in a directory; Note the content of the file

 

121117_0550_HowtoReadaF13 How to Read a File using Oracle BPEL File Adapter Example

 

15. The Java Embedded activity prints the content of the file in the Audit trail

 

121117_0550_HowtoReadaF14 How to Read a File using Oracle BPEL File Adapter Example

 

Download the Oracle BPEL File Adapter Project 

 

govindan How to Read a File using Oracle BPEL File Adapter Example
Connect me

Govind

Thank you for visiting my personal blog. Myself Govindan, Software Developer by profession since 2006 and hence I started this blog early in 2016 and ever since I've been writing about technologies experienced and learnings of everyday life.

The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.

Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply šŸ™‚
govindan How to Read a File using Oracle BPEL File Adapter Example
Connect me
By | 2017-12-11T01:08:46+00:00 December 11th, 2017|Categories: BPEL|Tags: , , |Comments Off on How to Read a File using Oracle BPEL File Adapter Example
Like us on Facebook.
Connect!