Skip to content

Element <setup>

Purpose: Root execution configuration and ordered container for a DataMimic descriptor.

Why: Use it once as the descriptor root to define execution defaults and ordered setup tasks.

Example

1
<setup/>

Decision guide

Business value: Makes execution defaults, client declarations, and task order reviewable in one descriptor.

  • Use when

    • Starting a complete executable DATAMIMIC descriptor.
  • Choose another approach when

    • Authoring a reusable fragment that will be included by another descriptor.
  • Prerequisites

    • Declare it exactly once as the document root.
  • Alternatives

    • Use include to compose reusable fragments below the root. (See: <include>)

Complete examples

Register and reuse one stateful generator instance

Use a named generator when several fields or tasks must deliberately share one configured generator instance rather than create independent instances.

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>

Rules and invalid combinations

W004 β€” Deprecated XML Attribute Ignored

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

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

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

Full rule

Allowed parents / Allowed children

Allowed parents: else, else-if, if, while

Allowed children:

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

  • One DSL Contract β€” Explains XML as the customer-facing model and DM JSON as a temporary Agent Authoring representation.
  • Expression Evaluation and Lifetime β€” Explains the different evaluation lifetimes of literal values, cached expressions, and dynamic expressions so descriptor authors do not accidentally move runtime state into setup-time attributes.
  • First DATAMIMIC Model β€” Builds the smallest model and then composes preparation and generation stages.
  • Upgrade your models from DATAMIMIC 3.5 to 4.0 β€” 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.
  • Migrate Benerator Models to DATAMIMIC β€” Maps Benerator concepts to the current generated grammar without freezing another support matrix.
  • Assemble a complex deterministic model β€” Provides the requirement-to-model sequence for products, field dependencies, relationships, targets, and acceptance evidence.
  • Determinism, parallelism, paging, and distribution β€” Separates seed, distribution, worker policy, paging, and streaming so topology choices do not become false determinism claims.
  • Diagnose Model Errors β€” Leads XML-first users through model-loading and runtime boundaries, with DM JSON steps only for Agent Authoring workflows.

Attributes

Show all 14 attributes

clock

Clock profile for deterministic timestamps.

optional; string; Default: null.

defaultDataset

Specify the default dataset locale.

optional; string; Default: null.

defaultEncoding

Specify the default encoding for file operations.

optional; string; Default: null.

defaultLineSeparator

Specify the default line separator.

optional; string; Default: null.

defaultLocale

Specify the default locale.

optional; string; Default: null.

defaultSeparator

Specify the default separator for generated data.

optional; string; Default: null.

defaultSourceScripted

Enable or disable scripted sources by default.

optional; boolean; Default: null.

defaultVariablePrefix

Specify the default variable prefix.

optional; string; Default: null.

defaultVariableSuffix

Specify the default variable suffix.

optional; string; Default: null.

multiprocessing

Deprecated: accepted with a warning and ignored. Use numProcess to control parallel execution.

optional; string; Default: null.

numProcess

Specify the number of processes to use.

optional; integer; Default: null.

reportLogging

Enable or disable report logging.

optional; boolean; Default: null.

rngSeed

Deterministic RNG seed for reproducible outputs.

optional; integer; Default: null.

schemaVersion

Deprecated: accepted with a warning and ignored. The installed engine determines the DSL version.

optional; string; Default: null.