Element <array>¶
Zweck: Erzeugt ein wiederholtes Array aus einer literalen Wertemenge oder einer skriptbasierten Quelle.
Warum: Verwende dieses Element für eine homogene Sammlung skalarer Werte aus Literalen, einem Skript oder einer typisierten Anzahl.
Beispiel¶
1 | |
Entscheidungshilfe¶
Fachlicher Nutzen: Drückt eine homogene skalare Sammlung als ein Feld im Produktvertrag aus.
-
Verwenden, wenn
- Wenn alle Einträge denselben skalaren Typ besitzen oder aus einem wiederholten Ausdruck stammen.
-
Anderen Ansatz wählen, wenn
- Wenn Einträge unterschiedliche Strukturen besitzen oder verschachtelte fachliche Datensätze enthalten.
-
Voraussetzungen
- Wähle eine literale, skriptbasierte oder gezählte Array-Strategie.
-
Alternativen
- Verwende list für heterogene oder bedingte Einträge. (Siehe:
<list>) - Verwende nestedKey für wiederholte strukturierte Datensätze. (Siehe:
<nestedKey>)
- Verwende list für heterogene oder bedingte Einträge. (Siehe:
Vollständige Beispiele¶
Verschachtelte Objekte, bedingte Listen, Arrays und Zweige zusammensetzen
Verwende diese Form, wenn ein deterministisches Produkt verschachtelte Datensätze, heterogene Listeneinträge, Literal-Arrays und exklusive Felder kombiniert.
| structured-profile/datamimic.xml | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
Regeln und ungültige Kombinationen¶
script darf nicht mit type oder count kombiniert werden.
Attribute: script, type, count
Warum: Das Skript liefert das vollständige Array; ein zusätzlicher Elementtyp oder Wiederholungszähler wäre mehrdeutig.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
Ein Array ohne script erfordert sowohl type als auch count.
Attribute: type, count, script
Warum: Ohne Skript benötigt DataMimic den skalaren Typ und die Anzahl der zu wiederholenden Kindwerte.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
type='literal' lehnt script und count ab.
Attribute: type, script, count
Warum: Ein literales Array erhält seinen stabilen Inhalt aus geordneten
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
I611 — Parser Array Subelements Not Allowed
Element
Warum: An error occurred during descriptor parsing.
Lösung: Review the configuration and retry.
I612 — Parser Array Literal Empty
Literal array '{name}' must define at least one
Warum: The configuration violates the requirement that Literal array '{name}' must define at least one
Lösung: Provide a non-empty configuration and retry.
I613 — Parser Array Value Invalid
Failed while parsing attributes of element <{child_tag}> inside
Warum: The system failed while parsing attributes of element <{child_tag}> inside
Lösung: Correct the configuration to a valid value or configuration.
I804 — Task Array Script Element Type
Failed while evaluate script '{script}' of
Warum: The system failed while evaluate script '{script}' of
Lösung: Review the configuration and retry.
I805 — Task Array Script Mixed Types
Failed while evaluate script '{script}' of
Warum: The system failed while evaluate script '{script}' of
Lösung: Review the configuration and retry.
I806 — Task Array Script Not List
expect datatype list of evaluated script '{script}' of
Warum: A value expected to be a list was not a list in the task configuration.
Lösung: Provide a list value for the script.
Erlaubte Elternelemente / Erlaubte Kindelemente¶
Erlaubte Elternelemente: else, else-if, generate, if, item, iterate, nestedKey, while
Erlaubte Kindelemente:
value
Zugehörige Konzepte und Anwendungsfälle¶
- Strukturierte Daten und Regel-Pipelines — Shows how composite output shapes and the ordered source-filter, mapping, and target-filter pipeline work together without hiding phase boundaries.
Attribute¶
Alle 4 Attribute anzeigen
count
Number of elements in the array.
optional; integer; Standardwert: null.
name
Name of the array.
erforderlich; string.
script
Script for generating array elements.
optional; string; Standardwert: null.
type
Data type of the array.
optional; string; Standardwert: null; Werte: string, int, float, bool, literal.