Skip to content

Element <item>

Purpose: Define one selectable item shape within a list.

Why: Use it to declare one independently selectable shape inside a list.

Example

1
<item/>

Decision guide

Business value: Defines one independently selectable business shape inside a heterogeneous list.

  • Use when

    • One list entry needs its own fields, source, count, or condition.
  • Choose another approach when

    • The value is a standalone field or every list entry has the same structure.
  • Prerequisites

    • Place it inside list and define the fields belonging to this entry form.
  • Alternatives

    • Use nestedKey for repeated records with one common shape. (See: <nestedKey>)

Complete examples

Assemble nested objects, conditional lists, arrays, and branches

Use this shape when one deterministic product combines nested records, heterogeneous list entries, literal arrays, and mutually exclusive fields.

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
<setup rngSeed="42" numProcess="1">
    <generate name="profiles" count="3" target="LogExporter">
        <key name="id" generator="IncrementGenerator"/>
        <nestedKey name="address" type="dict">
            <key name="city" constant="Berlin"/>
            <key name="postal_code" constant="10115"/>
        </nestedKey>
        <list name="contacts" converter="RemoveNoneOrEmptyElement">
            <item>
                <key name="channel" constant="email"/>
                <key name="value" script="'customer-' + str(id) + '@example.test'"/>
            </item>
            <item condition="id % 2 == 0">
                <key name="channel" constant="sms"/>
                <key name="value" script="'+49-30-' + str(100000 + id)"/>
            </item>
        </list>
        <array name="roles" type="literal">
            <value constant="customer"/>
            <value constant="newsletter"/>
        </array>
        <condition>
            <if condition="id == 1">
                <key name="segment" constant="new"/>
            </if>
            <else-if condition="id == 2">
                <key name="segment" constant="active"/>
            </else-if>
            <else>
                <key name="segment" constant="loyal"/>
            </else>
        </condition>
    </generate>
</setup>

Rules and invalid combinations

An item type requires a source.

Attributes: type, source

Why: The type selects the record shape read from the configured source and has no standalone value.

Valid combination
1
<item source="data/items.ent.csv" type="dict"/>
Invalid combination
1
<item type="dict"/>
separator and sourceScripted require a source.

Attributes: source, separator, sourceScripted

Why: These options change source parsing and cannot affect a purely child-defined item.

Valid combination
1
<item source="data/items.ent.csv" separator="|"/>
Invalid combination
1
<item separator="|"/>

Allowed parents / Allowed children

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

Allowed children:

array, element, id, key, list, nestedKey

  • Structured Data and Rule Pipelines — Shows how composite output shapes and the ordered source-filter, mapping, and target-filter pipeline work together without hiding phase boundaries.

Attributes

Show all 7 attributes

condition

Condition for including the item in the list.

optional; string; Default: null.

separator

Separator for item data.

optional; string; Default: null.

source

Source of data for the item.

optional; string; Default: null.

sourceScripted

Enable or disable scripted sources for the item.

optional; boolean; Default: null.

type

Item type (paired with source).

optional; string; Default: null.

variablePrefix

Prefix before field names inside selectors.

optional; string; Default: null.

variableSuffix

Suffix after field names inside selectors.

optional; string; Default: null.