Author Topic: EA simulation using SendSignals and Accept Events  (Read 1425 times)

joeT

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
EA simulation using SendSignals and Accept Events
« on: October 19, 2014, 02:57:40 pm »
I am stuggling with how best to simulate an activity diagram with SendSignals and Accept Events and have the SendSignal trigger an asynchronous message that is received by the Accept Event. I am using sysML for this example though I expect it will have identical behaviour to UML for EAs implementation of activity diagrams and simulation.

So far, following the EA user guide as an example, I have created a signal called Signal_Pushdown and assigned an attribute, Name (buttonState) Type (boolean) Initial Value (true)

I created an Accept Event called PushButtonPressed and assigned a Trigger Name (PushDown), Type (Signal) Specification (Signal_PushDown) selecting the signal previously created. This created a Trigger in the Project browser called PushDown.

I then created a SendSignal called PushButtonPressed and assigned a Signal, Signal (Signal_Pushdown), Argument-Attribute buttonState and Argument-Value (true) and added this to a Pin of the SendSignalEvent.

Next I created a simple activity diagram to simulate an activity (Activity6) which splits behavoural flow between two parallel acitivities, one with the the SendSignal (Activity1) and one with the Accept Event (Activity2). The simulation runs and performs both the SendSignal and the AcceptEvent (as seen below) however there are no events visible in the Simulation Event window, I can't see any triggers created and the simulation stalls on the Accept Event, I suspect the reason being that there are no triggers present for it to use. The simulation provides evidence in both the simulation window and the call stack that shows that the SendSignal is evaluated, e.g.,

[27497928]      Activity6.Activity1.PushButtonPressed (this is the SendSignal)
[27498136]      Activity6.Activity2.PushButtonPressed (this is the AcceptEvent)

Can someone please provide some information as to what I may be doing incorrectly or direct me towards an example of how to correctly set up simulations in EA using SendSignal and Accept Events?

Regards,
joeT

Colin Coates

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: EA simulation using SendSignals and Accept Eve
« Reply #1 on: October 24, 2014, 08:53:09 pm »
Hi Joe,

My initial suggestion would be to use a state machine rather than an activity diagram. I think you want to be able to define a number of modes for your system; each system mode will be modeled as a state. I think you would like the system to rest in a state until it receives a trigger (event) that may cause a transition into a new state.

So for your example (and assuming you are using Sparx Enteprise Architect version 10 or 11):
1. Create a class diagram, and draw a "Button" class.
2. Right click the class to add a new state machine child diagram.
3. Add "up" and "down" states to the diagram.
4. Draw a transition from "up" to "down". View the properties of the transition and type "press" into the trigger field.
5. Draw a transition from "down" to "up". View the properties of the transition, and type "release" into the trigger field.
6. Add an initial pseudo-state to the diagram, and draw a transition from it to the "up" state.
7. Switch to the VEA Simulation work space layout.
8. Click the "Analyzer | Simulation Events" menu option (you might like to dock that floating window somewhere convenient).
9. Right-click inside the background (not on an element) of the state machine diagram and then select "Execute Simulation | Interpreted simulation".
10. Playtime!
« Last Edit: October 24, 2014, 08:57:33 pm by ColinCoates »

Helmut Ortmann

  • EA User
  • **
  • Posts: 909
  • Karma: +38/-1
    • View Profile
Re: EA simulation using SendSignals and Accept Eve
« Reply #2 on: October 28, 2014, 01:37:09 am »
Hi,

the example model shipped with EA provides an example.

On the SPARX homepage, Resources, All demonstrations you find the example: Simulation and Prototyping (http://www.sparxsystems.com/resources/demos/index.html).

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

joeT

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: EA simulation using SendSignals and Accept Eve
« Reply #3 on: November 15, 2014, 11:07:42 am »
Thanks for your help Helmut,

When simulating the EAExample model, (Activity diagram - Sending Signals), I was unable to create an event for the execution of Action1, i.e. the simulation trace got as far as the second ForkJoin and was blocked waiting for tokens from Action2 and Action7.

I am running this on the professional version, maybe it is possible the professional version has some limitations on the simulation of signals?

The simulation trace window is provided below which shows events for sending signals for Action2 and Action7. I'm not sure what this means or if the order of the execution needs to be or can be modified.

[07100006]      Configuration: mode: Manual simulation, platform: UML Basic
[07100006]      Preparing Simulation Data
[07101036]      Loading Machine
[07101069]      Simulation Started
[07101070]      Sending Signals
[07101606]      Sending Signals.ActivityInitial
[07102312]      ForkJoinV
[07103211]      Sending Signals.Action7
[07103436]      Sending Signals.Action5
[07103730]      Sending Signals.Action2
[07104647]      Sending Signals.Action1
[07105383]      ForkJoinV

I'll keep looking into this to see what I am doing wrong.  Thanks again for all of the help.

Nabil

  • EA User
  • **
  • Posts: 108
  • Karma: +5/-2
  • Customizing EA for you
    • View Profile
    • View My LinkedIn Profile Here
Re: EA simulation using SendSignals and Accept Eve
« Reply #4 on: November 18, 2014, 10:08:59 pm »
Hi Joe,


if you are still looking for some reference you can check this post in EA Community

http://community.sparxsystems.com/tutorials/693-creating-and-simulating-also-validating-a-state-machine-using-enterprise-architect

hope this will be helpful

Regards,
Nabil
« Last Edit: November 18, 2014, 10:09:55 pm by nabilsparx »

Sparx Systems India - Services
Consulting | View Training Plans | Profile View