Book a Demo

Author Topic: Same state several times on a seq diagram  (Read 4637 times)

ocroquette

  • EA User
  • **
  • Posts: 93
  • Karma: +0/-0
    • View Profile
Same state several times on a seq diagram
« on: December 14, 2007, 07:30:08 am »
Hi all

I like to show the state transition caused by the messages on the sequence diagrams by dragging and dropping the state from the project browser on the seq diagram.

It works great, but it allows to show a specific state only once, which is a major problem, for example when you want to show a state "idle" at the beginning and one more time at the end of the processing.

When I try to put it a second time (even as an instance), EA says that only one is allowed.

Any idea how to work around this limitation?
Is it UML or EA related?

Thanks

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Same state several times on a seq diagram
« Reply #1 on: December 14, 2007, 08:49:19 am »
Is this actually the same state, or do you have two different states, both of which are idle?

In the former case correct usage is to loop back to the original state. After all, that is what the system is doing, so the model should indicate the same thing.

In the latter case, create two separate states, and transition to and from them in accordance with how the system should operate.

Note that you can give two (or more) states the same name, but that is (usually) poor practice. In fact, if the word "idle" merely describes an attribute of the state - sort of like saying "when the system is in this state it is idle" - then you might want to find a better (less generic) name, and include descriptive notes in the state's properties. This will prevent confusion if other states could be described in a similar fashion.

HTH, David
No, you can't have it!

ocroquette

  • EA User
  • **
  • Posts: 93
  • Karma: +0/-0
    • View Profile
Re: Same state several times on a seq diagram
« Reply #2 on: December 14, 2007, 12:29:29 pm »

Thanks for the reply, but I think you are talking about a state diagram while my problem is on the sequence diagram.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Same state several times on a seq diagram
« Reply #3 on: December 14, 2007, 01:25:13 pm »
Oops, my bad.   :-[

But the same logic should apply to some extent.

That said, there are certainly cases where what you want to do makes sense, at least if you don't want the diagram to be unreadable.

I'm sure I saw a thread about this some months ago - almost certainly in 2007 though. There were several approaches discussed, with some additional discussion of the trade-offs involved with each option.

David
No, you can't have it!

ocroquette

  • EA User
  • **
  • Posts: 93
  • Karma: +0/-0
    • View Profile
Re: Same state several times on a seq diagram
« Reply #4 on: December 17, 2007, 12:23:09 am »

Thanks. I had done already some research, but the search function of the forum is really a pain, and I didn't find anything.
I will give it another try.

ocroquette

  • EA User
  • **
  • Posts: 93
  • Karma: +0/-0
    • View Profile
Re: Same state several times on a seq diagram
« Reply #5 on: January 07, 2008, 07:37:43 am »
Hi Midnight

Do you think you could find the thread again?
I tried but didn't find anything  :-/

Thanks!