Understanding Native Schema Constructs

Native Format Builder Wizard 6-9 Table 6–5 shows the constructs applicable on all tags other than the schema tag. fieldValidation If set to true, then translator performs data type validation on the tokens read from the native. Note: The fieldValidation construct is supported for built in simple types only. validation If set to true, then the translator performs result validation both on the inbound and outbound. validateNxsd If set to true, then a thorough native grammar validation is performed. This construct is switched off by default and must be switched off in production for better performance. useArrayIdentifiers If set to true, then it optimizes the native framework for handling array identifiers. This may result in a performance hit for very large payloads. By default, arrayIdentifiers are not supported. parseBom If set to true, then the byte order mark is looked for in the native stream and encoding is derived from this. encodeLineTerminators If set to true, then the semantic interpretation of {eol} is \r\n instead of \n. Table 6–5 Constructs Applicable On All Tags Other Than the schema Tag Construct Description arrayIdentifierLength The length of the array being stored in the native data occupying the specified length arrayLength The value of this construct is used as the length of the array, which can also be a variable resolved to a valid number. This value overrides any minOccurs and maxOccurs attributes of the particle where it is specified. Use this feature as follows: nxsd:style=array nxsd:arrayLength=10 This indicates that the array length is 10. arrayTerminatedBy The last item in the array being terminated by the specified string assign Assigns a value to the variable that is declared cellSeparatedBy The cells of the array in the native data being separated by the specified string choiceCondition Either fixedLength or terminated conditionValue Matches the string read from the native stream for the choiceCondition construct, against the specified string in the conditionValue construct dataLines The value specified in this construct is used to translate only a portion of the data and not the entire data. dateFormat A valid Java date format representing the date in the native data identifierLength The number of characters and bytes in which the actual length of the data is stored itemSeparatedBy The items in the list being separated by the specified string leftSurroundedBy, rightSurroundedBy The native data surrounded Table 6–4 Cont. Constructs Applicable Only on the schema Tag Construct Description 6-10 Oracle Fusion Middleware Users Guide for Technology Adapters

6.2.2 Using Native Schema Constructs

This section includes the following topics: ■ Section 6.2.2.1, Defining Fixed-Length Data ■ Section 6.2.2.2, Defining Terminated Data ■ Section 6.2.2.3, Defining Surrounded Data ■ Section 6.2.2.4, Defining Lists ■ Section 6.2.2.5, Defining Arrays ■ Section 6.2.2.6, Conditional Processing ■ Section 6.2.2.7, Defining Dates length The length of the native data to be read. Used with fixed-length style. listTerminatedBy The last item in the list being terminated by the specified string lookAhead Looks for a match ahead of the current position in the input stream. If a match is found, then the node on which this construct is specified is processed; otherwise, it is skipped. Use this feature as follows: nxsd:lookAhead=20 nxsd:lookFor=abc This indicates to skip 20 characters and look for the string abc starting from that location. If this is found, then the node is processed; otherwise, it is skipped. paddedBy The string used for padding padStyle head, tail, or none quotedBy The native data being quoted by the specified string. By default, the specified string is quot; . If your data includes this character, you must override this default even if the field is not quoted. For more information, see Native Data Format to Be Translated: Data Includes Default Quote Character on page 6-15. skip Skips the specified number of bytes or characters skipLines Skips the number of lines specified skipUntil Skips until the string specified startsWith Looks for the specified string in the native data. If it exists, then proceeds with the element where it is specified; otherwise, skips and processes the next element. style The style used to read the native data from the input stream. Allowed values are fixedLength, surrounded, terminated, list, and array. surroundedBy The native data being surrounded by the specified string terminatedBy The native data being terminated by the string specified variable Declares a single variable variables Declares a set of variables or assigns the declared variables a valid value Table 6–5 Cont. Constructs Applicable On All Tags Other Than the schema Tag Construct Description Native Format Builder Wizard 6-11 ■ Section 6.2.2.8, Using Variables ■ Section 6.2.2.9, Defining Prefixes and Suffixes ■ Section 6.2.2.10, Defining Skipping Data ■ Section 6.2.2.11, Defining fixed and default Values ■ Section 6.2.2.12, Defining write ■ Section 6.2.2.13, Defining LookAhead ■ Section 6.2.2.14, Defining outboundHeader ■ Section 6.2.2.15, Defining Complex Condition in conditionValue ■ Section 6.2.2.16, Defining Complex Condition in choiceCondition ■ Section 6.2.2.17, Defining dataLines ■ Section 6.2.2.18, Defining Date Formats with Time Zone ■ Section 6.2.2.19, Implementing Validation During Translation ■ Section 6.2.2.20, Processing Files with BOM

6.2.2.1 Defining Fixed-Length Data

Fixed-length data in the native format can be defined in the native schema by using the fixed-length style. There are three types of fixed length: ■ With padding ■ Without padding ■ With the actual length also being read from the native data Native Data Format to Be Translated: With Padding The actual data may be less than the length specified. In this case, you can specify paddedBy and padStyle as head or tail. When the data is read, the pads are trimmed accordingly. The following is a sample native data to be translated: GBPUK000012550.00 Native Schema: With Padding ?xml version=1.0 encoding=US-ASCII? schema xmlns=http:www.w3.org2001XMLSchema xmlns:nxsd=http:xmlns.oracle.compcbpelnxsd targetNamespace=http:www.oracle.comiasprocessconnect elementFormDefault=qualified attributeFormDefault=unqualified nxsd:stream=chars nxsd:version=NXSD element name=fixedlength complexType sequence element name=currency_code nxsd:style=fixedLength nxsd:length=4 nxsd:padStyle=tail nxsd:paddedBy= simpleType restriction base=string maxLength value=4 restriction simpleType element