Monday 16 May 2016

Oracle SOA 12C - File Adapter

File Adapter 


Its one of the simplest adapter in the Oracle SOA suite and we are going to take this adapter for 

1. Reading file.
    a.  Initiator Process
    b. Sync Read.

2. Writing file 
   a.   New File
   b.  Appending a file.




This example illustrate both the example of reading a file and writing a file. We will also focus some of the out of box options this adapter provides.  This adapter also follow the JCA pattern, to learn more about adapter design pattern see our last blog.


1. Reading File :- 

  We are using this option to read the file and get the data inside the SOA process, for processing.  There could be two different ways of reading the file first, our process is live and polling on single or multiple directories and once it found the file it process the file and either delete or archive the file(s).

 Second option is sync read which provide us a choice to read the file from a directory when we want. In this case we can read like in the middle of a SOA process.

Download Activity2.zip file and open this, This is a very simple application with file reading capability.


 a. In this example we are reading simple xml file and counting the records. Testfiles are been put in the testsuit directory.

  Here are some steps to configure file adapter


    a. In the Composite drag and drop file adapter to partner link, it will start the wizard.  Give any name to your file adapter.


b. Lets accept default for next 2 screens.


c. Now we want first to read file choose for read operation. We are going to discuss all the other operations in some others blogs.


 d.  Now choose a directory where you will upload the files.


e. Provide the pattern of your files, we have selected to upload files of all kind of names but you can choose any single type.


f. Now decide on polling frequency on the folder, composite will keep on checking folder with this frequency.


g. Now we have used the employee.xsd as the schema for the file. We have already described about this xsd in one of your earlier blog.



 h. Now file adapter is configured.




In the example given we are initiating a BPEL process from the file adapter, hence once its read the file successfully it initiate the BPEL process.


 Testing Adapter 

   1. Once we add a file from the testsuite to destination folder it process the file automatically and create the instance.

  
 2. Instance can very much self expalnatory that it initiate the BPEL and provide inputs to file BPEL process.
 3. This screenshot describe the inputs we received from the file adapter.





 Play with this example, try to change configurations and see what change can make it behave differently. We are going to share some other technique with file adapter very soon.

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete