Error handling within a loop

8
Is there a specific reason why custom error handling within a loop is not allowed? If continue is allowed and rollback is allowed why not custom with these options? When I iterate over many lines it would be handy to generate an custom error with the specific details so the user can take action why something is not working as expected.
asked
5 answers
20

Good question.

Solution: Move the part inside the loop to a sub-microflow. You can do the custom error handling there.

answered
9

Can anyone from Mendix answer this question? Of course, Chris' solution helps, but it seems like pointless extra work to achieve this.

answered
1

Maybe a stupid remark, but could you not use the Break event to jump out of the loop, when an error has been discivered?

I think it is the traditional way to do it.

answered
1

Can be easily handled with a java action and session transaction, ( using different session context).

answered
0

Not 100% sure but I reckon the reason custom error handling in a loop is a no go is that the rollback behaviour can not be defined if you are using custom error handling

When you use a sub microflow we are actually defining what happens on rollback if the custom error handling runs into an error

 

answered