Defines a loop step iterating on list items result from a JavaScript expression.
Also called For Each step, the jIterator step:
• defines a JavaScript expression as input list to work on, i.e. the name of a multi-valued variable, the name of a defined JavaScript Array, or the name of a NodeList variable created by a previous jSource step, etc.,
• iterates on each item of the specified input list,
• contains child steps that are executed on each iteration, as other loop steps (for example see “Iterator”, “jWhile” and “jDoWhile” steps documentation and examples).
In the iteration, child steps can access and use:
• the current iterated item through a JavaScript variable named item, which type depends on the iterated Array or NodeList,
• the current iteration index through a JavaScript variable named index, which is an integer.
Property | Type | Category | Description |
---|---|---|---|
Comment | String | standard | Describes the object comment to include in the documentation report. This property generally contains an explanation about the object. |
Expression | JS expression | standard | Defines the expression evaluated to give the list to iterate on. This property is a JavaScript expression that is evaluated during the sequence execution and gives a list of items (JavaScript Array or NodeList). If the expression doesn’t output a list object or if the expression is left blank, the step has no data to work on: the loop does not execute its child steps and the parent sequence execution continues |
Is active | boolean | standard | Defines whether the step is active. |
Starting index | JS expression | standard | Defines the index from which the jIterator should start to iterate. In the case you do not want to start an iteration at the first item (index 0), you can specify a starting index in this property. This property is a JavaScript expression that is evaluated during the sequence execution. By default, it is set to 0 for starting at the first item of the input list. If the defined starting index does not exist in the input list, the loop does not execute its child steps and the parent sequence execution continues. |
Stopping index | JS expression | standard | Defines the exclusive index to which the Iterator should stop to iterate. Intended mostly for testing purposes, this (optional) parameter limits the number of times the iterator loops if this last index is reached. By default, it is not filled, so the jIterator loops on each item from the list. |
Output | boolean | expert | Defines whether the XML generated by this step should be appended to the resulting XML. Set this property to true to add the step’s resulting XML to the sequence’s output XML (default value for steps generating XML). Set this property to false to prevent the steps’s XML result to appear in the sequence’s output XML. Setting this property to false does not prevent the step’s generated XML from being used as a source by other steps. |