IBM Support

General information of Deep and Shallow History Connector in Rhapsody

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

Disclaimer

All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.


Shallow History Sample

HistoryConnectorToAndState753orHigher.zip

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

Product Synonym

Rational Rhapsody

Document Information

Modified date:
27 May 2022

UID

swg21668548