For statecharts, Rhapsody can generate a "flat" or a "reusable" code, the default is "flat".
The main difference is that "reusable" generates an object for each state, which should provide better performance when classes that have statecharts are derived and when the derived statecharts will be specialized (changed).
The serious issue that I am seeing with all recent versions (8.1.3, 8.1.5, 8.2) is that the code generated for reusable statecharts does not behave the same way as flat, even for simple changes. In the attached picture, the states that are in grey are the statechart of the base class, while the blue states were added to a derived class. The execution with reusable statecharts never prints any count value and never leaves the state "Active", whereas with the flat statecharts, it correctly counts down from 10 to 0 and then goes to the termination state.
I love Rhapsody but my concern is how after 20 years, that fantastic tool created by the inventor of statecharts David Harel, is not properly generating code for something that is very simple. Unless I have missed something or forgot to set a property...
Any advice would be much appreciated.
- Derived Class Statechart
- Derived Statechart - Reusable vs Flat.jpg (87.64 KiB) Viewed 149 times