OCLOperators foreach
No edit summary
No edit summary
Line 1: Line 1:
'''Note: This is an EAL operator'''
Interates a collection containing and executing the expression on all elements contained in ''self''.
Interates a collection containing and executing the expression on all elements contained in ''self''.
{| class="wikitable"
{| class="wikitable"
Line 7: Line 9:
|The method DoSomething is called once on each of the objects in (list of objects)
|The method DoSomething is called once on each of the objects in (list of objects)
|}
|}
For iterating and returning a list as the result, use [[OCLOperators collect|collect]]

Revision as of 10:03, 13 December 2021

This page was created by Lars.olofsson@mdriven.net on 2021-12-13. Last edited by Stephanie@mdriven.net on 2025-02-11.

Note: This is an EAL operator

Interates a collection containing and executing the expression on all elements contained in self.

Expression Result
(list of objects)->forEach(str | str.DoSomething) The method DoSomething is called once on each of the objects in (list of objects)

For iterating and returning a list as the result, use collect