Modeling challenges with State chart using IBM Rational Rhapsody
Rajesh0122 2700029M1T Comment (1) Visits (8609)
IBM Rational Rhapsody family provides a collaborative design, development and test environment for systems engineers and software engineers. It uses Systems Modeling Language (SysML) and Unified Modeling Language (UML) to enable rapid requirements analysis and visual, model-based design.
The UML diagrams are views into the underlying semantic system model; each kind of diagram emphasizes some aspect of the model.
Example - Dynamic aspects is represented by behavior diagram - State chart.
Statecharts define the behavior of objects by specifying how they react to events or operations. The reaction can be to perform a transition between states and possibly to execute some actions. When running in animation mode, IBM Rational Rhapsody highlights the transitions between states.
The discussion covers few modeling challenges with state chart using Rational Rhapsody and how to over come those challenges:
1) Evaluation of condition connector in state chart
A scenario where a variable (count) is decremented before the condition connector and is expected to terminate if value of variable is 9 (count==9).
However, on executing you observe that the condition doesn’t take the change in the variable on the transition. Instead it takes the initial value of the variable for comparison.
The work around here is to have an additional dummy state in between to get the desired output.
2) Multicasting with rapid ports in layered structure
Currently, the multicasts of event via rapid ports (ports that have no provided/required interfaces) are supported only from a direct invocation.
Example - One sender object and two receiver objects
Consider a scenario where the event is first sent from the Class A's object(itsA) and then it reaches the Class B's object(itsB), from where it is delegated to its 2 inner parts(itsB1 and itsB2
No multicasting is available on having multi layered structure.
The Workaround is to add an additional state chart and MULITCAST_GEN() macro in class B.
3) Working of Reaction in State
In a single state for a Reactive class, you would expect to continuously print a statement after elapse time of tm (1000). However, upon execution it prints only once instead of continuous timer.
Using a tm (1000) as a trigger for a reaction in state means that 1 second after you enter the state you'll be triggered. It's not a continuous timer.
To restart the timer you have to exit the state and re-enter it. It needs a design change as below.
4) Combining Junction Connector and Condition Connector in a state chart
You would like to have several events from a state and a condition to determine the other state.
You cannot join several transitions into a condition connector neither you can have a transition from a junction connector to a condition connector.
However, you can model to add a dummy state in between that will further evaluate for condition connector.