Reputation: 83
The UML standard states
terminate pseudostate
Entering a terminate pseudo state implies that the execution of the state machine by means of its context object is terminated. The state machine does not exit any states nor does it perform any exit actions other than those associated with the transition leading to the terminate pseudo state.
When should I use final and terminate pseudostate? For me terminate pseudostate can be replaced by a state with name "destroyed".
Upvotes: 2
Views: 2254
Reputation: 6165
A lot of the explanations and examples out there are a bit cryptic, so let me see if I can put it in plainer English for you. A final state is where a process exits the state machine. A terminate pseudostate is one where the state machine shuts down.
One example might be a state machine for a cell phone call. You might have states such as find contact, initiate call, phone ringing, either go to voicemail or connect with contact, and then eventually to disconnect. In this case, the final state would be disconnect (or more correctly, disconnect would be the state that leads to the final state). Terminate pseudostates might be phone's battery dies, phone falls down garbage disposal, and so on.
I won't go so far as to say that a terminate pseudostate models an abnormal termination of a state machine, but that is what most practical applications of it use it for.
Upvotes: 5