Author Topic: state machines  (Read 683 times)

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +0/-0
    • View Profile
state machines
« on: January 10, 2014, 12:27:13 am »
Hi
I am new to state machines and would appreciate some help in this area

The basic idea behind my state machine is
The starting state is called 'Monitoring' which consists of 2 parallel states (State 1 and State 2)
Initially State 1 waits for events and when some criteria is met State 2 should start and respond to the same events as State 1
Now both states should respond to the same event but when State 2 detects some criteria it should transition to 'RecordingEvent' and finish but State 1 should continue

I have attempted to put this into a state diagram (see link) and would be grateful if anyone has any comments

Many thanks for your time
https://www.dropbox.com/s/urg01fmkza6dko4/StateMachine1.bmp

Thanks
Using V12

Simon M

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6354
  • Karma: +54/-5
    • View Profile
Re: state machines
« Reply #1 on: January 13, 2014, 09:40:44 am »
In your current diagram:
  • State1 and State2 are being activated at the same time
  • A transition between two regions is illegal
  • You will need to put RecordingEvent and RecordingPostEvent into the waiting region of state Monitoring if you don't want State1 exited.

If I was modelling what you have described I would:
  • Delete the recordReceived initial node and fork.
  • Add a self-transition to State1
  • Set a trigger of type Signal with the name of both the signal and trigger being RecordReceived
  • Give it a guard if there are any circumstances where State1 shouldn't handle the record
  • In the advanced page set the kind to internal. (Which means that State1 is not exited while handling the event)
  • Add an additional state into the waiting region. Add a transition to that when [pre event time reached guard] with the RecordReceived trigger.
  • Put RecordingEvent and RecordingPostEvent into the waiting region of state Monitoring.
  • Check the transitions previously to State2 to see if they should still be State2 or the new state.
Simon

support@sparxsystems.com

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +0/-0
    • View Profile
Re: state machines
« Reply #2 on: January 13, 2014, 06:59:48 pm »
Thanks Simon

That's a lot clearer
Using V12