Book a Demo

Author Topic: Adding Entry and Exit to a Composit State Diagram  (Read 3168 times)

Josef Stadelmann

  • EA User
  • **
  • Posts: 59
  • Karma: +0/-0
  • as simple as possible, but not too simple
    • View Profile
Adding Entry and Exit to a Composit State Diagram
« on: May 18, 2011, 11:27:46 pm »
is it the same to add Entry and Exit Point to a composit state by dragging and dropping an icon from the tools box SysML onto the expanded composit state diagram  

AS OPPOSED TO

adding an Entry or Exit Point by using Right Mouse Button Down over the composit state diagram and then selecting Embedded Elements to add an Exit or Entry Point.

In the later (logical case) the Entry and Exit Point is placed very exact at the border line of the expanded state diagram BUT connecting this Entry and Exit Points using the State Transition Table Editor or draging a Transition to it is a thing of magic. It does not seem to make em sharp and snap to the transition as one would expect when placing a transition between states.

So again my question:
Is it the same, and if yes why are all examples from SysML arround such composit states equipped with overlyas in form of states just to connect from state to a sub-state or entry point in a sub-state?

What is the rational behind ALL that?

Shall I log a bug? or request a feature?

Josef

Frank Horn

  • EA User
  • **
  • Posts: 535
  • Karma: +1/-0
    • View Profile
Re: Adding Entry and Exit to a Composit State Diag
« Reply #1 on: May 19, 2011, 06:39:27 pm »
I have not yet tested it with version 9, and haven't worked with state machines for months now, but I remember that handling of entry and exit points has always been incosistent.

There are lots of inconsistencies within EA'S state machine handling when you get to the advanced concepts introduced with UML 2. I suppose that when Sparx decided to support UML 2 many years ago they just took the old UM 1 based state chart logic and put some new features on top of it, instead of redesigning it.

Josef Stadelmann

  • EA User
  • **
  • Posts: 59
  • Karma: +0/-0
  • as simple as possible, but not too simple
    • View Profile
Re: Adding Entry and Exit to a Composit State Diag
« Reply #2 on: May 20, 2011, 04:11:28 am »
I made big progress using state machines today. AND I learned a lot working through the examples reading SerialPorts and USB Ports. The state transition logic code for IO in the C++ Examples does not look so bad. But I detected another error in the examples.

it is insufficent to have just a part or the interaction messages encapsulated by interaction elements as shown in the C++ examples for ReadUSB() and ReadSerialPort(). When you place all into a Interaction element ALL - what is shown in the sequence diagrams - then it generates very nice code - which looks as it works.

I am currently checking the code by reviewing it; and will soon go and run it through a IDE, like NetBeans and or VS.



So - I am just claiming for the way to do it, to add EXIT HISTORY and ENTRY points, and how to link from one states-substate into another states-substate by placing the same state over a state shown in a diagram just to make it selectabel.

So This works only with a nasty trick as described. And only if you use this nasty trick then the stae table editor can be used to wire states-substate to anoter states-substate by a transition, be it conditinal or nor.

Like jumping from one subroutine in a module just into code belonging to a different modul and there middle into the subroutine.

EA Sparx (better say MySYS) is not there where I would say very well done,but they are on a good way.

Josef :)

CAUTION - AND if you generate code using activities and interactions etc. --- never do a reveser engineering from code or you have to clean up a lot in your model to get it readable again. I have found a lot of the code generated twice after doing so. C++; Things which clobbers the model. So you see two constructors absolut equa, two destructors, two from each methdo, etc. I think this is a BUG.

Will report later if I am more mature.