We are using the IRL 'collect' statement to gather the collection items into a 'usAddresses' IRL variable WHERE the items pass a condition, and then iterating over the variable if we have collected any items. The whole of the condition will be JITed to bytecode so we can expect the collect to run at native speed.

Pros

The business rule reads fairly well and does not require additional B2X or intermediate variables, ruleflow tasks

Good performance as collection is delegated to the underlying rules engine

Cons

If you have many separate rules that need to iterate over the input data the repeated 'definitions' blocks (one per rule) can become a maintenance issue.