This page explains the Flat File Adapter in Bridge context. If you were looking for the same information regarding the PAS Designer, refer to Flat File Adapter in the Designer guide.
Tagged Values
Class <<FlatFile>>
This is the root record of the flat file declaration. This class cannot have any attributes, only associations to <<FlatFileRecord>> classes and <<FlatFileGroup>> classes are allowed.
| Tagged Value | Description | Allowed Values | Example | |
|---|---|---|---|---|
| escapeCharacter | Defines the character used for escaping when a reserved character is used within a field value. | any character | / |
|
| fillCharacter | Defines a dummy character to fill non-existent values (results in NULL). Used for fixed attribute layout only. | any character | 0 |
|
| quoteCharacter | The quoteCharacter will be ignored by reading field value. | any character | / |
|
| recordSeparator | Separator of the different records, normally line feed and carriage return. For serialized files, any other character can be defined. | any character or one of | <newline> |
|
<esc> |
|
|||
<newline> |
parses correctly on Unix and Windows platforms | |||
<space> |
|
|||
<tab>
<tabulator> |
|
|||
<unixnewline> |
composes newline | |||
<windowsnewline> |
composes newline and carriage return | |||
| reservedCharacters | Defines a list of characters to be escaped automatically when the file is composed. | any character | {"/", "%", "&", "(", ")"} |
|
Class <<FlatFileRecord>>
This class describes the attributes of a record. A record is one "line" in a file and can consist of multiple attributes.
There were errors rendering macro:
- An unknown error occurred.
Class <<FlatFileGroup>>
This class is used to group multiple records into one (virtual) structure. A group does not have a representation in the flat file itself.
| Tagged Value | Description | Allowed Values | Example | |
|---|---|---|---|---|
| pattern |
Error rendering macro 'multiexcerpt-include' : Page loading failed
|
any character | ^Pattern.* |
|
| a valid regular expression | ||||
Class <<FlatFileSubRecord>>
| Tagged Value | Description | Allowed Values | Example | |
|---|---|---|---|---|
| condition | A condition that must evaluate true if the record exists. The condition can refer to a self object which represents the current state of the parent. | any valid conditional expression | self.UNS.exists() |
|
| evaluationOrder | Defines the order in which the associations starting on same parent class must be processed, see Flat File Adapter Parsing Process. | any integer |
|
|
| offset | Define the position of this record in the flat file, starting with 0 for the first record and always relative to the parent element. | any integer |
|
|
Attribute <<FlatFileAttribute>>
Fixed Layout
| Tagged Value | Description | Allowed Values | Example | |
|---|---|---|---|---|
| decimals | Replaced by format.
|
|
|
|
| externalLength | Number of characters of the field (only for fixed length records relevant). | any integer |
|
|
| format |
Pattern for formatting numeric and date & time values. For details see Number Formatting respectively Date and Time Formatting. |
any valid number or dateTime pattern | S9G999G990D00
%Y.%m.%d-%H:%M:% |
|
| nativeTyp deprecated | Replaced by format. |
|
|
|
| order | The evaluation order of the attributes. If offset is not used, order reflects the field number within the record. | any integer |
|
|
| offset | The character position of this field within the record. | any integer |
|
|
| padding | Defines the padding rule for the field. When parsing, the characters on the left or right side are ignored up to the first different character. When composing, the field is filled on the left or right side with the specified character. | left("<any character>") | left("0") |
|
| right("<any character>") | right(" ") |
|||
| suppressEscaping |
Error rendering macro 'multiexcerpt' : Page loading failed
|
true | attribute values of this attribute will not be un-escaped (parser) or escaped (composer) |
|
| false | escaping/un-escaping is not suppressed | |||
| parseMacro |
A macro that is executed while parsing/composing a file or complex field. This macro can contain multiple commands separated by commas or spaces. Macros on classes are executed before the processing of its attributes or associations. The ID represents a counter. The following counters are available:
Automatic counters are increased by 1 for each processed record. Custom counters have to be increased manually using the increase macro. All counters have the initial value of 0 when they process the first record. For more details on macro commands see Macro Expressions . |
any valid macro expression (see Macro Expressions) | GetCounter(0) |
|
| composeMacro | ||||
Separated Layout
| Tagged Value | Description | Allowed Values | Example | |
|---|---|---|---|---|
| format |
Error rendering macro 'multiexcerpt-include' : Page loading failed
|
|
|
|
| order | The evaluation order of the attributes. If offset is not used, order reflects the field number within the record. | any integer | ||
| offset | The relative position of the field in respect of the other fields in the record, e.g. field number 3 has offset = 2. | any integer |
|
|
| suppressEscaping |
Error rendering macro 'multiexcerpt-include' : Page loading failed
|
|
|
|
| parseMacro |
Error rendering macro 'multiexcerpt-include' : Page loading failed
|
any valid macro expression (see Macro Expressions) | GetCounter(0) |
|
| composeMacro | ||||
Attribute <<FlatFileComplexAttribute>>
This class is used to divide fields into sub-fields. You can think of this like a <<FlatFileRecord>> placed within a single field.
There were errors rendering macro:
- An unknown error occurred.
Action "parse"
| Tagged Value | Description | Allowed Values | |
|---|---|---|---|
| resource |
Instead of specifying parameters name or data for the parse flat file action (see section Flat File Adapter Reference#Parameters below), you can import the file to be parsed as a resource to your Builder project (see Importing File Resources). Specify the name of this resource here. The resource can be replaced changing the resource path in the Flat File Parser/Composer settings of the xUML service. See xUML Service Settings for more information on changing the settings of a service.
|
any valid imported file resource added to the component diagram | |
Parameters
Action "compose"
| Name | Type | Direction | Mandatory | Description | Allowed Values | Example | |
|---|---|---|---|---|---|---|---|
| <any> | <<FlatFile>> class | in | Provide an object containing the flat file data. The class defining the type of this object should have stereotype <<FlatFile>> and should depict the structure of the file. |
|
|||
| encoding | String | in |
|
Provide the encoding of the file to be composed as specified in the Charset Definitions appendix. | any valid encoding (see Charset Definitions) | UTF-8 |
|
| default | ISO-8859-1 (Latin1) |
|
|||||
| locale | NumbersLocale | in |
|
Specify how number values will be treated, when written to the flat file (decimal point, currency symbol, ...). You can overwrite the system locales here. Refer to Number Formatting for more information. | default | system locales |
|
| name | String | in | ( |
Specify a full path to the flat file, if you want to write the <<FlatFile>> object to the file system.
Alternatively, you can compose the flat file to a Blob object (see parameter data). Note, that the name parameter takes priority over data. |
|
tmp/myFlatFile.txt |
|
| data | Blob | out | ( |
If you want to compose the <<FlatFile>> object to a Blob object, use this parameter as output of the compose action.
Alternatively, you can write the composed flat file directly to the file system (see parameter name). Note, that the name parameter takes priority over data. |
|
|
|
Action "parse"
There were errors rendering macro:
- An unknown error occurred.
Parameter Types