IBM Support

How to extend OMEvent abstract class defined in the IBM Rational Rhapsody framework

Technote (FAQ)


Question

How do you extend OMEvent abstract class defined in the IBM Rational Rhapsody framework and use it in your model?

Cause

There are no documentation or samples dedicated for this specific topic available.

Answer

The technique described below is just one way to extend OMEvent. You will find other techniques more straightforward. Yet, what makes this approach unique is the use of Reverse Engineering feature to import a potion of OXF library directly into your model, allowing you to associate the imported code to other parts of your model. This approach will help you construct a model with greater visibility over relationships it has with external files such as OXF or other legacy code. Once you acquire the technique, you can apply it in different situations to meet your specific business needs.

IMPORTANT: The layout of Reverse Engineering interface has changed since Rhapsody v8.1. If you use older releases, care must be taken to apply steps described below.

Steps:

  1. Go to Menu > Tools > Reverse Engineering
  2. Choose "logical model" from the pull-down menu at Step 1/4.



    NOTE:
    This is the option to choose if you don't want to make changes directly to the imported OXF code.
  3. Specify the path to OXF code (stored in ..\Rhapsody\<version>\Share\LangCpp\oxf) at Step 2/4.

  4. Proceed on the wizard and complete reverse engineering, you will see the result as below:

  5. Create your own class and draw a generalization and <<Usage>> dependency toward OMEvent.



That's it. The attached is a completed model produced as result of performing steps described above plus couple of properties are overridden to solve compilation errors. In this model, you will see MyOMEvent class derived from OMEvent and it has an attribute of char pointer. The constructor and destructor of MyOMEvent is called endlessly by repeating memory allocation and de-allocation against the instance pointed by the pointer. This model was built in Rhapsody v8.0.6 format.


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.


Technote1903700.zipTechnote1903700.zip

Document information

More support for: Rational Rhapsody
General Information

Software version: 8.1, 8.1.1, 8.1.2, 8.1.2.1

Operating system(s): Linux, Windows

Reference #: 1903700

Modified date: 27 May 2015