Book a Demo

Author Topic: Relationship between sequences and state diagrams  (Read 4000 times)

Medic

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Relationship between sequences and state diagrams
« on: November 06, 2014, 06:03:25 am »
Hi experts,

As the title suggests I created classes and then object instances in my sequence diagrams. Each Object in the sequence has states that the object can be in and I need help understanding how to link the sequences and states of an object?

I can right click on the object in a sequence and create a child state diagram or start a state diagram from scratch. I'm not sure which is correct as multiple sequences have calls to a single object instance and it's state machine.

Is it possible to trigger state transitions of an object in a sequence diagram?

Any help is very much appreciated.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Relationship between sequences and state diagr
« Reply #1 on: November 06, 2014, 07:55:49 am »
Everything depends. But usually you create the state diagrams for the class. the instances then can take certain states per example (that is they have a certain state and an event will let them transit to another one). Those state transitions can be shown along with a sequence diagram. I haven't been down on that level for a while, so for a first go I'd place notes along with a state transition. Most likely there is a more elegant way to show such a transition.

q.

P.S. Just noticed that you can drag the state onto the SD and send it to the background. Now inside that state you can let your instances interact.
« Last Edit: November 06, 2014, 08:00:53 am by qwerty »

Medic

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Relationship between sequences and state diagr
« Reply #2 on: November 06, 2014, 01:33:33 pm »
Thanks for your reply,

That makes a lot of sense! If the states are defined with the class then each object should have the same behavior too. Nice!

I've used Mathworks Stateflow for years and most of my hardship with EA has been understanding how to get stuff done with their particular software.

It's been a rough road but I'm starting to understand how it all hangs together. Next job is to figure out how to transitions between states after a period of time has passed. Trigger type = time, Specification = !!?? no clue...

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Relationship between sequences and state diagr
« Reply #3 on: November 06, 2014, 09:31:13 pm »
Quote
Next job is to figure out how to transitions between states after a period of time has passed. Trigger type = time, Specification = !!?? no clue...
For that purpose you stay (mostly) inside the state machines. They have bells and whistles to show how and when states transit. It's a bit of an art in itself to create good state machines.

q.