Book a Demo

Author Topic: State Interpreted Simulation: sleep + triggers behaviour  (Read 3604 times)

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
State Interpreted Simulation: sleep + triggers behaviour
« on: October 10, 2018, 10:27:15 pm »
Hi,

I defined a statemachine diagram to simulate in the interpreted mode.
When I entered a state, a variable value is set e.g. this.waitingTime = 10 and decreased until reaching 0, triggering another state and associated waiting time.

I initially wanted to run a "sleep" function but didn't find anything.
Currently this is a self transition that exits and enters the state with an effect: this.waitingTime--;
There's another outgoing transition when this.waitingTime reaches 0 to move to the next state.
Note: I tried to use operations (Do) with a Behavior code that also decreases the value but it's only executed once.

On one state I want to have a trigger that lets the user leave this state. Unfortunately this trigger is not available when executing the simulation. It seems that the simulation engine does not have time to provide this waiting trigger as it keeps changing the state.

Is there any workaround?
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: State Interpreted Simulation: sleep + triggers behaviour
« Reply #1 on: October 11, 2018, 08:50:31 am »
I would do what you have done inside a substate instead. That way you're never leaving the other state.

Personally, I would also prefer to more the constraint on the time reaching zero to a transition from the child state to a final node. The unguarded transition from the parent will then be considered a completion event. It's a little neater and fits with (my understanding of) the the philosophy of state machines better.
« Last Edit: October 11, 2018, 08:55:03 am by Simon M »

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: State Interpreted Simulation: sleep + triggers behaviour
« Reply #2 on: October 11, 2018, 05:58:09 pm »
Hi Simon,

I carried some tests as you suggested and I still don't get the trigger (Break) whilst it's counting down.

See the example below:

« Last Edit: October 11, 2018, 05:59:51 pm by Guillaume »
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: State Interpreted Simulation: sleep + triggers behaviour
« Reply #3 on: October 12, 2018, 09:02:59 am »
There's a similar issue with the music player sample from the example model. The Stop message doesn't show up in either of the play states.

I'm not sure what has changed.

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Re: State Interpreted Simulation: sleep + triggers behaviour
« Reply #4 on: October 12, 2018, 05:47:24 pm »
Should I report a bug, or can you please look into it?

Thanks
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com