Appending to A File
One of the most handy functions (especially when using a File Adapter to log events) is the append functionality, once you have created a File Adapter (following the steps given in this guide or otherwise), you will need to do 2 things:
- The first thing is to locate the WSDL file for the File Adapter that you wish to convert to append mode, in order to do this, open up the File Adapter from the BPEL by double clicking on this, this will bring up the Edit screen for the File Adapter, simply look at the WSDL File field of the WSDL Settings section to get a complete path to the WSDL file for this File Adapter
- Once you have found the WSDL, open it and try to find the operation that you are using, go into its jca:operation node, and add the following properly:
Append="true"In my example, the section of the WSDL was:
... <operation name="Write"> <jca:operation PhysicalDirectory="C:\temp" InteractionSpec="oracle.tip.adapter.file.outbound.FileInteractionSpec" FileNamingConvention="myFile.txt" NumberMessages="1" OpaqueSchema="false" > </jca:operation> <input> <jca:header message="hdr:OutboundHeader_msg" part="outboundHeader"/> </input> </operation> ...
And I just added a new property after OpaqueSchema="false", the end result is:
... <operation name="Write"> <jca:operation PhysicalDirectory="C:\temp" InteractionSpec="oracle.tip.adapter.file.outbound.FileInteractionSpec" FileNamingConvention="myFile.txt" NumberMessages="1" OpaqueSchema="false" Append="true" > </jca:operation> <input> <jca:header message="hdr:OutboundHeader_msg" part="outboundHeader"/> </input> </operation> ...
Now save this change, redeploy and the write operation should be in append mode.