Getting Started with generating code for TPTP EMF models

Author: Alex Nan (apnan@ca.ibm.com)

Author: Paul Slauenwhite (paules@ca.ibm.com)
Last
Updated: May 13, 2009

 

Getting Started with generating code for TPTP EMF models

The following document provides the necessary information for getting started with generating TPTP EMF model code.

Table of Contents:

1.0 Introduction
2.0 Installation
3.0 Generation
4.0 Maintenance
5.0 Documentation

 

The TPTP models are composed of the Trace, Test, Statistical, and Probekit models.  They are based on EMF and generated from ECore model files.

The TPTP models are located in the org.eclipse.tptp.platform.models plug-in under the following source trees:

·       Trace (src-trace).

·       Test (src-test).

·       Statistical (src-statistical).

·       Probekit (src-probekit).

The deprecated Log and Trace Analyzer models are composed of the Consumer Common Base Event1, Generic Log Adapter, Old Symptom model (Symptom 0.1), and New Symptom model (Symptom 2.0) models.  They are based on EMF and generated from ECore model files.

The deprecated Log and Trace Analyzer models are located in the org.eclipse.tptp.platform.models.lta plug-in under the following source trees:

·       Consumer Common Base Event1 (src-cbe).

·       Generic Log Adapter (src-gla).

·       Old Symptom model (Symptom 0.1) (src-sdb).

·       New Symptom model (Symptom 2.0) (src-symptom).

The TPTP models and deprecated Log and Trace Analyzer models requires the org.eclipse.tptp.platform.models.hierarchy plug-in (src-hierarchy source tree), which defines the hierarchical structure used to organize and interact with the various models.

1  The deprecated Producer Common Base Event model is located in the org.eclipse.tptp.platform.logging.events plug-in under the following source trees:

·       EMF (src.cbe101).

·       Java (src.events).

·       Native (src-native).

1.     Download and install the following runtime packages from the TPTP download site:

·       TPTP 4.6 or above.

·       Eclipse 3.5 or above.

·       EMF/XSD 2.5 or above.

2.     Add a JRE 1.5 or above to the system path.

3.     Start Eclipse with the -clean option.

1.     Check out the model plug-ins from CVS (HEAD).

2.     Open the Java Perspective.

3.     Open the Properties View.

4.     Open each of the EMF ECore (*.ecore) files (see <TPTP model source tree>/model) in the EMF ECore editor.

5.     Right-click the root node in the tree and select Validate.

6.     Correct any validation errors.

7.     Open each of the EMF generator model (*.genmodel) files (see <TPTP model source tree>/model) in the EMF Generator editor.

8.     Select the root node in the tree.

9.     Deselect the Show Categories toolbar button in the Properties View.

10. Verify that the following properties:

·       Code Formatting = false

·       Compliance Level = 5.0

·       Copyright Fields = false

·       Dynamic Templates = false

·       Feature Delegation = None

·       Generate Schema = false

·       Model Directory = /<TPTP model plug-in>/<TPTP model source tree>

·       Runtime Version = 2.5

·       Template Directory = <blank>

11. Right-click the root node in the tree, select Generate Model Code.

12. Correct any compilation errors.

13. Complete the following manual changes:

a)    Delete the following packages:

·       /org.eclipse.tptp.platform.models/src-test/org.eclipse.hyades.models.test.data

·       /org.eclipse.tptp.platform.models/src-test/org.eclipse.hyades.models.test.data.impl

·       /org.eclipse.tptp.platform.models/src-test/org.eclipse.hyades.models.test.data.util

b)    Change all references to org.eclipse.emf.ecore.impl.EObjectImpl.eContainerFeatureID to invocations of org.eclipse.emf.ecore.impl.EObjectImpl.eContainerFeatureID() (see defect #262424).

c)     Confirm the following features are NOT  unique:

·       TRCAnnotation_values

·       TRCThread_initialInvocations

·       CBEDefaultElement_values

·       SymptomCatalog_SymptomDefinition

·       SymptomCatalog_SymptomRule

·       SymptomCatalog_SymptomEffect

14. Organize the imports for the TPTP model plug-ins.

15. Synchronize the TPTP model plug-ins with CVS.

16. Correct any overwritten methods (tagged with @generated NOT).

17. Update the copyright date for all updated files.

18. Check out the TPTP plug-ins from CVS (HEAD) using the TPTP 4.6 Project File Set (Developers).

19. Correct any compilation errors.

20. Launch a self-hosted instance of Eclipse and test the core TPTP use cases (for example, probe instrumentation, Java profiling, and test execution).

21. Create a patch of the changes and attach the patch to the Bugzilla for regenerating the TPTP Models.

22. Check the patch into CVS (HEAD).

4.0 Maintenance

The TPTP Models should be regenerated after any model change.  In addition, the TPTP Models should be regenerated once per release during the last week of development

5.0 Documentation

For more information on EMF code generation, see EMF tutorials.

For more information on the TPTP models, see TPTP models.