Skip to main content

Available control structure

forEach

The "forEach" attribute is used when n elements have to be generated from a parameter. The elements are divided by a single pipe ("|") that can come from a parameter or can be written directly inside the Blueprint. Is the attribute "forEach" empty, the element will be skipped. With "forEach.current" (see variables below) the current element can be referenced. A "forEach" inside a root-element will create multiple root-elements.

    <neonViewReference forEach="a|b|c">
<name>${forEach.current}</name>
</neonViewReference>

if

The "if" attribute is used when elements should only be created when a parameter is set to "true". This is among others the case when a ${myList.element} is used to check if a specific element is present in a list.

    <neonViewReference if="${thisParameter.shouldBeTrue}">
<name>dummy_name</name>
</neonViewReference>

An "equals"-query can be defined with "==" or "!=".

    <neonViewReference if="${thisParameter.number}==42">
<name>dummy_name</name>
</neonViewReference>