An Entry Point is used on the border of a Composite State to connect an incoming transition to a component within the state's decomposition.
An Entry Point is represented by the following graphic:
One or more incoming transitions may be connected to an Entry Point from outside the Composite State, but it may only have a single outgoing transition, connecting to a state or component within the Composite State's decomposition, or to an Exit Point on it's border.
A transition initially drawn from the interior border of a Composite State will appear as an internal connection point, indicating that it does not appear on the outside border of the Composite State (and so is not connected externally). However in all other respects it operates as an Entry Point. The connection point can be made visible on the Composite State's external border by selecting Show On Outside Border from the connection point's context menu. It's graphic will then show as a proper Entry Point.
A transition initially drawn to the exterior border of a state will not show an Entry Point on the border, although within the state's decomposition the connection will be represented by a proper Entry Point (since it is connected externally). Again, the Entry Point can be made visible on the state's external border by selecting Show On Outside Border from the Entry Point's context menu.
An Entry Point is used to define the interface of a Composite State. A transition to a state or component contained within a Composite State must be done via an Entry Point.
There are three connection scenarios for an Entry Point depending on whether it is connected externally and/or internally on the border of it's Composite State.
One or more connected external incoming transitions; Not connected internally:
Not connected externally; One connected internal outgoing transition:
One or more connected external incoming transitions; One connected internal outgoing transition:
The following model shows a simple dance script which illustrates several ways Entry and Exit Points can be used. The script consists of four top-level states, Standing, Sitting, Lounging and Dancing, which transition between each other based on chat messages received via a listen event.
Upon receiving a listen event in state Standing with message data indicating dance, the script takes transition dance which connects to the dance Entry Point on the Composite State Dancing, which does not have an internally-connected transition. The Default Entry is then taken, to start-up in the Fast_Dance state.
A timer event on a Group Transition from an internal Entry Point periodically then fires to change the dance routine and transitions the script to one of Fast_Dance, Slow_Dance and Flash_Dance. If the dancer is touched while in the Fast_Dance and Slow_Dance states the dance ends and the script transitions via the End Exit Point back to the Standing state. If the dancer is touched while in the Flash_Dance state, then the script transitions to an internal Exit Point and invokes Default Entry ending up at the Fast_Dance state.
Note that all the Dancing substates even when active, are still subject to the stand, sit and lounge Group Transitions from the top-level state.
Importantly, although not explicitly shown above in the example, each state or substate may have an Entry Action and/or Exit Action. These are always executed when a new state is entered, and when an old state is exited respectively. So reviewing the case where we are in state Fast_Dance when a touch event occurs, the following state and transition action code segments are executed in the order indicated.
- Fast_Dance::Dancing::Top state Exit Action code
- touch::Dancing::Top Transition Action code
- Dancing::Top state Exit Action code
- touch::Top Transition Action code
- Standing::Top state Entry Action code
- An Entry Point by default takes on the name of the internally-connected transition within the Composite State's decomposition if it exists. If it is only connected externally, then it takes on the name of the external transition. It can however be changed by the User by selecting Edit Name from the Entry Point's context menu.
- If Show On Outside Border is selected for an internal connection point (i.e., not connected external to the Composite State), then the internally-connected transition will have it's event cleared as it is expected that a transition will subsequently be connected to the externally visible Entry Point by the User.