Book a Demo

Author Topic: Associate a state machine with its classifier  (Read 3671 times)

Andrew Warner

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Associate a state machine with its classifier
« on: February 05, 2010, 04:23:08 pm »
Hi all,
I haven't been able to find a way of associating a state machine with its classifier. Is this a limitation on the corporate edition (I think you can't generate code from state machines in corp ed.) or have I missed something?

The state machine tutorial http://www.sparxsystems.com/uml_tool_guide/uml_dictionary/statediagram.html (at the bottom) has an exerpt from the UML spec waxing lyrical about the context classifier but there seems to be no way to associate them with the poor old orphaned state machine, apart from defining my own connector.

[edit]I might have stumbled on the approach. Is it simply that one puts the state machine in the classifier as a child? That seems to be hinted at in the help section "Define an Object State" where is says
Quote
If the associated classifier has a child State Machine element, those states propagate into the drop-down list for this field, and you can select one of them instead.
The trouble is that one needs to know that that particular child element is the state machine for the classifier in question. A more explicit association might be more useful. I also forgot that the state machine is really representing the state of an object (or is that instance specification?), rather than a class.[/edit]

Ta.
« Last Edit: February 05, 2010, 05:01:03 pm by adwarner »
Regards,
Andrew Warner.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Associate a state machine with its classifier
« Reply #1 on: February 08, 2010, 07:25:10 pm »
Andrew,

Defining the state machine(s) as a nested element of your classifier is indeed the way to go.
That relations seems pretty solid to me, but if you somehow want to visualize it you can use the nesting connector. EA doesn't automatically add or remove the nesting connectors, so you'll need to manually manage those.

About the class/object issue, I think the state machine represents the state (transitions) of all objects (instance specifications) of the parent classifier. Since the classifier is no more then the definitions for all its instances it is safe to say that the state machine represents the state lifecycle of the classifier.

Do you agree?

Geert

Andrew Warner

  • EA User
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: Associate a state machine with its classifier
« Reply #2 on: February 09, 2010, 08:57:54 am »
Thanks Geert,
that sums it up nicely.

Cheers,
Andrew.
Regards,
Andrew Warner.