Zum Inhalt

Element <template>

Zweck: Definiert ein wiederverwendbares AMA-EDI-Template.

Warum: Verwende dieses Element, um eine wiederverwendbare AMA-Template-ID an eine Projekt-Templatedatei und ein Profil zu binden.

Beispiel

1
<template id="recpTpl" path="RECP.template.edi" edifactProfileRef="uoc3_comma"/>

Entscheidungshilfe

Fachlicher Nutzen: Bindet eine stabile Template-Identität an eine Projektdatei und optionales EDIFACT-Profil.

  • Verwenden, wenn

    • Wenn mehrere Outputs oder Pakete dasselbe AMA-Nachrichtentemplate wiederverwenden.
  • Anderen Ansatz wählen, wenn

    • Beim Auswählen von Dateiname oder konkretem Nachrichtenoutput.
  • Voraussetzungen

    • Liefere einen vorhandenen Projekt-Templatepfad und jedes referenzierte Profil.
  • Alternativen

    • Verwende output, um ein deklariertes Template als Nachricht zu instanziieren. (Siehe: <output>)

Vollständige Beispiele

Profilierte EDIFACT-Ausgabe rendern und ihre Artefakte paketieren

Verwende die AMA-Familie, wenn partnerspezifische EDIFACT-Trennzeichen, Templates, Ausgabenamen, Nebenartefakte und Archivpakete gemeinsam modelliert werden müssen.

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>

Regeln und ungültige Kombinationen

Keine zusätzlichen elementspezifischen Regeln. Pflichtattribute, Typen und unterstützte Werte stehen unten.

Erlaubte Elternelemente / Erlaubte Kindelemente

Erlaubte Elternelemente: ama-generate, else, else-if, if, templates, while

Erlaubte Kindelemente:

Keine

Attribute

Alle 4 Attribute anzeigen

edifactProfileRef

Identifier of the EDIFACT separator profile used for this template.

optional; string; Standardwert: null.

id

Unique identifier for this AMA template.

erforderlich; string.

path

Project-relative path to the AMA EDI template file.

erforderlich; string.

sourceScripted

Whether template source values are evaluated as scripts.

optional; boolean; Standardwert: null.