http://staruml.sourceforge.net/docs/user-guide%28en%29/ch05_3.html
Modeling with Sequence Diagram
The following elements are available in a sequence diagram.
- Object
- Stimulus
- SelfStimulus
- Combined Fragment
- Interaction Operand
- FrameSubsytem
Object
Procedure for creating object
In order to create object,
- Click [Toolbox] -> [Sequence] -> [Object] button.
- And click at the position where object will be placed in the [main window].
- Object quick dialog is shown. At the quick dialog, enter the object name.
- Press [Enter] key.
Procedure for setting active object
In order to set class to active object,
- Set assigned class's [IsActive] property to true.
- For MyObject, change MyClass's IsActive property.
- If class property is not assigned, you can't change object to active object. The result is as follows.
Procedure for setting to multi object
In order to set object to multi object,
- Set object's [IsMultiInstance] property to true.
- Then the object is changed to multi object.
Procedure for creating object from class
In order to create object from class,
- Select class in the [model explorer].
- Drag and drop it into [main window].
- Finally, a object is created on the diagram.
Procedure for creating class from object
If class is not assigned to object,
- Double-click object to pop up quick dialog, click add class button
- At the [Enter element name] dialog, enter the new class name.
- And new class is created and assigned to object.
- If you want existing class to be assigned to object, click
button in object's classifier property, and select class to be assigned to object at the [Select a model element] dialog.
Procedure for creating outgoing from object stimulus by using shortcut creation syntax
In order to create outgoing stimulus from selected object to another object,
- Double-click from-object, or select from-object and press [Enter] key to pop up quick dialog.
- At the quick dialog, enter stimulus name after "->" string ("<-" string for incoming and "<->" for outgoing with return).
- Press [Enter] key and outgoing stimulus from selected object to target object is created and placed at the last order.
Stimulus
Semantics
A Stimulus is a communication between two Instances that conveys information with the expectation that action will ensue. A Stimulus will cause an Operation to be invoked, raise a Signal, or cause an Instance to be created or destroyed.
Procedure for creating stimulus
In order to create stimulus,
- Click [Toolbox] -> [Sequence] -> [Stimulus] button.
- Drag from one object, and drop to the other(object or lifeline) in the[main window] in outgoing direction.
- Stimulus quick dialog is opened. Enter the stimulus name at the quick dialog and press [Enter] key.
- Finally, a stimulus is created as follows.
Procedure for using operation in class as stimulus
If classifier property of receiver(object) of stimulus is assigned and you want to assign operation to stimulus,
- Double-click stimulus
- Click
button at the quick dialog.
- Select operation on the [Select an operation] dialog, and click [OK] button.
- New stimulus mapped to class's operation is added as follows.
Procedure for creating operation of class from object
To create operation of class as stimulus's receiver from object and assign it to stimulus,
- Double-click stimulus, click
button at the quick dialog.
- Enter new operation name to be created, and click [OK] button.
- New operation is added to the class and text is filled at the quick dialog (This procedure is valid when there exists assigned class.). Press [Enter] key.
- See [model explorer] to confirm creation of new operation.
Procedure for creating previous stimulus of current stimulus by using shortcut creation syntax
In order to create previous stimulus to current stimulus,
- Double-click a stimulus, or select a stimulus and press [Enter] key.
- At the quick dialog, After "~>" string("<~" for incoming stimulus), enter target object name and stimulus name.
- Press [Enter] key, and then new object and stimulus are created and arranged above selected stimulus.
Procedure for creating next stimulus to current stimulus by using shortcut creation syntax
In order to create next stimulus to selected stimulus,
- Double-click a stimulus, or select a stimulus and press [Enter] key.
- At the quick dialog, After "_>" string("<_" for incoming stimulus), enter target object name and stimulus name.
- Press [Enter] key, and then new object and stimulus are created and arranged next to selected stimulus.
Procedure for creating sub stimulus by using shortcut creation syntax
In order to create a sub stimulus of selected stimulus,
- Double-click a stimulus, or select a stimulus and press [Enter] key.
- At the quick dialog, After "->" string("<-" for incoming stimulus), enter target object name and sub stimulus name.
- Press [Enter] key, and then new object and stimulus are created and arranged on the bottom of selected stimulus's activation.
Procedure for reconnecting to another object
In order to reconnect stimulus to another object,
- Click the end of stimulus.
- Drag the end of stimulus and drop it to another object.
- Then stimulus will be connected to another object.
Procedure for changing ActionKind of stimulus
The [ActionKind] property of stimulus should be assigned to one of five sort as following. To change [ActionKind] property, select stimulus and select the [ActionKind] property on the properties window.
ActionKind | Shape |
---|---|
CALL | ![]() |
SEND | ![]() |
RETURN | ![]() |
CREATE | ![]() |
DESTROY | ![]() |
SelfStimulus
Procedure for creating self-stimulus
In order to create self-stimulus,
- Click [Toolbox] -> [Sequence] -> [SelfStimulus] button.
- And click the object(or lifeline) that self-stimulus will be placed in the [main window].
- Object quick dialog is opened. At the quick dialog, enter the stimulus name and press [Enter] key.
- The result of procedure is as follows. You may arrange stimulus position to reduce overlapping of text and line.
Combined Fragment
Procedure for creating combined fragment
In order to create Combined Fragment,
- Click [Toolbox] -> [Sequence] -> [Combined Fragment] button.
- And click at the position where Combined Fragment will be placed in the [main window].
- A combined fragment is created.
- Change interaction operator in the properties as follows.
- The combined fragment is shown as follows.
Procedure for creating interaction operand
In order to create Interaction Operand,
- Click [Toolbox] -> [Sequence] -> [Interaction Operand] button.
- And click at the Combined Fragment where Interaction Operand will be placed in the [main window].
- New interaction operand is added to the combined fragment. Click the interaction operand.
- The selection points of interaction operand are shown, drag it to arrange its boundary.
Frame
Procedure for creating frame
In order to create Frame,
- Click [Toolbox] -> [Sequence] -> [Frame] button.
- And click at the position where Frame will be placed in the [main window].
- A new frame is created as follows.
Diagram
Procedure for showing sequence numbers in the diagram
In order to show or hide stimulus sequence number,
- Select the diagram in the [model explorer] or in the [main window]
- And configure [ShowSequenceNumber] property of diagram to true or false.
- When [ShowSequenceNumber] is false, sequence diagram is shown as follows.
Procedure for changing signature style of message in the diagram
There are four message style. To change stimulus signature, select the diagram in the [model explorer] or in the [main window], and configure[MessageSignature] property of diagram to one of the followings.
Style | Example |
---|---|
NONE | ![]() |
NAMEONLY | ![]() |
TYPEONLY | ![]() |
NAMEANDTYPE | ![]() |
Procedure for changing activation style in the diagram
In order to show or hide stimulus activation, select the diagram in the [model explorer] or in the [main window], and configure [ShowActivation] property of diagram to true or false.