On this page

Don’t: Create an fUML loop without any Action Activation

When the fUML model has a loop without any Action Activation in the loop as shown in the figure below, the code stack continually increases until StackOverflowError occurs, causing the execution to be unexpectedly terminated. You can see StackOverflowError in the magicdraw.log file.

The model runs an infinite loop until StackOverflowError occurs, and the execution is terminated.

Do: Add an Action Activation in the loop

To avoid StackOverflowError, you must add at least an Action Activation, e.g., CallBehaviorAction in the loop as shown in the figure below. The code stack will not increase continually without StackOverflowError because Simulation has code to cut the stack loop and recall the Action at ActivityNodeActivation.receiveOffer() and ActionActivation.fire() according to fUML v1.3 specification. The execution will be continuously run without unexpected termination.

The model runs an infinite loop without StackOverflowError, and the execution is not terminated.