Flat File Adapter Parsing Process
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.
The Flat File adapter parse action processes the parsing of a flat file in the following steps:
Step | Description | ||
---|---|---|---|
open | Open file or blob. | ||
file | Create <<FlatFile>> object. | ||
fetch | Fetch first record. | ||
check | Go through all associations (<<FlatFileRecord>> and <<FlatFileGroup>> classes) until the first one matches depending on the tagged values evaluationOrder, lineNuber, condition, and pattern. | ||
out | If no association matches, step out of the recursion and go to step check, abort with an error if there is no parent. | ||
group | If a group matches, create a <<FlatFileGroup>> object and goto step check. | ||
record | If a record matches, create a <<FlatFileRecord>> object. | ||
attribute | If the <<FlatFileRecord>> class has attributes, process attributes using current record data. | ||
next | Fetch next record. | ||
close | Close file and end Flat File Adapter. |
The following example shows the parsing process for a given class diagram. The names in the figure refer to the actions in the above table.
Figure: Flat File Adapter Parsing Process
Inspecting the Parsing Process With the Scheer PAS ANALYZER
You can inspect the parsing process of the Flat File Adapter with the Analyzer. To view the parser trace file:
- Run a testcase with Full Trace option
- Open the UML Tab in the Analyzer
- Navigate to the activity diagram that contains the Flat File Adapter action.
- Click on the <<FlatFileAdapter>> action.
- Select Show adapter input/output > OUTPUT from the context menu.
The adapter output will be displayed in the Watches section of the Analyzer. - Right-click the displayed adapter output output and select Copy Value from the context menu.
- Paste the copied content into a text editor of your choice.
The output text shows the detail of the parsing process.
Step | Log Item |
---|---|
First of all, it shows the <<FlatFile>> class that is going to hold the result of the parsing process. | Start parsing flat file class "urn:Services.Classes.HierarchicalFile.OrderFile" |
Then, it shows the pattern to be matched and the record that matches the pattern - if there is one. | "ORDER 1234567 MYER 19990823 19990825 19990903 4631 " |
If the records are hierarchical nested, the trace log will show the nesting as well by indenting the nested records. |
|
The parsing log file is only available if trace mode is activated. To have the complete log, additionally activate Full Trace.
On composing a file, no logs are available.
On this Page: