Output System "StackOrg"
Notice
The "StackOrg" output system can only be used in conjunction with a Stack Organizer that is active in the same scenario.
This output system restructures the content of the current output batch such that it corresponds to the specifications that a user has defined in the Stack Organizer.
The restructured batch is transferred to another scenario for further processing. The restructuring is only temporary. The original batch will remain unchanged. If an additional output step follows, it will refer to the documents in the original batch.
The "StackOrg" output system works in a batch-oriented manner, as the Stack Organizer processes complete batches and these batches are transferred to the further processing scenario as a coherent unit. However, as output systems are always called per document, in this case the entire batch is output when the first document is called. The calls of the other documents have no function. This procedure is only possible because the way the Stack Organizer works ensures that the complete batch is available. With regular processing, however, it is possible that not all documents in the batch are available for output.
Property | Description |
|---|---|
OutputSystem[].OutputMode | Mode in which the batch is output:
The general property |
OutputSystem[].DestinationMacro* | Field macro expression for creating the output target of the restructured batch In As an additional function, this configuration property can be used to split the output batch into multiple sub-batches with different targets. The macro printout is evaluated for each document in the batch, allowing for differing target values. Documents with the same target value are aggregated into a sub-batch. |
OutputSystem[].FileNameMacro | Macro expression that returns the name of the JSON file The JSON file is generated as the primary output file in In Default value: |
OutputSystem[].AttachFileRefMacro | Macro expression that returns the name of each file attachment to be output to the file system This property only applies to This macro is evaluated separately for each file attachment; therefore, it should use the individual properties of the attachment in the form of file variables to generate unique file names. Default value: |
Example of the "InternalJson" mode
The following example provides an excerpt of the relevant configuration properties in InternalJson mode:
The original scenario with the active Stack Organizer writes the output data to separate folders by batch. In .DestinationMacro, the UUID of a batch is used to ensure uniqueness in folder names. The name of the JSON output file in the .FileNameMacro also contains a relative folder path to create separate subfolders for each document. The sequential number of the document in the batch is used to ensure uniqueness in folder names. The names of the file attachments in the .AttachFileRefMacro are given a number (of the attachment within the document) to avoid ambiguity in file names.
"Process": {
"StackOrg": {
"Activate": true
}
},
"OutputSystem": {
"Type":
"StackOrg",
"OutputMode": "InternalJson",
"DestinationMacro": "'c:/test/{%BatchUuid%} %BatchName%'",
"FileNameMacro": "'[%DocNo%] @DocName/internal.json'",
"AttachFileRefMacro": "'[%FileNo%] %FileName%'"
}
The data in the target scenario is read in via the "Folder" input system. This allows batch and document folder structure created during output to be read in again in such a way that the original assignment of documents to batches is retained. The alternative "File" input system, on the other hand, can only read the data as independent individual documents, and does not retain the superordinate batch structure.
The .FileFilter ensures that only the JSON file is initially read as the primary file attachment of a document. The other attachments are added later using the "InternalJson" input format based on the references in the JSON file. This allows those original names of file attachments to be restored which are stored as metadata in the JSON file.
"InputSystem": {
"Type": "Folder",
"Mode": "SubDocs",
"RootFolder": "c:/test",
"FileFilter": "internal.json"
},
"InputFormat": [
{
"Type": "InternalJson"
}
],
"ProcessReadIndex": [
{
"Type": "InternalJson"
}
]