I was working on one of the requirement in which we need to read the file in between the Bpel process i.e. File Adapter is not triggering the bpel process but inside the bpel process file adapter is triggered to get the file.
Here in this post I am taking a small example to make you guys understand that what this option in file adapter means.
Scenario
In my example I am using a two file adapters one is writing of file and other is sync read of file. Well writing file adapter I used just to create a xml file so that I don't have to create manually. In the second adapter i.e. Sync Read File adapter I am passing the name of the file that is created by write file adapter. I put the same directory for write and read i.e. "G:\Anshul\SyncRead" and for archiving "G:\Anshul\Archive\SyncRead".
Steps:
Here in this post I am taking a small example to make you guys understand that what this option in file adapter means.
Scenario
In my example I am using a two file adapters one is writing of file and other is sync read of file. Well writing file adapter I used just to create a xml file so that I don't have to create manually. In the second adapter i.e. Sync Read File adapter I am passing the name of the file that is created by write file adapter. I put the same directory for write and read i.e. "G:\Anshul\SyncRead" and for archiving "G:\Anshul\Archive\SyncRead".
Steps:
- Create SOA Application and then SOA project.
- Create schema file, I have created Info.xsd.
- Drag n drop, File Adapter to reference lane and configure for write operation.
- Again drag n drop File Adapter to configure Sync Read File operation
- Create Bpel Process and exposed this bpel process as SOAP webservice.
- After that wired all the components and you composite looks like below.
- Now Inside the bpel process, assign the filename to write the file and same file name to be passed to Sync Read File adapter.
- Create a local variable i.e. FileNameVar and put the value concat("Info_",ora:getComponentInstanceId,".xml") this is xpath function which generates the file name like Info_10001.xml
- Now pass the above file name in Invoke activity of both the file adapter.
- Apply the Request/Response transformation to invoke variables.
- Save, deploy and test.
You can download the code from here : com.codeconfuse.soa.FileSyncRead
No comments:
Post a Comment