Thursday 31 March 2016

File Transfer Based On File Size in SOA 11g



This project is used to transfer large number of files from source directory to destination directory with their same name and format of the files and based upon their file size.

Steps to create the composite are as follows:
1. Create three File adapters. One for read operation and remaining two for Write operation.
2. Configure these File adapters with proper File path location.
3. While Configuring File adapters make sure to check the Native format Translation is not required (Schema is opaque).
When that is checked, Any file(.txt,.xm,.csv) can be passed between directories.




4. Create a BPEL component with Define Service later template and connect the File adapters to BPEL.




5. Double click on BPEL process. Drag and drop receive activity and create instance with proper names for the input and output variables in receive activity.
6. Create a two more variables with string data type and name it as FileName_Variable and  FileSize_Variable.
7. Double click on receive activity and go to properties.
8. Add these variables as the adapter property values for jca.file.filename and jca.file.size.


9. After receive activity, Drag and drop switch activity and configure the switch with scenario like
If the file size is equal or more than 2000 bytes then, the file should transfer to one location.
Otherwise the file should transfer to another location.
10. Drag and drop the invoke activity for both the scenarios and invoke the file adapters to write the files.
11. Drag and drop the assign activity for both the scenarios and map the opaque elements from receive  output variable to file adapter input variables.




12. Double click on invoke activity and go to properties then, add the FileName_Variable variable as the  value for the jca.file.name property name and click on apply button.



13. Deploy and test it by moving some files into file reader path location.

Thank you.. !!