1 Reply Latest reply: Nov 1, 2012 6:40 PM by vladodias RSS

    ChunkedRead File Adapter for fixed length schema

      We have an interface which reads the records in a file in a chunk through File adapter - ChunkedRead.

      The schema used for chunk read is of fixed length type and uses padStyle and paddedBy properties. In BPEL, we have a while loop logic to check if outIsEOF = 'false', within that we have an invoke activity to read the xml file.

      The following is set within invoke action,

      <bpelx:fromProperty name="jca.file.IsEOF" variable="returnIsEOF"/>

      and an assign action within while will assign the value of returnIsEOF to outIsEOF, to process through loop.

      When we execute, the process is picking up first record in the file and the value returned for *'returnIsEOF' is true*. hence the loop exits without processing next records. Please help me to understand if am missing out anything.


      <?xml version='1.0' encoding='UTF-8'?>
      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" xmlns:extn="http://xmlns.oracle.com/pcbpel/nxsd/extensions" targetNamespace="http://TargetNamespace.com/XXX" xmlns:tns="http://TargetNamespace.com/XXX" elementFormDefault="qualified" attributeFormDefault="unqualified" nxsd:version="NXSD" nxsd:encoding="ASCII" nxsd:byteOrder="bigEndian" nxsd:stream="chars">
      <xsd:element name="Root-Element">
      <xsd:element name="RECORD" minOccurs="1" maxOccurs="unbounded" nxsd:style="array" nxsd:cellSeparatedBy="${eol}">
      <xsd:element name="DATE" type="xsd:dateTime" nxsd:dateFormat="yyyyMMdd" nxsd:style="fixedLength" nxsd:length="8"/>
      <xsd:element name="LOC" type="xsd:string" nxsd:style="fixedLength" nxsd:*padStyle*="tail" nxsd:*paddedBy*=" " nxsd:length="4"/>
      <xsd:element name="AMOUNT" type="xsd:decimal" nxsd:style="virtualDecimal" extn:assumeDecimal="10" extn:picSize="12"/>
      <xsd:element name="DEPOSITTYPE" type="xsd:string" nxsd:style="fixedLength" nxsd:padStyle="tail" nxsd:paddedBy=" " nxsd:length="3"/>
      <xsd:element name="SERIAL-NUM" type="xsd:string" nxsd:style="fixedLength" nxsd:padStyle="tail" nxsd:paddedBy=" " nxsd:length="4"/>
      <xsd:element name="LOG-NUM" type="xsd:string" nxsd:style="fixedLength" nxsd:padStyle="tail" nxsd:paddedBy=" " nxsd:length="10"/>
      <xsd:element name="BAG-NUM" type="xsd:string" nxsd:style="fixedLength" nxsd:padStyle="tail" nxsd:paddedBy=" " nxsd:length="7"/>
      <xsd:element name="CASH-FLG" type="xsd:string" nxsd:style="fixedLength" nxsd:padStyle="tail" nxsd:paddedBy=" " nxsd:length="1"/>
      <xsd:element name="FILLER" type="xsd:string" nxsd:style="fixedLength" nxsd:padStyle="tail" nxsd:paddedBy=" " nxsd:length="11"/>

      XML chunk file:

      201208100004+00000150000PTY0000010900 40411101234567890A
      201208100061+00000150000PTY0006010900 10411101234567890B
      201208100061+00000150000PTY0006010900 10411101234567890C
      201208100004+00000000500MIS0000010900 40411101234567890D
      201208100061+00000075000MIS0006010900 10411101234567890E
        • 1. Re: ChunkedRead File Adapter for fixed length schema

          There may be a problem on the NXSD causing an invalid payload... See the following paragraph extracted from the docs...

          If an invalid payload is provided, then ChunkedRead scenarios do not throw an exception. When a translation exception (bad record violating the NXSD specification) is encountered, the return header is populated with the translation exception message that includes details such as line and column where the error occurred. All translation errors do not result in a fault. These errors are manifested as a value in the return header. You must check the jca.file.IsMessageRejected and jca.file.RejectionReason header values to ascertain whether an exception has occurred. Additionally, you can also check the jca.file.NoDataFound header value.