Book a Demo

Author Topic: StateMachine, transition behaviour, trigger Signal  (Read 13136 times)

fox75

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
StateMachine, transition behaviour, trigger Signal
« on: March 31, 2014, 11:34:48 pm »
Hi,

I have 2 stateMachines,
in a transition of StateMachine1 I would like to generate trigger on StateMachine2 using a behaviour (in order to use the defined signals from StateMachine1).

I think that this is something quite basic, but it is not possible, now I have some questions:
1) am I using wrong UML to make this? If yes what should be the way?
2) is this a restriction of EA ?

Thanks

MMA

  • EA User
  • **
  • Posts: 63
  • Karma: +3/-0
    • View Profile
Re: StateMachine, transition behaviour, trigger Si
« Reply #1 on: April 22, 2014, 08:48:05 am »
Yes, it is possible.
With EA 11, you can generate code supporting BroadCastEvent / SendEvent.

Before introducing the BroadCastEvent/SendEvent, please consider this question: Do you want 2 statemachines inside one context (class) or there should be 2 contexts, each of which have a statemachine.

Anyway, EA support both.

You can write code in transition's effect of state's entry/doActivity/exit behavior like this (this is a Java example):

m_StateMachineImpl.m_pManager.SendEvent("EventName", "context instance name");

There are other signatures of BroadCastEvent/SendEvent functions, some of which accept a signal instance, then you can crack the attribute value from signal as event arguments.

EA support C/C++/Java/JavaScript/C#

Hope this helps  ;)