Book a Demo

Author Topic: How to add multiple entry/exit actions to a state?  (Read 23230 times)

Anmk

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
How to add multiple entry/exit actions to a state?
« on: November 13, 2021, 08:47:19 pm »
Hi all,
I am designing a state chart for a class. one of the states in the state chart should do multiple actions as entry action.
I could add one action to the entry action of the state, but I don't know how can I add other actions to entry action field of the state.
Is this feature supported by EA (ver. 15.2) or we can only have one action per entry in each state?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to add multiple entry/exit actions to a state?
« Reply #1 on: November 13, 2021, 09:48:37 pm »
That's per UML specs. Anything to be done at entry is done in ONE action. What about an order if you had multiple entry do actions? You would control all those in the single action. Seems pretty logicial, doesn't it?

q.

Anmk

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: How to add multiple entry/exit actions to a state?
« Reply #2 on: November 13, 2021, 10:33:36 pm »
Yeah it seems logical.
But how about code generation?
If we cannot to add multiple operations of a class as entry actions in EA, I should define a new operation(e.g. stateXentryAction that is not an operation of my class) and call the operations (that I want to call when I enter the state) of my class inside the stateXentryAction operation. right?


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to add multiple entry/exit actions to a state?
« Reply #3 on: November 14, 2021, 02:24:50 am »
An action is an arbitrary amount of code. You put in that behavior you need to control the entry. If you need to invoke other operations, then just do so right in there.

q.