IBM Support

Why events at default transions are ignored in generated code in Rational Rhapsody

Question & Answer


Question

Why are events in Rational Rhapsody modelled in a statechart at a default transition ignored in generated code?

Cause

The default transition is passed without waiting for an event. In the generated code the event does not exist - the default transition generated without any trigger.

In the example picture  the event ev1 is ignored at both transitions, the action /a++ is executed.

animated statechart

Answer

According to statechart and simulation definitions you must always be able to reach the first basic state when entering a statechart or sub-state. That's why a trigger at a default transition must not exist.

But according to UML specification triggers at default transitions are allowed.

To resolve this conflict you can draw triggers for modeling purpose only. They are not generated in code and cannot be executed.

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSB2MU","label":"IBM Engineering Systems Design Rhapsody"},"Component":"","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

ibm10791471