"Break" Activity Does Not Work With "Do" and "Do While"

Why "Break" activity makes execution flow goes out of "for each" when there is "While" or "Do While" nested within "for each" activity? Should it break out of "While" or "Do While", but not all the way out of the outermost "for each."

The documentation says "break" would work with "foreach", "while" or "do while." Read more on Break. However, this is not true in certain conditions.

There are 2 types of "while" and "do while" activities. The current documentation is true for the latter one.

  • The one comes with UiPath.System.Activities 19.10 and before, which has the internal name of System.Activities.Statements.dowhile (in case of "do while")
  • The one comes with UiPath.System.Activities 20.4 and later, which has the internal name of UiPath.Core.Activities.InterruptibleDoWhile (in case of "do while")

This change has been documented at the Release Notes UiPath v23.4.2 : System Activities: New Features And Improvements 6 .

In UiPath.System.Activities 19.10 and before, "break" activity only works with "for each" activity. It would not break "while" or "do while" generated out of 19.10 version. Note: That if "while" or "do while" activities had been added out of UiPath.System.Activities 19.10, it will have this limitation even after the UiPath.System.Activities is updated to 20.4 or later.

When "break" activity has to be placed inside of "while" or "do while," the UiPath.System.Activities has to be updated to 20.4 or later and the activities has to be recreated.

The types of "while" and "do while" activities can be found by checking the internal name shown in the properties.

Here are the examples.

  • 19.10 or before

  • 20.4 and later