Skip to content

Element <output>

Purpose: One generated AMA message output.

Why: Use it to render one typed AMA message from a declared template into a named output.

Example

1
<output type="ORDERS" templateRef="recpTpl" filename="RECP___AmaUUID__"/>

Decision guide

Business value: Makes every generated partner message and its output contract explicit.

  • Use when

    • A template must produce one message type and filename pattern.
  • Choose another approach when

    • The file is a package sidecar or another non-message artifact.
  • Prerequisites

    • Reference an existing template id and choose exactly one of type or messageType.
  • Alternatives

    • Use artifact for additional traces, files, or workflow outputs. (See: <artifact>)

Complete examples

Render profiled EDIFACT output and package its artifacts

Use the AMA family when partner-specific EDIFACT separators, templates, output names, side artifacts, and archive packaging must be modeled together.

ama-edifact-package/templates/order.template.edi
1
UNH+__message_id__+ORDERS:D:96A:UN'
ama-edifact-package/datamimic.xml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
<setup rngSeed="42">
    <ama-generate defaultEdifactProfileRef="unoc3" variablePrefix="__" variableSuffix="__">
        <edifactProfiles>
            <profile id="unoc3" decimal="." data="+" comp=":" release="?" term="'"/>
        </edifactProfiles>
        <templates>
            <template id="order_template"
                      path="templates/order.template.edi"
                      edifactProfileRef="unoc3"
                      sourceScripted="True"/>
        </templates>
        <variable name="message_id" generator="IncrementGenerator"/>
        <output type="ORDERS" templateRef="order_template" filename="ORDERS___message_id__"/>
        <artifact type="edi_outputs" folder="edi"/>
        <artifact type="edifact_trace_csv" filename="ORDERS___message_id___trace.csv"/>
        <package type="zip" filename="ORDERS___message_id__.zip"/>
    </ama-generate>
</setup>

Rules and invalid combinations

An AMA output requires type or legacy messageType.

Attributes: type, messageType

Why: The renderer needs the message kind to select output-specific variables and controls.

Valid combination
1
<output type="RECP" templateRef="recpTpl" filename="RECP.edi"/>
Invalid combination
1
<output templateRef="recpTpl" filename="RECP.edi"/>
Use type or legacy messageType, never both.

Attributes: type, messageType

Why: Both attributes identify the same message kind, so differing values would be ambiguous.

Valid combination
1
<output type="RECP" templateRef="recpTpl" filename="RECP.edi"/>
Invalid combination
1
<output type="RECP" messageType="ABRP" templateRef="recpTpl" filename="RECP.edi"/>

Allowed parents / Allowed children

Allowed parents: ama-generate, else, else-if, if, while

Allowed children:

None

Attributes

Show all 9 attributes

comp

Optional component separator override for this output.

optional; string; Default: null.

data

Optional data element separator override for this output.

optional; string; Default: null.

decimal

Optional decimal separator override for this output.

optional; string; Default: null.

filename

Filename pattern for the generated message.

required; string.

messageType

Legacy alias for the generated output message type.

optional; string; Default: null.

release

Optional release-character override for this output.

optional; string; Default: null.

templateRef

Identifier of the AMA template used to render this output.

required; string.

term

Optional segment-terminator override for this output.

optional; string; Default: null.

type

Message type of the generated output.

optional; string; Default: null.