shaheen
shaheen

Reputation: 21

UML State Diagram Difference between do and entry

i really don't understand the difference between entry and do activities in UML state diagram

if i have state called create account and this state ask from user to enter his name,id and password

so enter name , id , password is entry activity or do activity ?

Upvotes: 2

Views: 690

Answers (1)

Axel Scheithauer
Axel Scheithauer

Reputation: 3625

The difference is that the entry behavior is always run to completion, whereas the do behavior is only run to completion if no event triggers a transition. It will get interrupted by this event. Therefore, it could have an endless loop. If an effect-, do- or exit-behavior has such an endless loop, the statemachine will not react to events anymore.

As a sidenote: create account is not a good name for a state, since it contains an active verb. That is better suited for an activity. The state could be named creating account. The entry-behavior could be create account and this could include actions enter name, enter id and enter password. You should also model the possibility, that the users cancels the creation. Two completion transitions with guards [account created] and [canceled] could show what happens next.

Upvotes: 2

Related Questions