A state is a condition or situation of an object during which it satisfies some condition, performs some activity, or waits for some event.
For example, if a house is
waiting to be sold
it is said to be in state
AVAILABLE
; if a software license
has an owner
it is said to be in state
SOLD
; if a car is
being produced
it is said to be in state
IN_PRODUCTION
. A state in the OITF identifies the “…condition or situation during the life of an object…”.
You must define the states that your object can be in at any given point in time. An object’s life cycle has a start and end. To represent this, there are two special state types:
Initial State : Indicates the default starting place
Final State : Indicates the completion place
All the other states are of type
Simple
State
. There can be only one initial state but there can be multiple final states.
You define states within your behavior profile in Customizing by choosing
.Example
The list of states required for the High Tech Software Entitlement is defined within behavior profile
ISHT_BP_ENTIT_PER
as shown below:
State ID |
Description |
State Type |
---|---|---|
ISHT_ACTIVE |
ISHT: Entitlement active |
Simple State |
ISHT_INACTIVE |
ISHT: Entitlement inactive - final state |
Final State |
ISHT_ISSUED |
ISHT: Entitlement created - initial state |
Initial State |
ISHT_MAINTENANCE_EXP |
ISHT: Maintenance contract expired |
Simple State |
What if you want to do something whenever an object leaves a
From State
no matter which transition is causing this? Similarly, what if you want to do something whenever the object enters a
To State
no matter which transition is causing this?
The answer is exit action and entry action respectively. For example, whenever an object enters the state SOLD, you want to record that it was sold. Exit and entry actions are assigned to states.
Technically, an exit or entry action is similar to an action. The only difference is that an action is assigned to a transition (and is executed whenever the transition is fired), whereas exit or entry actions are assigned to a state (and are executed whenever an object leaves or enters the state, irrespective of the transition causing it). When a transition is fired, the exit action assigned to the from state is executed first, secondly the action assigned to the transition, and finally the entry action assigned to the to state.
You create and register your exit or entry actions in a fashion similar to creating an action. Having done that, you can assign them to a state. You assign exit and entry actions to a state when defining a state within a behavior profile.
The following basic state diagram shows how states could look in a very simple life cycle.
The definition of an object’s life cycle is not yet complete. The “flow of control” between these states still has to be defined. For more information, see Transitions .