Element <iterate>¶
Purpose: Traverses records from a required source and exposes each current row to child contexts without owning an output target.
Why: Use iterate to traverse a source row and make it available to child contexts without exporting it directly.
Example¶
1 | |
Decision guide¶
Business value: Makes source traversal explicit while child contexts consume the current source row.
-
Use when
- Child elements need fields from each current source row through their parent context.
-
Choose another approach when
- The operation creates or exports a product directly.
-
Prerequisites
- Provide a source and an explicit bound where the source contract requires one.
-
Alternatives
- Use generate when the operation owns an output target or creates a product. (See:
<generate>)
- Use generate when the operation owns an output target or creates a product. (See:
Complete examples¶
Traverse an in-memory product and export an enriched child product
Use iterate when child contexts consume each current source row; let a nested generate own the enriched output product and target.
| iterate-and-enrich/datamimic.xml | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | |
Rules and invalid combinations¶
Source-selection options require source.
Attributes: source, selector, separator, sourceScripted, cyclic, weightColumn, stratifyBy
Why: selector, separator, sourceScripted, cyclic, weightColumn, and stratifyBy only modify a source read.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
A source may specify type or selector, but not both.
Attributes: source, type, selector
Why: selector owns the query shape, while type identifies an unselected source entity.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
Use count or the randomized minCount/maxCount strategy, never both.
Attributes: count, minCount, maxCount
Why: Both strategies own the number of rows, so combining them would make execution ambiguous.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
minCount must be less than or equal to maxCount.
Attributes: minCount, maxCount
Why: The randomized count is drawn from the inclusive interval between the two bounds.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
minCount/maxCount cannot be combined with start/end/interval.
Attributes: minCount, maxCount, start, end, interval
Why: Time-series length is derived from its window and interval, not from a randomized row count.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
offset requires source.
Attributes: offset, source
Why: An offset skips source rows and therefore has no meaning for purely synthetic generation.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
resume='group' requires resumeGroup.
Attributes: resume, resumeGroup
Why: The runtime needs the shared group name to resolve continuation state.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
resumeGroup requires resume='group'.
Attributes: resume, resumeGroup
Why: The group name has no meaning for statement- or table-scoped continuation.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
unique requires a finite source.
Attributes: unique, source
Why: Distinct sampling without replacement needs a source pool.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
unique cannot be combined with cyclic.
Attributes: unique, cyclic
Why: Unique selection consumes without replacement, while cyclic repeats exhausted rows.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
unique combines only with an explicit distribution='random'.
Attributes: unique, distribution
Why: Ordered or weighted selection would conflict with unique random sampling without replacement.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
cyclic requires a distribution that supports repetition.
Attributes: cyclic, distribution
Why: Full-pool weighted and stratified draws do not define a stable exhaustion boundary to restart.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
distribution='weighted' requires weightColumn.
Attributes: distribution, weightColumn
Why: The selector needs a non-negative numeric column to calculate sampling probabilities.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
distribution='stratified' requires stratifyBy.
Attributes: distribution, stratifyBy
Why: The selector needs a source column that identifies each stratum.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
A semantic project-file source requires its catalogued metadata attribute.
Attributes: source, weightColumn
Why: Weighted entity rows need weightColumn so selection can consume and then remove the metadata column.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
A semantic project-file source requires its catalogued distribution.
Attributes: source, distribution
Why: The file suffix declares selection semantics that an explicit conflicting distribution cannot override.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
A weighted entity project source requires explicit count.
Attributes: source, count
Why: Weighted selection does not infer a bounded output size from source length.
| Valid combination | |
|---|---|
1 | |
| Invalid combination | |
|---|---|
1 | |
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.
I883 β Time-Series Bad Start
Invalid
Why: The 'start' attribute is not a valid ISO 8601 datetime.
Resolution: Set start to an ISO 8601 datetime, e.g. '2026-01-01T00:00:00Z'.
I884 β Time-Series Bad End
Invalid
Why: The 'end' attribute is not a valid ISO 8601 datetime.
Resolution: Set end to an ISO 8601 datetime, e.g. '2026-01-02T00:00:00Z'.
I885 β Time-Series Bad Interval
Invalid
Why: The 'interval' attribute is not a valid ISO 8601 duration.
Resolution: Set interval to an ISO 8601 duration, e.g. 'PT1H'.
I886 β Time-Series End Not After Start
Invalid
Why: The 'end' attribute is not strictly after the 'start' attribute.
Resolution: Set end to a datetime strictly after start.
I887 β Time-Series Interval Too Fine
Invalid
Why: The 'interval' duration is non-positive, sub-microsecond, or a months/years Duration.
Resolution: Set interval to a positive constant-length duration of at least 1us, e.g. 'PT1S'.
I888 β Time-Series Namespace Collision
Why: A
Resolution: Rename the variable to something other than 'ts', e.g. 'ts_meta'.
I889 β Time-Series Incomplete Config
Time-series attributes start/end/interval must be set together; missing: {missing}
Why: Only some of the time-series attributes start/end/interval were provided.
Resolution: Provide all three attributes (start, end, interval) or none of them.
I949 β Source ML Model Option Unsupported
ML model source '{source}' does not support {option}={value}. Supported behavior: {supported}.
Why: The requested source-selection option cannot be preserved by generated ml:// model samples.
Resolution: Remove the unsupported option and use bounded ordered ML model generation.
I192 β Source Reference Identifier Empty
Explicit source URI for family '{family}' requires a non-empty identifier
Why: A recognized source-family URI was declared without the identifier needed to resolve its source.
Resolution: Add the source identifier after the URI scheme and retry.
I194 β Source Reference Client Family Mismatch
Explicit source family '{family}' does not match configured client '{client_id}' of type '{actual_client_type}'
Why: The referenced client exists but does not implement the source family declared by the URI.
Resolution: Use the URI scheme matching the configured client or reference a client of the declared family.
I195 β Source Reference Identifier Conflict
Explicit source identifier '{identifier}' conflicts with {attribute}='{configured_identifier}'
Why: Two source attributes select different identities for the same explicit source reference.
Resolution: Remove the legacy override or make it equal to the identifier in source.
Allowed parents / Allowed children¶
Allowed parents: else, else-if, generate, if, iterate, setup, while
Allowed children:
array, assert, condition, echo, generate, id, include, iterate, key, list, mapping, nestedKey, reference, rule, sourceConstraints, targetConstraints, variable, while
Related concepts and use cases¶
- First DATAMIMIC Model β Builds the smallest model and then composes preparation and generation stages.
- Migrate Benerator Models to DATAMIMIC β Maps Benerator concepts to the current generated grammar without freezing another support matrix.
- Choose a source and target β Guides users and agents from an input ownership boundary and intended side effect to one bounded source and target contract.
- 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.
Attributes¶
Show all 46 attributes
bucket
Bucket name for the external source or target.
optional; string; Default: null.
container
Container name for the external source or target.
optional; string; Default: null.
converter
Converter for element data transformation.
optional; string; Default: null.
count
Number of records to generate.
optional; string; Default: null.
cyclic
Enable or disable cyclic generation.
optional; boolean; Default: null.
device
Computation device to use.
optional; string; Default: null.
distribution
Distribution type for data generation.
optional; string; Default: null; Values: ordered, random, weighted, stratified, round_robin, reservoir, cumulated.
encoding
Override encoding for this generate task.
optional; string; Default: null.
end
Time-series window end (ISO 8601 datetime).
optional; string; Default: null.
fairness
Fairness configuration (JSON).
optional; string; Default: null.
generationBatchSize
Batch size during generation.
optional; integer; Default: null.
imputation
Imputation configuration (JSON).
optional; string; Default: null.
interval
Time-series tick interval (ISO 8601 duration).
optional; string; Default: null.
iterationSelector
Selector evaluated per iteration.
optional; string; Default: null.
maxCount
Maximum count for randomized generate/iterate length (mutually exclusive with 'count').
optional; integer; Default: null.
minCount
Minimum count for randomized generate/iterate length (mutually exclusive with 'count').
optional; integer; Default: null.
mpPlatform
Multiprocessing platform override.
optional; string; Default: null; Values: multiprocessing, fork, spawn, forkserver.
multiprocessing
Deprecated: accepted with a warning and ignored. Use numProcess and mpPlatform instead.
optional; string; Default: null.
name
Name of the generation task.
required; string.
numProcess
Specify the number of processes to use.
optional; integer; Default: null.
offset
Skip the first N rows of the source.
optional; integer; Default: null.
pageSize
Page size for processing data.
optional; integer; Default: null.
page_bytes_cap
Hard cap on page size in bytes.
optional; integer; Default: null.
page_memory_cap_mb
Cap in megabytes for page memory usage.
optional; integer; Default: null.
rareCategoryReplacementMethod
Method for handling rare categories.
optional; string; Default: null; Values: constant, sample.
rebalancing
Class/feature rebalancing configuration (JSON).
optional; string; Default: null.
resume
Optional per-statement resume scope override.
optional; string; Default: null; Values: stmt, table, group.
resumeGroup
Logical resume group key used when resume='group'.
optional; string; Default: null.
samplingTemperature
Sampling temperature used for generation (0-2).
optional; number; Default: null.
samplingTopP
Top-p (nucleus) sampling threshold (0-1).
optional; number; Default: null.
script
Script driving generation logic.
optional; string; Default: null.
selector
Selector for data generation.
optional; string; Default: null.
separator
Separator for generated data.
optional; string; Default: null.
source
Canonical source URI (for example file://data/orders.csv, database://sourceDb, or ml://customer_model); legacy raw source values remain accepted.
required; string; Default: null.
sourceClient
Override the client used to read when source is ambiguous.
optional; string; Default: null.
sourceEntity
Explicit physical entity to read (table/collection/product). Overrides selector or inferred name.
optional; string; Default: null.
sourceScripted
Enable or disable scripted sources.
optional; boolean; Default: null.
sourceUri
URI backing the source (file/object storage).
optional; string; Default: null.
start
Time-series window start (ISO 8601 datetime).
optional; string; Default: null.
storageId
Object storage client id.
optional; string; Default: null.
stratifyBy
Stratum column for distribution='stratified' source generation.
optional; string; Default: null.
type
Type of data generation.
optional; string; Default: null.
unique
Emit each source row at most once (distinct selection without replacement).
optional; boolean; Default: null.
variablePrefix
Prefix before field's name for query select data in selector element
optional; string; Default: null.
variableSuffix
Suffix after field's name for query select data in selector element
optional; string; Default: null.
weightColumn
Weight column for distribution='weighted' source generation; required for a .wgt.ent.csv source.
optional; string; Default: null.