There is a feature in Oracle File or FTP adapter to read a large file in chunks/parts. The property name to set in file or ftp adapter .jca file is:
<property name="ChunkSize" value="10"/>
The value is the number of chunks or parts, you can specify the number you want. There is no specific option to select while creating File or FTP adpater, simply add the property to the .jca file after the adpater is created.
The .jca file look like below:
<interaction-spec className="oracle.tip.adapter.file.outbound.ChunkedInteractionSpec">
<property name="DeleteFile" value="true"/>
<property name="PhysicalDirectory" value="/temp"/>
<property name="FileName" value="dummy.txt"/>
<property name="ChunkSize" value="10"/>
</interaction-spec>
<property name="DeleteFile" value="true"/>
<property name="PhysicalDirectory" value="/temp"/>
<property name="FileName" value="dummy.txt"/>
<property name="ChunkSize" value="10"/>
</interaction-spec>
After modifying the .jca file, you have to handle the file read through invoke activity in BPEL, that is adding the invoke activy in while loop with condition to check for end of file. The below is the invoke property for end of file:
<bpelx:fromProperty name="jca.file.IsEOF" variable="<Variable>"/>(returnIs End Of the File)
Below are some of proeprties of file inovke for your information,
<bpelx:fromProperties>>
<bpelx:fromProperty name="jca.file.LineNumber" variable="<Variable>"/> (Returns Line Number)
<bpelx:fromProperty name="jca.file.ColumnNumber" variable="<Variable>"/>(returnColumnNumber)
<bpelx:fromProperty name="jca.file.IsEOF" variable="<Variable>"/>(returnIs End Of the File)
<bpelx:fromProperty name="jca.file.IsMessageRejected" variable="<Variable>"/>(returnIs Message Rejected)
<bpelx:fromProperty name="jca.file.RejectionReason" variable="<Variable>"/>(returnRejectionReason)
<bpelx:fromProperty name="jca.file.NoDataFound" variable="<variable>"/>(returnNoDataFound)
</bpelx:fromProperties>
<bpelx:fromProperty name="jca.file.LineNumber" variable="<Variable>"/> (Returns Line Number)
<bpelx:fromProperty name="jca.file.ColumnNumber" variable="<Variable>"/>(returnColumnNumber)
<bpelx:fromProperty name="jca.file.IsEOF" variable="<Variable>"/>(returnIs End Of the File)
<bpelx:fromProperty name="jca.file.IsMessageRejected" variable="<Variable>"/>(returnIs Message Rejected)
<bpelx:fromProperty name="jca.file.RejectionReason" variable="<Variable>"/>(returnRejectionReason)
<bpelx:fromProperty name="jca.file.NoDataFound" variable="<variable>"/>(returnNoDataFound)
</bpelx:fromProperties>
No comments:
Post a Comment