# Sequence diagram with Objects (not classes)?

**URL:** <https://forums.visual-paradigm.com/t/sequence-diagram-with-objects-not-classes/17501>\
**Category:** UML\
**Tags:** modeling\
**Created:** [April 7, 2022, 7:10am UTC](https://forums.visual-paradigm.com/t/sequence-diagram-with-objects-not-classes/17501 "2022-04-07T07:10:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bjarredsbon](https://avatars.discourse-cdn.com/v2/letter/b/e36b37/32.png) [@Bjarredsbon](https://forums.visual-paradigm.com/u/Bjarredsbon)\
**Post date:** [April 7, 2022, 7:10am UTC](https://forums.visual-paradigm.com/t/sequence-diagram-with-objects-not-classes/17501/1 "2022-04-07T07:10:20Z")

</div>

Hello,

I have a Class diagram where I have created some classes.  
Then I have an Object diagram where I have instantiated these Classes (Instance specification).  
Then when I create a Sequence diagram I was expecting to be able to select my Objects for “Base Classifier”, but I can only select my Classes. Is this expected?

If I create multiple objects from the same class, how can I in a Sequence Diagram show which of the objects I work with?

If there is a “advanced” guide how to best model a state machine implemented inside a class - please share a link. Ideally I would like to be able to clearly show the current state of the state machine in a Sequence Diagram (automatically or manually)

Thank you

---

<div class="post-metadata">

**Author:** ![Jick](https://avatars.discourse-cdn.com/v2/letter/j/ea666f/32.png) [@Jick](https://forums.visual-paradigm.com/u/Jick)\
**Post date:** [April 13, 2022, 2:38am UTC](https://forums.visual-paradigm.com/t/sequence-diagram-with-objects-not-classes/17501/2 "2022-04-13T02:38:52Z")

</div>

Hi Bjarredsbon,

Thank you for your inquiry. Both a lifeline and instance specification (in an object diagram) are instances of a classifier. The following video shows you how to select a class to be the base classifier of a lifeline

Besides the steps demonstrated in the video, you can also drag and drop a Class onto a sequence diagram to create lifelines.

> [@Bjarredsbon](#):
>
> If I create multiple objects from the same class, how can I in a Sequence Diagram show which of the objects I work with?

You can give different names to different lifelines.  
 ![image](https://forums.visual-paradigm.com/uploads/default/original/2X/d/dac363bb729e45863160712f23233f4055143bf9.png)

> [@Bjarredsbon](#):
>
> If there is a “advanced” guide how to best model a state machine implemented inside a class - please share a link.

Please read the articles below.

> **[How to model a state machine with UML - Visual Paradigm](https://www.visual-paradigm.com/support/documents/vpuserguide/276/386/28092_modelingguid.html)**
>
> Learn how to effectively design a state machine with Class Diagram and State Machine Diagram. Read this step-by-step guide for details.

> **[How to Generate Code from State Machine Diagram?](https://www.visual-paradigm.com/tutorials/how-to-generate-code-from-state-machine-diagram.jsp)**
>
> Quickly learn how to model a controller class and its state machine. You will also generate state machine code and SCXML from your state machine.

Best regards,  
Jick Yeung

---

<div class="post-metadata">

**Author:** ![Bjarredsbon](https://avatars.discourse-cdn.com/v2/letter/b/e36b37/32.png) [@Bjarredsbon](https://forums.visual-paradigm.com/u/Bjarredsbon)\
**Post date:** [April 13, 2022, 2:11pm UTC](https://forums.visual-paradigm.com/t/sequence-diagram-with-objects-not-classes/17501/3 "2022-04-13T14:11:47Z")

</div>

Thank you Jick

I started to look at the State machine tutorial which was very helpful.

Up until now I have manually edited the caption of each transition (so the operation name is shown).  
Now I can use “Call trigger” and associate it with an operation of the class. This is just like I want it. Very promising!

But I discover one small problem. When I hit “Open specification” for a Transition and show Triggers, they all have a manually edited Name. If I do not enter a Name, it will remain blank. And this Name is shown in the State Machine Diagram.

Is there a way to automatically show the Name from the Trigger here, or by default fill the Name to match the associated operation? This would save some work and also ensure consistency if the operation later is renamed.

Or should perhaps the Triggers be pre-created in some other Diagram type? I must say I do not yet have a clear picture of how all diagrams fit together. It is a a bit magic.

Thank you  
/Peter
