whileLoop Business Rule Component
A While Loop is a business rule component that allows you to repeat an action as long as specified conditions continue to be true and the maximum number of iterations has not been exceeded.
Tip: To prevent runaway looping if a conditional trigger always returns true, it is recommended that you specify the maximum number of iterations allowed.
The following is the syntax for a While Loop.
Important! Content in a business rule is case sensitive. This includes business rule component names, attributes, and values.
Note: For each business rule component, most elements and attributes are optional, but you should specify enough to achieve the functionality that you intend. In most cases, you can omit attributes that are not relevant to your task and default values will be used. You must specify a name and a namespace. Except where otherwise indicated, attributes accept string values.
About the syntax documentation
<whileLoop name="This_component" namespace="Parent_of_component"
maxIterations="integer"
mergeRowToJobData="true|false"
sticky="true|false" configuratorType="Block_type_ID" alias="Data_reference">
<!-- Triggers -->
<!-- Required. Specify which event will cause this business rule component to run. For more information, see Triggers. -->
<triggers>
<trigger eventTrigger="ENQUEUE|PRINTJOBDETAIL|LABEL|Custom_Event" priority="integer" propagation="NONE|BEFORE|AFTER"/>
</triggers>
<!-- Child business rule components -->
<!-- You can create child business rule components to be run whenever the trigger event for this business rule component occurs. -->
<children>
<!-- The child business rule components have the potential to run once per triggering of the business rule component. However, a child business rule component will not run unless its own trigger event occurs. -->
<!-- To run a child business rule component once per iteration of the loop, set the trigger for the child business rule component to the event defined in loopEvents. -->
</children>
<!-- While Loop functionality -->
<!-- Specify a rowKey only if you are using the whileLoop to iterate through rows. -->
<rowKey>key</rowKey>
<beforeCondition>
<!-- Logical expression resulting in a condition of true or false. You can perform a logical operation, a comparison, or a data map entry state operation. You can nest operations to create a more complex expression. For more information, see Logical Operations and Comparisons. -->
<!-- The beforeCondition is evaluated before the child business rule components have been run for this iteration of the loop. -->
<!-- If the beforeCondition is true, loopEvents occur, children are evaluated, and then the afterCondition is evaluated. -->
<!-- If the beforeCondition is false, loopEvents do not occur, children are evaluated, the afterCondition is not evaluated, and no further iterations of the loop occur. -->
</beforeCondition>
<afterCondition>
<!-- Logical expression resulting in a condition of true or false. You can perform a logical operation, a comparison, or a data map entry state operation. You can nest operations to create a more complex expression. For more information, see Logical Operations and Comparisons. -->
<!-- The afterCondition is evaluated after the child business rule components have been run for this iteration of the loop.
<!-- If this afterCondition is true and the number of iterations has not exceeded maxIterations, then a new iteration begins and the beforeCondition (if one exists) is evaluated again. -->
<!-- If the afterCondition is false, then no further iterations of the loop occur. -->
</afterCondition>
<!-- The loopEvent is the definition of an event to symbolize the occurrence of a new iteration of the loop. This event occurs at the beginning of each iteration of the loop. -->
<loopEvents>
<loopEvent eventName="Custom_Event" includeSiblings="true|false" />
</loopEvents>
</whileLoop>
Syntax Tips
Additional information is available about the following items.
Tip: For assistance with a business rule that you have created or to have Loftware create business rules for you, contact Loftware's Professional Services Group.