Looping Rules without Lists I have an online store using commerce and rules, with products that can be bought in different quantities.  Commerce stores the line-items in an order as a list, but it stores the quantity-per-line-item as a flat number.  

I have a rule that needs to fire once for each tangible product- ie. number of line-items x quantity.

Rules can loop over lists, but I don't have a way of representing the quantity as a list.  Is there a way to loop using just a number?  Is there a way to turn a raw number into a list Rules can loop over?
I ended up doing this with the 'execute custom PHP code' action.  I created a 'Do Foo Once' component with the UI, and then added this to 'Do Foo N Times':

for ($i = $quantity; $i &gt; 0; $i--) {
  rules_invoke_component('rules_do_foo_once', $i, $bar);
}