Book a Demo

Author Topic: State Machine and Internal State Event  (Read 4074 times)

christophefournier

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
State Machine and Internal State Event
« on: May 11, 2009, 05:50:21 pm »
Hi,
I have a problem I can not solve alone.

A transition can be due to an event, there can be a guard condition, and the resul is an action, linked to the transition it self.

I would like to do the same INSIDE a State, and without exiting and re-entering the same State.
To do that, I use the "operations" of a State.
The problem is that :
- the event is call : "action"
- i am obliged to cheat and the guard condition is included in the "action" field.
- the result of the event is called "name"

Is there a better way of doing that ?

Chris

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: State Machine and Internal State Event
« Reply #1 on: May 11, 2009, 09:33:48 pm »
Try using substates. Then model the parent state such that the transition out occurs when any (single or combination of) substates exit. [The conditions for exiting the parent would be determined by the internal structure, as per UML.
No, you can't have it!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: State Machine and Internal State Event
« Reply #2 on: May 12, 2009, 09:05:32 am »
Or... use a transition but give it the stereotype «internal».
The Sparx Team
[email protected]

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: State Machine and Internal State Event
« Reply #3 on: May 12, 2009, 10:56:12 am »
Quote
Or... use a transition but give it the stereotype «internal».
Yes Neil,  but it MUST be between internal substates (by definition); No?

I think David's hit the nail on the head.  If you can't define substates then you need to query whether a transition should exist.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

christophefournier

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: State Machine and Internal State Event
« Reply #4 on: May 12, 2009, 06:13:31 pm »
Hi all,
I thank you for your help.
I think I will use the stereotype "internal", that stereotype that will mean "do not execute the entry nor the exit functions".
Good job !