Book a Demo

Author Topic: State Machine activities  (Read 6196 times)

avi10000

  • EA User
  • **
  • Posts: 201
  • Karma: +0/-0
  • Programmer/Writer
    • View Profile
State Machine activities
« on: October 30, 2021, 01:19:19 am »
Hi all,

I have just started to learn how to use state machines in UML/SysML.

I see that a state can contain three types of behavior: entry, do, and exit. I seem to remember taht each of these is refered to as an 'action'.

I see that I can define only one instance of a Do action (and for that matter also Entry and Exit actions).

Suppose I want to define the state to do two actions?

Seems I am missing something. These are just words to me. Is the 'action' in fact an action in an activity diagram? Or maybe an entire activity diagram?


That would explain why I can only 'Do' a single action.


Thanks
Avi



qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: State Machine activities
« Reply #1 on: October 30, 2021, 01:31:22 am »
The Do action is performed each time the state re-enters itself. So you do what ever is needed in that case. Entry and exit are performed when the stated is entered or exited. Put what ever behavior in the Do, even if you dare to have more than one statement...

q.

avi10000

  • EA User
  • **
  • Posts: 201
  • Karma: +0/-0
  • Programmer/Writer
    • View Profile
Re: State Machine activities
« Reply #2 on: October 30, 2021, 01:32:37 am »
How do I add more than one statement?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: State Machine activities
« Reply #3 on: October 30, 2021, 01:35:25 am »
Not sure if you are talking about the simulation. I'm not using that...

Quote from: UML 2.5 specs
14.2.3.4.3 State entry, exit, and doActivity Behaviors

A State may have an associated entry Behavior. This Behavior, if defined, is executed whenever the State is entered through an external Transition. In addition, a State may also have an associated exit Behavior, which, if defined, is executed whenever the State is exited.
A State may also have an associated doActivity Behavior. This Behavior commences execution when the State is entered (but only after the State entry Behavior has completed) and executes concurrently with any other Behaviors that may be associated with the State, until:
• it completes (in which case a completion event is generated) or
• the State is exited, in which case execution of the doActivity Behavior is aborted.
The execution of a doActivity Behavior of a State is not affected by the firing of an internal Transition of that State.

q.