advanced behavioral modeling chapter 4 of omd
TRANSCRIPT
ADVANCED BEHAVIORAL MODELING
JAYA KOLEKAR
jaya 2
Introduction to Behavioral model
Behavioral model describes the interaction in the system.
It shows the dynamic nature of the system.
Diagrams Activity Diagram State Chart Diagram
2/15/2017
jaya 3
Activity Diagram Activity diagram used for modeling dynamic aspect
of systems. It is used for business process(logic & rules)
modeling. It is essentially a flowchart, showing flow of control
from activity to activity. It shows concurrency as well as branches of control. It describes
How activities are coordinated to provide a service. The events needed to achieve some operation. Focus on the flow of activities involved in a single process.
2/15/2017
jaya 4
Activity Diagram Elements of Activity Diagram
Start /Initial Activity Activity Node Action Transition Decisions Synchronization Bar [Fork and Join ] Final Activity
2/15/2017
jaya 5
Elements of Activity Diagram
Start / Initial Activity This shows the starting point of first activity of
the flow . Graphically denoted by a solid circle. There can be only one initial state in a
diagram.
Initial Activity
2/15/2017
jaya 6
Elements of Activity Diagram
Activity Activity is parameterized behavior
represented as coordinated flow of actions. An activity is a process being modeled, such
as washing a car. an activity is a set of actions. Represented by a rectangle with rounded
(almost oval ) edges.
Activity Scan library card
2/15/2017
jaya 7
Elements of Activity Diagram
Action An action represent a single step within an
activity. Actions are active steps in the completion of a
process like calculations. Represented by a rectangle with rounded
corner.
Action Bill=item*price
2/15/2017
jaya 8
Elements of Activity Diagram Transition
The flow of the activity is shown using arrowed lines called transition.
A line going into a node is called an incoming edge, and a line exiting a node is called an outgoing edge.
Transitions are modeled using arrows.
Supplier sends shipment and bill
Generate shipment error notice
Send it to supplier
S/R clerk verifies the bill with purchase
order
Send shipment to inspector
Activity 1
Activity 2
Transition
2/15/2017
jaya 9
Elements of Activity Diagram Decision/Branching
Similar to flowcharts, a logic where a decision is to be made is depicted by a diamond , with the options written on either side of the arrows emerging from the diamond, within box brackets.
Supplier sends shipment and bill
Generate shipment error notice
Send it to supplier
S/R clerk verifies the bill with purchase
order
Send shipment to inspector
Activity3
actyivity1
Activity2
Decision
[opt 1] [opt2]
Guard expression
2/15/2017
jaya 10
Elements of Activity Diagram
Check account balance
Scan library card
Pay overdue fine
Scan asset
[Unpaid overdue fine]
[no unpaid fine]
Branch
Merge
Guard expression
2/15/2017
jaya 11
Elements Activity Diagram Synchronization Bar [Fork and Join]
Activities often can be done in parallel. To split processing(“fork”), or to resume processing
when multiple activities have been completed (“join”), synchronization bars are used.
These are modeled as solid rectangles, with multiple transitions going in and/or out.
Fork denotes the beginning of parallel activity. Join denotes the end of parallel processing.
Synchronization bar2/15/2017
jaya 12
Elements of Activity Diagram
Forking node
Join node
2/15/2017
jaya 13
Elements of Activity Diagram Synchronization Bar [Fork and Join]
activity1
activity3activity2
activity5activity4
activity6
Start
Fork
Join
End
Merge
Branch[condition 2][condition 1]
2/15/2017
jaya 14
Elements of Activity Diagram
Receive order
Send InvoiceFill order
Regular deliveryOvernight delivery
Close order
Start
Fork
Join
End
Merge
Branch[normal order][rush order] Receive
payment
Activity diagram for processing an order
2/15/2017
jaya 15
Elements of Activity Diagram Swim Lanes
A swim lane specifies a locus of activities. Used to distinguish activities carried out by individual
actors in an activity diagram. Swimlanes are vertical columns separated by thick vertical
black lines with actor’s name. Place each of the activity below the actor performing these
activities & then show how these activities are connected. Each swim lane has a unique name within its diagram. It
represents some real world entity. In an activity diagram partitioned into swim lane, every
activity belongs to exactly on swim lane, but transitions may cross lanes.
2/15/2017
jaya 16
Elements of Activity Diagram
Actor Actor Actor
activity
activity
activity
activity
activity
activity
swimlane
2/15/2017
jaya 17
Elements of Activity Diagram
Customer Sales Stockroom
Request service
Pay bill
Take Order
Fill Order
Deliver Order
Collect Order
2/15/2017
jaya 18
Elements of Activity Diagram Final Activity
The end of the activity diagram is shown by a bull’s eye symbol, also called as a final activity.
An activity diagram can have zero or more activity final nodes.
Graphical notation
2/15/2017
jaya 19
Activity Diagram
2/15/2017
jaya 20
Activity Diagram
2/15/2017
jaya 21
State Chart Diagram Using an interaction we can model the
behavior of a society of objects. Model the behavior of an individual object. State machines may be visualized in two
ways. Using activity diagram, we can focus on the
activates that take place within the object. Using state-chart diagrams(state diagram), we
can focus on the event-ordered behavior of an object, which is especially useful in modeling reactive systems.
2/15/2017
jaya 22
State Chart Diagram Purpose of State Chart Diagrams:
To model dynamic aspect of a system.
To model life time of a reactive system.
To describe different states of an object during its life time.
Define a state machine to model states of an object .
2/15/2017
jaya 23
State Chart Diagram Elements of state chart diagram
Initial State State Transition Event Final State
2/15/2017
jaya 24
Elements of State Chart Diagram
Initial State This shows the starting point or first activity of
the flow. Denoted by a solid circle. This is also called as a pseudostate , where
the state has no variable describing it further and no activities.
Initial State
2/15/2017
jaya 25
Elements of State Chart Diagram
State Represents the state of object at an instant of time. It is a condition or situation during the life of an
object during which it satisfies some condition, perform some activity, or waits for some event.
Denoted by a rectangle with rounded corners & compartments.
Changes in the system that occur, in background thread while the main process is running, are called sub states.
State notation
State name
State variable
State action
Board train
Train-no
2/15/2017
jaya 26
Elements of State Chart Diagram
Parts of state Name Entry/exit effect Internal transition Substates Deferred events
2/15/2017
jaya 27
Elements of State Chart Diagram
Transition An arrow indicating the object to transit from one state to
the other. The actual trigger event & action causing the transition are
written beside the arrow, separated by a slash. Transitions that occur because the state completed an
activity are called triggerless transitions. If an event has to occur after the completion of some event
or action, the event or action is called the guard condition.
2/15/2017
Event[Guard condition ]/Action
jaya 28
Elements of State Chart Diagram
Parts of Transition Source state Event Trigger Guard Condition Effect or Action Target state
2/15/2017
jaya 29
Elements of State Chart Diagram
Event An event is something that happens at a point in
time. An event is a one way transmission of information
from one object to another An event has no duration. Types of events
CallEvent SignalEvent TimeEvent ChangeEvent
2/15/2017
jaya 30
Elements of State Chart Diagram
Final Sates The end of the state diagram is shown by a
bull’s eye symbol, also called a final state. A final state is another example of a pseudo
state because it does not have any variable or action described.
2/15/2017
Final State
jaya 31
Advanced states & transition
Elements Entry & Exit actions Internal Transition Activities Deferred Events Substates Sequential Substates Concurrent Substates History States
2/15/2017
jaya 32
Elements of State Chart Diagram
Entry & Exit Actions An alternative to showing actions on
transitions, actions can be associated with entering or exiting a state.
Entry and Exit action is shown inside the state box following the keyword Entry or exit and /.
2/15/2017
State name
Entry/actionExit/action
Event/action1,action2
Do/activityEvent/defer
jaya 33
Elements of State Chart Diagram
Internal Transition Internal transitions are the events handled
inside a state without leaving it. Used when we want to handle the event but
don’t want to fire the states entry & exit action. Activities
In a state the object does some work that will continue until it is interrupted by an event
Deferred events It is a list of events that are not handled in that
stae but, rather, are postponed and queued for handling by other object in another state.
2/15/2017
jaya 34
State diagram for ATM
2/15/2017
Idle
Validating
Selecting
Processing
Card inserted
cancel
Active
Maintenance
Printing
maintain[continue]
[not continue]
Entry/read cardExit/eject card
jaya 35
Elements of State Chart Diagram
History Sates A flow may require that the object go into a
trance, or wait state, and on the occurrence of a certain event, go back to the state it was in when it went into a wait state-its last active state.
This is shown in a state diagram with the help of a letter H enclosed within a circle.
2/15/2017
HHistory State
jaya 36
History state
2/15/2017
Idle
Washing
Rinsing
CleanUP
HStart[close door]
[open door]
Active
jaya 37
Concurrent substates
2/15/2017
Engineering Study
Clear Theory Exam
Clear practical exam
jaya 38
Concurrent states
2/15/2017
Maintenance
IdleTesting devices
Self diagnosis
Waiting command
Testing
commanding
Composite state
Concurrent states
maintain