Element <id>¶
Zweck: Definiert ein generiertes, kopiertes, konvertiertes oder skriptbasiertes Produktfeld.
Warum: Verwende diesen key-Alias, um kenntlich zu machen, dass das Feld den Datensatz identifiziert.
Beispiel¶
1 | |
Entscheidungshilfe¶
Fachlicher Nutzen: Kommuniziert Datensatzidentität ausdrücklich und behält dabei den vollständigen key-Erzeugungsvertrag.
-
Verwenden, wenn
- Wenn ein Feld den aktuellen Produktdatensatz eindeutig oder stabil identifiziert.
-
Anderen Ansatz wählen, wenn
- Wenn das Feld eine gewöhnliche Messgröße, Bezeichnung oder Zwischenberechnung ist.
-
Voraussetzungen
- Wähle Generator, Quelle oder Skript passend zum beabsichtigten Identitäts-Scope.
-
Alternativen
- Verwende key für sichtbare Felder ohne Identifier-Semantik. (Siehe:
<key>)
- Verwende key für sichtbare Felder ohne Identifier-Semantik. (Siehe:
Vollständige Beispiele¶
Datensatzidentität ausdrücklich markieren
Verwende id, wenn ein key die Datensatzidentität darstellt; der vollständige key-Erzeugungsvertrag bleibt erhalten.
| id-alias/datamimic.xml | |
|---|---|
1 2 3 4 5 6 | |
Regeln und ungültige Kombinationen¶
Ein Feld benötigt genau einen Modus zur Werterzeugung.
Attribute: type, source, values, script, generator, constant, pattern, string
Warum: Ein Feld ohne Typ, Quelle, Wertepool, Skript, Generator, Konstante, Pattern oder String-Template kann keinen Wert erzeugen.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
Wähle genau einen expliziten Erzeugungsmodus für das Feld.
Attribute: source, values, script, generator, constant, pattern, string
Warum: Die Kombination mehrerer Wertquellen würde die Herkunft des Feldwerts mehrdeutig machen.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
weights erfordert einen Inline-Pool in values.
Attribute: weights, values
Warum: Jedes Gewicht beeinflusst den entsprechenden values-Eintrag und hat ohne diesen Pool keine Bedeutung.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
unique erfordert einen Inline-Pool in values.
Attribute: unique, values
Warum: Feldeindeutigkeit zieht ohne Zurücklegen aus expliziten Werten; Generatoren stellen hier keinen endlichen Pool bereit.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
unique darf nicht mit weights kombiniert werden.
Attribute: unique, weights
Warum: Unique-Auswahl zieht gleichverteilt ohne Zurücklegen; Gewichte beschreiben verzerrte Ziehungen mit Zurücklegen.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
Optionen zum Quellenlesen erfordern source.
Attribute: source, selector, separator
Warum: selector, separator und weitere Quellenoptionen verändern ausschließlich einen Quellenzugriff.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
Eine Feld-distribution erfordert einen int- oder float-Wertebereich.
Attribute: distribution, type, min, max
Warum: Die Distribution auf Feldebene formt ein numerisches Raster und ist nicht die Verteilung von Quelldatensätzen.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
outDateFormat erzeugt einen String und lehnt einen anderen type ab.
Attribute: outDateFormat, type
Warum: Formatierung ist der letzte Darstellungsschritt; nachgelagerte Ausdrücke erhalten nicht mehr den rohen Zeitwert.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
Die Granularität eines Integer-Felds muss ganzzahlig sein.
Attribute: type, granularity
Warum: Ein Bruchschritt kann ohne stille Kürzung kein Integer-Raster erzeugen.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
defaultValue erfordert script.
Attribute: defaultValue, script
Warum: Der Fallback wird nur ausgewertet, wenn der Skriptwert fehlt oder seine condition die Erzeugung unterdrückt.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
nullQuota muss zwischen 0 und 1 liegen.
Attribute: nullQuota
Warum: Der Wert ist eine Wahrscheinlichkeit: 0 erzeugt nie null, 1 erzeugt immer null.
| Gültige Kombination | |
|---|---|
1 | |
| Ungültige Kombination | |
|---|---|
1 | |
Erlaubte Elternelemente / Erlaubte Kindelemente¶
Erlaubte Elternelemente: else, else-if, generate, if, item, iterate, nestedKey, while
Erlaubte Kindelemente:
element
Attribute¶
Alle 29 Attribute anzeigen
condition
Condition for key data generation.
optional; string; Standardwert: null.
constant
Constant value for key data.
optional; string; Standardwert: null.
converter
Converter for key data transformation.
optional; string; Standardwert: null.
database
Database client id when source equals 'database'.
optional; string; Standardwert: null.
defaultValue
Default value for the key.
optional; string; Standardwert: null.
distribution
Sampling distribution / sequence for ranged numeric key.
optional; string; Standardwert: null; Werte: uniform, cumulated, step, increment, randomWalk, shuffle, wedge, bitreverse, fibonacci, padovan.
generator
Predefined generators for key data generation.
optional; string; Standardwert: null.
granularity
Step width of numeric grid; defaults 1 for int, 0.1 for float. On int, must be whole.
optional; string; Standardwert: null.
inDateFormat
Input date format for key data.
optional; string; Standardwert: null.
max
Maximum value for numerical generator.
optional; number; Standardwert: null.
maxLength
Maximum length for binary payload generation.
optional; integer; Standardwert: null.
mimeType
Optional MIME signature for binary payload generation.
optional; string; Standardwert: null.
min
Minimum value for numerical generator.
optional; number; Standardwert: null.
minLength
Minimum length for binary payload generation.
optional; integer; Standardwert: null.
name
Name of the key.
erforderlich; string.
nullQuota
Null quota for key data generation.
optional; number; Standardwert: null.
outDateFormat
Output date format for key data.
optional; string; Standardwert: null.
pattern
Pattern for key data generation.
optional; string; Standardwert: null.
script
Script for key data generation.
optional; string; Standardwert: null.
selector
Selector for key data generation.
optional; string; Standardwert: null.
separator
Separator for key data.
optional; string; Standardwert: null.
source
Source of data for the key.
optional; string; Standardwert: null.
string
String for the variable data generation.
optional; string; Standardwert: null.
type
Data type of the key.
optional; string; Standardwert: null; Werte: string, int, integer, float, bool, binary.
unique
Emit each value at most once (distinct picks from values, no replacement).
optional; boolean; Standardwert: null.
values
Comma-separated list of values for the key.
optional; string; Standardwert: null.
variablePrefix
Prefix before field's name for string in key generation.
optional; string; Standardwert: null.
variableSuffix
Suffix after field's name for string in key generation.
optional; string; Standardwert: null.
weights
Comma-separated relative weights, one per values entry, for weighted random selection.
optional; string; Standardwert: null.