The while loop can be used in mendix 9.0.5. In mendix 8 you have to build the loop yourself. So without the loop activity by using a decision at the end of your custom loop to check whether to continue in the loop or not and if the loop is not yet finished, merge it back in the flow.
See e.g. Mendix Forum - Questions
Hope this helps!