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:

StepDescription
openOpen file or blob.
fileCreate <<FlatFile>> object.
fetchFetch 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.
attributeIf the <<FlatFileRecord>> class has attributes, process attributes using current record data.
nextFetch next record.
closeClose 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:

  1. Run a testcase with Full Trace option
  2. Open the UML Tab in the Analyzer
  3. Navigate to the activity diagram that contains the Flat File Adapter action.
  4. Click on the <<FlatFileAdapter>> action.
  5. Select Show adapter input/output > OUTPUT from the context menu.
    The adapter output will be displayed in the Watches section of the Analyzer.
  6. Right-click the displayed adapter output output and select Copy Value from the context menu.
  7. Paste the copied content into a text editor of your choice.

The output text shows the detail of the parsing process.

StepLog 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 "
Found record "Orders" (class="urn:Services.Classes.HierarchicalFile.Order"): pattern "^ORDER.*" does match
If the records are hierarchical nested, the trace log will show the nesting as well by indenting the nested records.

"PRODQNTY    1    PRD004    6    25.52    EA    C    I                        "
  Found record "Lines" (class="urn:Services.Classes.HierarchicalFile.OrderLine"): pattern "^PRODQNTY.*" does match

  "LOCNQNTY    204    6"
    Found record "StockInfos" (class="urn:Services.Classes.HierarchicalFile.Stock"): pattern "^LOCNQNTY.*" does match

    "PRODQNTY    2    PRD001    9    25.52    EA    C    I                        "
    Skipped record "StockInfos" (class="urn:Services.Classes.HierarchicalFile.Stock"): pattern "^LOCNQNTY.*" does not match

  Found record "Lines" (class="urn:Services.Classes.HierarchicalFile.OrderLine"): pattern "^PRODQNTY.*" does match

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:
  • No labels