Zum Inhalt

Element <setup>

Zweck: Ist die Wurzelkonfiguration und der geordnete Container eines DataMimic-Descriptors.

Warum: Verwende dieses Element genau einmal als Descriptor-Wurzel für Ausführungsdefaults und geordnete Setup-Tasks.

Beispiel

1
<setup/>

Entscheidungshilfe

Fachlicher Nutzen: Macht Ausführungsdefaults, Client-Deklarationen und Task-Reihenfolge in einem Descriptor prüfbar.

  • Verwenden, wenn

    • Beim Erstellen eines vollständig ausführbaren DATAMIMIC-Descriptors.
  • Anderen Ansatz wählen, wenn

    • Beim Erstellen eines wiederverwendbaren Fragments, das ein anderer Descriptor einbindet.
  • Voraussetzungen

    • Deklariere setup genau einmal als Dokumentwurzel.
  • Alternativen

    • Verwende include, um wiederverwendbare Fragmente unterhalb der Wurzel zusammenzusetzen. (Siehe: <include>)

Vollständige Beispiele

Eine zustandsbehaftete Generatorinstanz registrieren und wiederverwenden

Verwende einen benannten Generator, wenn mehrere Felder oder Tasks bewusst dieselbe konfigurierte Generatorinstanz statt unabhängiger Instanzen nutzen sollen.

named-generator/script/preflight.scr.py
1
assert 2 + 2 == 4
named-generator/datamimic.xml
1
2
3
4
5
6
7
<setup>
    <execute uri="script/preflight.scr.py"/>
    <generator name="document_sequence" generator="IncrementGenerator(start=100)"/>
    <generate name="documents" count="3" target="LogExporter">
        <id name="document_id" generator="document_sequence"/>
    </generate>
</setup>

Regeln und ungültige Kombinationen

W004 — Deprecated XML Attribute Ignored

<{element}> attribute '{attribute}' in descriptor '{descriptor}' is deprecated and ignored; execution continues. {migration}

Warum: The descriptor uses a known legacy attribute that no longer controls execution.

Lösung: Follow the migration hint when updating the model. Removing the attribute is not required to run it.

Vollständige Regel

Erlaubte Elternelemente / Erlaubte Kindelemente

Erlaubte Elternelemente: else, else-if, if, while

Erlaubte Kindelemente:

ama-generate, assert, database, echo, execute, generate, generator, include, iterate, kafka-exporter, kafka-importer, memstore, ml-train, mongodb, object-storage, operate, param, rabbitmq-exporter, rabbitmq-importer, state-machine, variable

Attribute

Alle 14 Attribute anzeigen

clock

Clock profile for deterministic timestamps.

optional; string; Standardwert: null.

defaultDataset

Specify the default dataset locale.

optional; string; Standardwert: null.

defaultEncoding

Specify the default encoding for file operations.

optional; string; Standardwert: null.

defaultLineSeparator

Specify the default line separator.

optional; string; Standardwert: null.

defaultLocale

Specify the default locale.

optional; string; Standardwert: null.

defaultSeparator

Specify the default separator for generated data.

optional; string; Standardwert: null.

defaultSourceScripted

Enable or disable scripted sources by default.

optional; boolean; Standardwert: null.

defaultVariablePrefix

Specify the default variable prefix.

optional; string; Standardwert: null.

defaultVariableSuffix

Specify the default variable suffix.

optional; string; Standardwert: null.

multiprocessing

Beliebiger alter Parallelitäts-String; wird mit Warnung akzeptiert und ignoriert. Verwende numProcess und mpPlatform.

optional; string; Standardwert: null.

numProcess

Specify the number of processes to use.

optional; integer; Standardwert: null.

reportLogging

Enable or disable report logging.

optional; boolean; Standardwert: null.

rngSeed

Deterministic RNG seed for reproducible outputs.

optional; integer; Standardwert: null.

schemaVersion

Veraltete DSL-Version; wird mit Warnung akzeptiert und ignoriert. Die installierte Engine bestimmt die DSL-Version.

optional; string; Standardwert: null.