MiceOnABeam Product Documentation

Modified: 10/27/2011 7:29 PM
Recently changed articles You can subscribe to this wiki article using an RSS feed reader.

Entry Point

Summary

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.

Graphic

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.

Description

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.

  1. One or more connected external incoming transitions; Not connected internally:
       
    The Entry Action of the Composite State is first executed. Then the transition(s) invokes the Default Entry on the Composite State, executing the Initial Transition contained within it's decomposition if it exists.
     
  2. Not connected externally; One connected internal outgoing transition:
    The transition operates as a Group Transition, whereby it acts as if it had originated from every substate contained within the Composite State's decomposition and recursively so inside every substate that is a Composite State. Since this Group Transition occurs inside, the Composite State's Entry and Exit Actions are not performed. However note that when the transition is triggered, the Exit Actions of all substates affected by the Group Transition will be executed before the Transition Action of the Group Transition.
     
  3. One or more connected external incoming transitions; One connected internal outgoing transition:
     
    The Entry Action of the Composite State is first executed followed by the Transition Action of the internal continuing transition, ultimately connecting to a component within the Composite State's decomposition.
     

Usage

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.

Top State

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.

Dancing 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.

  1. Fast_Dance::Dancing::Top state Exit Action code
  2. touch::Dancing::Top Transition Action code
  3. Dancing::Top state Exit Action code
  4. touch::Top Transition Action code
  5. Standing::Top state Entry Action code

Notes

  • 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.
Tags:
Home: MiceOnABeam Product Documentation Copyright © 2010-2018 MiceOnABeam Software