Question & Answer
Question
What are the differences between Deep and Shallow history Connector in IBM Rational Rhapsody?
Cause
Documentation regarding Deep/Shallow History Connector in relation to IBM Rational Rhapsody is limited.
Answer
Shallow History Connector was introduced in Rhapsody v8.0.6.
To use Shallow History Connector, you need to convert it from the history connector from the pop-up menu Change to > Shallow History Connector. The image below shows the change of notation before and after the conversion.
The difference between Deep and Shallow History Connector is explained in the following section:
Deep History: A transition to the deep history state within a composite state invokes the state that was active, immediately before the most recent exit of the composite state. The last active state can be nested at any depth. The image above illustrates the snapshot of active states after series of events took place in the order indicated by numbers. The key point is, the Deep History Connector remembers state_2 as well as its substates (state_9 and state_10) were active till the most recent exit caused by evOpen, and restore them back as "active" when the invocation of evClose caused the execution come back to the composite state of state_0.
Shallow History: A transition to the shallow history state in a composite state invokes the last state that was active, at the same depth as the history state itself, prior to the most recent exit of the composite state. Similarly, the image above illustrates the snapshot of active states after series of events took place in the order indicated by numbers. The only difference from the previous scenario is Shallow History Connector is used this time. Unlike Deep History Connector, Shallow History Connector doesn't go and remember the most recent states inside state_2. Therefore, it will only restore state_2 back as "active", triggering the invocation of initial transitions within state_4 and state_5 as ordinarily expected.
In Rhapsody v8.0.5 or prior, you can still simulate shallow behavior by using an additional variable for storing the value of the last state and a conditional connector instead of history connector.
For details, see the attached "Shallow History" sample.
Related Information
Product Synonym
Rational Rhapsody
Was this topic helpful?
Document Information
Modified date:
27 May 2022
UID
swg21668548