Function:
This tool enables the file content of two or more structured file descriptors to be selectively merged into one. It parses
all property values from the modeled file input parameters, and writes them into a single result file. File descriptors with
different structures are supported.
Result:
- The merged result file contains as many lines as all input files in total, for example, a table row or a JSON object, in
the same order as the modeled file input parameters.
- Only values of property relationships are written into the output file, others are ignored. This can result in input file
descriptors that contain more properties than the output file descriptor.
- Properties of the output file, which do not occur in any of the input files, are set as empty values in the result file,
for example,
value1,value2,,value4.
- The result file type is dynamic, which means that type “InputStream” creates an input stream and type “Local_File” creates
a local file on the machine.
Use case:
Merge Structured Files can be used to create a merged AWM element list from the result of two or more separate tools.
Example:
The following simplified model example describes an action which is capable of creating an element list containing members
from two different databases. It uses two tools, which each return a separate element list from a specific database. Merge
Structured Files is used as the last tool of the action, which creates a merged result of both lists.
- Action Descriptor “ACT_ListAllDatabaseMembers"
- Tool Descriptor “TOOL_ListDB2Members"
- Output file: “FILE_DB2Members"
- Tool Descriptor “TOOL_ListSQLMembers"
- Output file: “FILE_OracleMembers"
- Tool Descriptor “Merge Structured Files"
- Input file: “FILE_DB2Members"
- Input file: “FILE_OracleMembers"
- Output file: “FILE_AllDatabaseMembers"
Note: In this example, the input file descriptors must have the attribute “Parameter From” set to “Previous_Tool”.
Parameters:
All parameters must be configured in the following way:
- A “Target ID File” reference must be set.
- Referenced file descriptors must have:
- “Structure” attribute set to “Table” or "JSON".
- At least one modeled property relationship, for example, "Has Property" relationship for table structures.
If the tool is used to merge element lists, all referenced file descriptors must contain exactly one and the same element
type property (property with the attribute “Special Property” set to “Element_Type”).
Parameter Name
|
I/O
|
Type
|
Description
|
First Structured File [M]
|
I
|
File
|
First file to be merged.
|
Additional Structured File [M]
|
I
|
File
|
Second file to be merged.
|
Additional Structured File [O]
|
I
|
File
|
Any amount of additional file input parameters can be modeled.
|
Merged File [M]
|
O
|
File
|
Merged file result.
|