Any time you loop through, or iterate, a collection of any type, there are some restrictions to consider. Inside the loop, you may change an individual member, but you may not change the collection itself.
For example, consider LineItems, a collection of LineItem entities in the InvoiceSample Rule Application.
As you loop through LineItems, examining each LineItem, you may change LineItem fields such as Quanity, but you may not remove the LineItem from the LineItems collection.
In InRule, this restriction applies to the For Each and the Execute Member Rule Set actions. While inside the loop, you may not:
- Add Collection Member
- Clear Collection
- Copy Collection (copying into the collection)
- Remove Collection Member
- Sort Collection
Comments
0 comments
Please sign in to leave a comment.