Author Topic: Link States into the sequenz diagramm  (Read 3471 times)

rhkrhk

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Link States into the sequenz diagramm
« on: September 26, 2007, 06:49:02 am »
I am still toying around with the sequenz diagramm.
It seems to me that UML allows to add a state of a class into the sequenz diagramm. This would act as a constraint, in the way, that the message can only be send, if the sender is in the given state.

I have not seen a way to add a state object for the state diagramm into the sequenz diagramm. (One could enter a note, but it appears that I am a fan of tracebility)

MrDX

  • EA User
  • **
  • Posts: 49
  • Karma: +0/-0
    • View Profile
Re: Link States into the sequenz diagramm
« Reply #1 on: September 26, 2007, 09:51:01 am »
Do you mean the StateInvariant or Continuation?
Perhaps, you can tell us the page of the UML specification where you find the element you want to add.

rhkrhk

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Link States into the sequenz diagramm
« Reply #2 on: September 26, 2007, 11:02:51 pm »
Being quite new to this UML stuff, I just found this thing in a book, and was wondering whether it would be usefull on a later project of mine.



Anyway - I mean StateInvariant.
but digging through the UML Specification, to find a passage - sorry
« Last Edit: September 26, 2007, 11:16:59 pm by rhkrhk »

MrDX

  • EA User
  • **
  • Posts: 49
  • Karma: +0/-0
    • View Profile
Re: Link States into the sequenz diagramm
« Reply #3 on: September 26, 2007, 11:08:52 pm »
You can upload files here:
http://www.imageshack.us/
... and post it with the [image]-Tag

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Link States into the sequenz diagramm
« Reply #4 on: September 27, 2007, 03:14:41 am »
In UML Superstructure 2.1 (06-04-02) this was (very) slightly clarified. In response to issue 7995 the diagram that gives examples now shows StateInvariant and Continuation elements separately.

By doing so OMG removed the confusion about whether these elements can apply to multiple lifelines.

A StateInvariant applies to a single lifeline. As such, Sparx appears to have this working correctly. See State Invariant | Element in EA Help. (I am using build 817, but I believe this has not changed in some time.)

A Continuation may apply to multiple lifelines. Once again Sparx appears to have it right. As before, you can find this in help. This time you need to look for Continuation | Element, as the entry does not appear to be associated with states.

Remember that you can render a StateInvariant as a comment associated with the lifeline. EA would likely allow you to associate the comment with other lifelines, which might give you something more like your diagram. However, this might not be semantically sound. [It seems to me to imply certain things about when the StateInvariant constraint is evalueate (since StateInvariants are a form of constraint), what constitutes failure (consider what happens if the result is true for one lifeline and false for another), the effect of failure (what is the result of causing multiple traces to be invalid). These ambiguities suggest lack of clarity elsewhere in your model, and are best addressed there.]

Remember that you can associate (via a note) a StateInvariant with an OccurrenceSpecification (or Occurrence in EA-speak) . I've not tried this, but it might address some of what you are trying to accomplish.

Also remember, as always, that if you really must, you can always bend the rules. Just be sure that you work through the implications of such a decision, and document your decision and the results.

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