Book a Demo

Author Topic: Using the executable state machine to generate a full application  (Read 8537 times)

revdev

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
  • Love this stuff.
    • View Profile
I would like to hear about experiences from engineers who have developed applications using EA's executable state machines and code generation from UML diagrams.  I am looking into it for developing a non-regulated laboratory device that performs real-time process control.
re-Vision Development

PeterHeintz

  • EA Practitioner
  • ***
  • Posts: 1001
  • Karma: +59/-18
    • View Profile
Re: Using the executable state machine to generate a full application
« Reply #1 on: November 15, 2016, 07:33:01 pm »
See e.g. this:
http://sparxsystems.com/forums/smf/index.php/topic,37427.msg234453.html#msg234453

I would not spend to much effort in trying to go in this direction.
UML is a specification language, not a programming language.
Best regards,

Peter Heintz

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Using the executable state machine to generate a full application
« Reply #2 on: November 15, 2016, 09:26:00 pm »
But that guy started looking for code from ADs (which really does not make much sense). The major drawback with code from state machines is the synchronization. Also, I have never used code generation from state machines (my license does not support that), but eventually in the right context I'd make use of it.

q.

revdev

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
  • Love this stuff.
    • View Profile
Re: Using the executable state machine to generate a full application
« Reply #3 on: November 16, 2016, 02:42:44 am »
I have used code generation from UML successfully on a couple of projects.  One popular tool we used was Rhapsody which is now "supported" by IBM.  I am totally on board with the concept.  I just want to know if anyone here is using EA for this purpose. 
re-Vision Development

PeterHeintz

  • EA Practitioner
  • ***
  • Posts: 1001
  • Karma: +59/-18
    • View Profile
Re: Using the executable state machine to generate a full application
« Reply #4 on: November 16, 2016, 03:46:38 am »
Are you saying with Rhapsody you created "full applications"?
Best regards,

Peter Heintz

revdev

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
  • Love this stuff.
    • View Profile
Re: Using the executable state machine to generate a full application
« Reply #5 on: November 16, 2016, 04:54:02 am »
Yes, using Rhapsody, and on another application, using System Architect and a custom code generator from Pathfinder Solutions, Inc.
re-Vision Development

PeterHeintz

  • EA Practitioner
  • ***
  • Posts: 1001
  • Karma: +59/-18
    • View Profile
Re: Using the executable state machine to generate a full application
« Reply #6 on: November 16, 2016, 06:50:04 pm »
Interesting!
What programming language did you use for your application?
Does it mean you did not write any programming language code at all, or did you put the code just in Rhapsody?
Best regards,

Peter Heintz

revdev

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
  • Love this stuff.
    • View Profile
Re: Using the executable state machine to generate a full application
« Reply #7 on: November 17, 2016, 02:24:45 am »
We used C++.  This was a medical imager.  The application drove a variety of stepper and servo motors, performed a variety of sequential tasks, and relied on a number of sensors.  It was easily described in multiple cooperating state machines.  Rhapsody provided that class definition and state machine engine.  Each state action was written by hand in C++.  Their architecture supported events, timers, and state transitions within their threading model.

We wrote all algorithms in C++.
re-Vision Development

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Using the executable state machine to generate a full application
« Reply #8 on: November 17, 2016, 09:00:43 am »
Each state action was written by hand in C++.
There's the key point. You're not talking 100% code generation.

It was easily described in multiple cooperating state machines.  Rhapsody provided that class definition and state machine engine.
Which is exactly what the executable state machine does.

Their architecture supported events, timers, and state transitions within their threading model.
Which you can do in Enterprise Architect, but it gives you control over the threading model and timers, by not implementing them directly. Even with the limited amount of real-time coding that I've done, I'd be more comfortable with that.

revdev

  • EA User
  • **
  • Posts: 27
  • Karma: +0/-0
  • Love this stuff.
    • View Profile
Re: Using the executable state machine to generate a full application
« Reply #9 on: November 18, 2016, 12:52:37 pm »
Hi Simon.  How do you create an event with data?  I have seen in the generated code that "signal" is used, but I don't see the signal passed on to the "behavior" part of the state action.  Thanks in advance.
re-Vision Development

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Using the executable state machine to generate a full application
« Reply #10 on: November 21, 2016, 08:47:13 am »
In the model, create a Signal element, and add the required attributes to it.

I can't remember if there's anything special you need to do from code if you want to raise one of these events.