How to extend OMEvent abstract class defined in the IBM Rational Rhapsody framework
How do you extend OMEvent abstract class defined in the IBM Rational Rhapsody framework and use it in your model?
There are no documentation or samples dedicated for this specific topic available.
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.
- Go to Menu > Tools > Reverse Engineering
- 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.
- Specify the path to OXF code (stored in ..\Rhapsody\<version>\Share\LangCpp\oxf) at Step 2/4.
- Proceed on the wizard and complete reverse engineering, you will see the result as below:
- 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.
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.
More support for:
Software version: 8.1, 8.1.1, 8.1.2, 184.108.40.206
Operating system(s): Linux, Windows
Reference #: 1903700
Modified date: 27 May 2015