Element <condition>¶
Purpose:
is a pure branch container and takes no attributes of its own. Why: Use it to group one if branch, optional else-if branches, and an optional fallback branch.
Example¶
1 | |
Decision guide¶
Business value: Groups an ordered, mutually exclusive branch decision as one reviewable workflow block.
-
Use when
- Several child elements belong to if, else-if, and fallback branches.
-
Choose another approach when
- One conditional assignment or validation expresses the requirement more directly.
-
Prerequisites
- Start with if, follow with zero or more else-if branches, and place else last.
-
Alternatives
- Use mapping for a single ordered transformation rule. (See:
<mapping>)
- Use mapping for a single ordered transformation rule. (See:
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 | |
Rules and invalid combinations¶
I501 β Condition Duplicate If
Fail while parsing
Why: A
Resolution: Keep exactly one
I502 β Condition If Missing
Fail while parsing
Why: A
Resolution: Add exactly one
I503 β Condition Else After
Fail while parsing
Why: An
Resolution: Move
I504 β Condition Else Duplicate
Fail while parsing
Why: A
Resolution: Keep at most one
I505 β Condition Invalid Tag
Invalid tag {tag} in
Why: The branch container accepts only
Resolution: Replace <{tag}> with a supported branch element or move it inside an existing branch.
Allowed parents / Allowed children¶
Allowed parents: else, else-if, generate, if, iterate, nestedKey, while
Allowed children:
else, else-if, if
Related concepts and use cases¶
- 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 0 attributes
None