Element <nestedKey>¶
Zweck: Erstellt oder ergänzt ein verschachteltes Listen- oder Dictionary-Feld im aktuellen Produktdatensatz.
Warum: Verwende dieses Element für ein verschachteltes Dictionary oder eine wiederholte Liste mit einheitlicher Form.
Beispiel¶
1 | |
Entscheidungshilfe¶
Fachlicher Nutzen: Modelliert ein strukturiertes Objekt oder eine wiederholte Datensatzgruppe ohne fachliche Struktur zu verflachen.
-
Verwenden, wenn
- Wenn ein Ausgabefeld ein Dictionary oder wiederholte Datensätze gemeinsamer Form enthält.
-
Anderen Ansatz wählen, wenn
- Wenn der Wert skalar, ein homogenes skalares Array oder eine heterogene bedingte Liste ist.
-
Voraussetzungen
- Definiere die verschachtelten Felder und die beabsichtigte Kardinalität oder Quelle.
-
Alternativen
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¶
cyclic erfordert eine Eingabe aus source oder script.
Attribute: cyclic, source, script
Warum: Nur eine vorhandene Eingabesequenz kann wiederholt werden.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
cyclic erfordert count, minCount oder maxCount.
Attribute: cyclic, count, minCount, maxCount
Warum: Eine endliche Anzahlgrenze verhindert eine endlos wiederholte verschachtelte Eingabe.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
script darf nicht mit Attributen zum Quellenlesen kombiniert werden.
Attribute: script, source, type, separator, sourceScripted
Warum: Ein Skript besitzt den vollständigen verschachtelten Wert; source, type, separator und sourceScripted beschreiben einen anderen Eingabe-Owner.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
distribution erfordert eine listenfähige source.
Attribute: distribution, source, type
Warum: Eine Distribution wählt Datensätze aus einem Quellpool und kann keinen Skalar oder ein quellfreies Objekt formen.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
Verwende count oder minCount/maxCount, niemals beides.
Attribute: count, minCount, maxCount
Warum: Beide Strategien bestimmen die Anzahl verschachtelter Werte.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
minCount muss kleiner oder gleich maxCount sein.
Attribute: minCount, maxCount
Warum: Die verschachtelte Wiederholungsanzahl wird aus dem inklusiven Intervall zwischen diesen Grenzen gezogen.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
Eine quellfreie Liste erfordert count, minCount oder maxCount.
Attribute: type, source, count, minCount, maxCount
Warum: Andernfalls kann die Listenlänge nicht bestimmt werden.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
separator und sourceScripted erfordern source.
Attribute: source, separator, sourceScripted
Warum: Diese Optionen verändern das Parsen der Quelle und wirken nicht auf skript- oder kindeigene Werte.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
type darf nicht von sourceEntity abweichen.
Attribute: source, type, sourceEntity
Warum: Bei source='mem' ist ein Entity-Wert in type ein Alias für sourceEntity; ein ausdrücklich anderer sourceEntity-Wert wäre mehrdeutig.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
I822 — Task NestedKey Item Not Dict
Expect current product of
Warum: A value expected to be a dictionary was not a dictionary in the task configuration.
Lösung: Provide a dictionary value for the configuration.
I192 — Source Reference Identifier Empty
Explicit source URI for family '{family}' requires a non-empty identifier
Warum: A recognized source-family URI was declared without the identifier needed to resolve its source.
Lösung: Add the source identifier after the URI scheme and retry.
I193 — Source Reference Consumer Unsupported
Explicit source family '{family}' is not supported by <{consumer}>
Warum: The source family is valid, but the consuming DSL element does not implement its read contract.
Lösung: Use a source family supported by this element or move the read to generate/iterate.
I195 — Source Reference Identifier Conflict
Explicit source identifier '{identifier}' conflicts with {attribute}='{configured_identifier}'
Warum: Two source attributes select different identities for the same explicit source reference.
Lösung: Remove the legacy override or make it equal to the identifier in source.
W006 — Memstore Dataset Selected Through type
<{element}> attribute type='{entity}' in descriptor '{descriptor}' is read as sourceEntity='{entity}'; execution continues. Use sourceEntity for dataset selection and keep type for list or dict; if you meant a container, check the spelling of type.
Warum: A memstore dataset is selected through type instead of sourceEntity.
Lösung: Move the dataset name to sourceEntity; reserve type for list or dict.
Erlaubte Elternelemente / Erlaubte Kindelemente¶
Erlaubte Elternelemente: else, else-if, generate, if, item, iterate, nestedKey, while
Erlaubte Kindelemente:
array, assert, condition, echo, element, execute, id, key, list, mapping, nestedKey, rule, sourceConstraints, targetConstraints, variable, while
Zugehörige Konzepte und Anwendungsfälle¶
- Variablen-Scope in verschachtelten Generates — Prevents accidental ancestor reads and shadowing, and routes memstore reads through the public Scripting API.
- Modelle von DATAMIMIC 3.5 auf 4.0 umstellen — Helps existing 3.5 users identify affected models, understand the reasons for 4.0 changes, and migrate syntax and expected results without confusing retained compatibility with breakage.
- Benerator-Modelle nach DATAMIMIC migrieren — Maps Benerator concepts to the current generated grammar without freezing another support matrix.
- 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.
- Ein komplexes deterministisches Modell zusammensetzen — Provides the requirement-to-model sequence for products, field dependencies, relationships, targets, and acceptance evidence.
- Beziehungen und korrelierte Daten modellieren — Explains when to use nested products, memstore lineage, or one correlated reference selection.
Attribute¶
Alle 17 Attribute anzeigen
condition
Condition for nested key generation.
optional; string; Standardwert: null.
converter
Converter for element data transformation.
optional; string; Standardwert: null.
count
Number of nested keys to generate.
optional; string; Standardwert: null.
cyclic
Enable or disable cyclic generation for nested keys.
optional; boolean; Standardwert: null.
defaultValue
Default value for nested keys.
optional; string; Standardwert: null.
distribution
Distribution type for nested key sampling.
optional; string; Standardwert: null; Werte: ordered, random, round_robin, reservoir, cumulated.
maxCount
Maximum count for nested key generation.
optional; integer; Standardwert: null.
minCount
Minimum count for nested key generation.
optional; integer; Standardwert: null.
name
Name of the nested key.
erforderlich; string.
script
Script for nested key generation.
optional; string; Standardwert: null.
separator
Separator for nested key data.
optional; string; Standardwert: null.
source
CSV/JSON project-file or memstore source for nested list/dict data; expressions resolve per row.
optional; string; Standardwert: null.
sourceEntity
Explicit memstore product to read (overrides the nested-key name fallback).
optional; string; Standardwert: null.
sourceScripted
Enable or disable scripted sources.
optional; boolean; Standardwert: null.
type
Type of the nested key.
optional; string; Standardwert: null; Werte: list, dict.
variablePrefix
Prefix before field names inside nested selectors.
optional; string; Standardwert: null.
variableSuffix
Suffix after field names inside nested selectors.
optional; string; Standardwert: null.