0% found this document useful (0 votes)
98 views69 pages

E-Terrasource Metamodel Quickstartguide

Uploaded by

ALDCNUNNA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views69 pages

E-Terrasource Metamodel Quickstartguide

Uploaded by

ALDCNUNNA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

e-terrasource Metamodel Quick Start

Guide

This document provides a guide to customizing the delivered


e-terrasource metadata, e-terrahabitat and e-terraplatform database
schemas, and transformation QVTO files, and to updating the Eclipse
environment with the new schemas.

Software Version: e-terrasource 2.0

Document Date: May 8, 2012


Copyright and Proprietary Information

Copyright © 2010, 2012 ALSTOM Grid Inc. or Affiliate. All Rights Reserved.

NOTE: CONTAINS PROPRIETARY INFORMATION OWNED BY ALSTOM GRID INC.


AND/OR ITS AFFILIATES. DO NOT COPY, STORE IN A RETRIEVAL SYSTEM,
TRANSMIT OR DISCLOSE TO ANY THIRD PARTY WITHOUT PRIOR WRITTEN
PERMISSION FROM ALSTOM GRID INC.
__________________________________________________________________

Trademarks

“ESCA” and “HABITAT” are registered trademarks of ALSTOM Grid Inc. “eterra” is a
registered trademark and/or service mark of E-Terra, LLC, licensed for use by
ALSTOM Grid Inc. in connection with its e-terra family of products and services.

Other product and company names in these materials may be trademarks or registered
trademarks of other companies, and are the property of their respective owners. They are
used only for explanation and to the respective owners’ benefit, without intent to infringe.
Contents

About This Document.............................................................................. iv


Purpose of This Document............................................................................................iv
Who Should Use This Document ..................................................................................iv
Structure of This Document ..........................................................................................iv
For More Information.....................................................................................................iv
Change Summary .........................................................................................................iv

1. Overview................................................................................................ 1

2. Customizing Metadata Without Preserving Data................................ 3


2.1 Updating the Metamodel and Re-Installing the Database ....................................... 3
2.2 Updating the Transformation Environment............................................................ 10

3. Customizing Metadata While Preserving Data.................................. 19


3.1 Updating the Metamodel and Database Installation.............................................. 19
3.2 Updating the Transformation Environment............................................................ 34

4. Modifying Delivered e-terrahabitat Database Definitions ................ 46

5. Installing Custom e-terrahabitat Database Definitions .................... 57

Proprietary – See Copyright Page iii


About This Document
This document is supplied as a part of Alstom Grid’s e-terrasource
product.

Purpose of This Document


This document provides a quick guide to modifying e-terrasource
metadata.

Who Should Use This Document


This document is intended for administrators of e-terrasource. Users are
expected to have a good understanding of the business model they want
to represent in e-terrasource.

Structure of This Document


• Chapter 1 provides an overview of what is involved in customizing the
transformation environment and the related database and metamodel
schemas.
• Chapters 2 through 5 provide checklists for administrators to follow for
performing different transformation use cases.

For More Information


For more information about e-terrasource, refer to the following:
• e-terrasource Metamodel Guide – Provides detailed information about
modeling metadata.
• e-terrasource Release Notes – Installation information about and
requirements for the current e-terrasource release.
• e-terrasource Software Installation and Maintenance Guide –
Information about installation and maintenance of e-terrasource.
• e-terrasource User’s Guide – Provides information about the use of
the e-terrasource software.

Change Summary
The following changes were made to this document for this release:
• Included detailed instructions for installing and using custom
e-terrahabitat and e-terraplatform database definitions in the
transformation environment.
• Minor editorial and formatting corrections.

Proprietary – See Copyright Page iv


1. Overview
This document provides detailed checklists to follow when customizing
your delivered transformation environment to modify metamodels,
database definitions, and Query View Transform Operational (QVTO) files
to transform custom data.
There are four different types of schema updates, in addition to the QVTO
modifications that may be involved with every transformation modification.
There are two methods to choose from when customizing the
e-terrasource metamodel, and two methods to choose from when
customizing schemas for e-terrahabitat DBDEF database definition files.
The choices for customizing the e-terrasource metamodel are:
• Add customizations to the metamodel, and re-install the database
when there is no data that needs to be preserved in the current
database. This is usually the case in the initial or beginning phases of
a project.
• Add customizations to the metamodel, and preserve existing data
models in the database. This involves creating a new schema version
in the metamodel, upgrading the database environment, creating new
workspaces to work with the new schema version, and changing
mapping files in the transformation workspace to allow transformation
of the new schema. This is usually the case when new e-terrasource
product deliveries are provided to an existing customer already using
e-terrasource to model their system.
The choices for customizing the schema in the transformation
environment as it relates to e-terrahabitat DBDEF files are:
• Replace the schema for a DBDEF that contains project customizations
and is already represented in the transformation environment.
• Create a schema in the transformation environment for a new custom
DBDEF file for which the schema is not installed.
For customizations to the e-terrasource metamodel, you must select one
method or the other. However, the customizations to schema definitions in
the transformation environment may involve a combination of both
options.
Usually, when the transformation environment is updated with new
schema definitions, modifications to the QVTO source files used to
transform the data are required (for additional information about modifying
and updating the QVTO files, see the e-terrasource Programmer’s Guide).

Proprietary – See Copyright Page 1 Overview


e-terrasource Metamodel Quick Start Guide
Customization may also require the creation of new QVTO files for
transforming new schema definitions.
There are commented-out examples in the delivered custom NETMOM
and SCADAMOM transformation QVTO files, which may be helpful as you
start to write QVTO transformation code for your custom changes.

Proprietary – See Copyright Page 2 Overview


e-terrasource Metamodel Quick Start Guide
2. Customizing Metadata Without Preserving Data
To update the metamodel and re-install the database without preserving
any data models, follow these procedures.

2.1 Updating the Metamodel and Re-Installing the Database


If you want to update the installation metadata for e-terrasource and
re-install the database tier (you do not have model data to preserve),
follow the steps below to produce a new metadata installation script.
1. Open the metamodel workspace.
You must have the UseMetaModelWorkspace privilege to open a
metamodel workspace.
2. The metamodel workspace must have the latest Model Authority Set
loaded, which is synchronized with the run-time metadata tables.
If it is not loaded, from the Load toolbar button, click Model Authority
Set to load the latest metamodel. If a Model Authority Set other than
the latest is already loaded, click the Reset Workspace toolbar button
before trying to load the latest Model Authority Set.

Proprietary – See Copyright Page 3 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
3. Create a new project to store your changes.

4. Make sure that the SchemaID and the Model Authority Set Type are
both set to “MetaModel”.

5. Make your changes to schema version 1.


Do not create new schema versions or entity versions. Modify the
existing entity versions to add, remove, or modify properties and
relationships.

Proprietary – See Copyright Page 4 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
6. If you need to add a calculated/computed property, refer to the
e-terrasource Metamodel Guide for assistance in creating new
metaComputation records.
If needed, metaEnumTypes can be added, removed, and modified as
well.

Proprietary – See Copyright Page 5 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
7. Save the changes to your project.
8. From the Validate toolbar button, select Validate Workspace to validate
the metamodel changes.

9. Check for errors in the validation message log and correct them.
10. Export the project that contains your metadata customizations and
store it in a safe location.
11. From the Export toolbar, select “Export Workspace…” to export the
metamodel to an XML file on disk.
By default, the file is exported to the
<drive>\ETERRA\e-terrasource\export directory. The exported
MetaModel_MAS.xml file should be captured in Configuration Control.

Proprietary – See Copyright Page 6 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
12. From the Export toolbar button, select “Export Workspace…” to create
a metadata installation SQL script.

13. Locate the installation script.

14. If you are using an Oracle database, replace the delivered


csm_metadata_install.sql script at
<drive>:\ETERRA\e-terrasource\DatabaseScripts\Oracle\MetaData
with the newly exported script.

Proprietary – See Copyright Page 7 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
If you are using SQL Server, replace the delivered
csm_metadata_install.sql script at
<drive>:\ETERRA\e-terrasource\DatabaseScripts\MSSQL\MetaData
with the newly exported script.
15. If you are using an Oracle database, use SQL*Plus to execute the
uninstall_csm.sql script to uninstall your current database installation.
If you are using a SQL Server database, use PowerShell on the
database machine and execute the uninstall_csm.ps1 script.
Note: You need to stop the e-terrasource services before you can
successfully uninstall the database.
16. If you are using an Oracle database, use SQL*Plus to execute the
install_csm.sql script to perform an installation using your new
installation script.
If you are using a SQL Server database, use PowerShell on the
database machine and execute the install_csm.ps1 script.
After re-installing the database, re-start the e-terrasource services.
The updated csm_metadata_install.sql scripts should be saved under
Configuration Control.
17. Use the e-terrasource UI to create a workspace using schema
version 1. Open up the workspace and re-load your model.

Proprietary – See Copyright Page 8 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
The workspace should reflect your customizations.

Proprietary – See Copyright Page 9 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
2.2 Updating the Transformation Environment
To update the ETS Ecore model in the transformation subsystem to a
re-installed database updated from an installation script:
1. Locate the MetaModel file exported to disk in section 2.1 Updating the
Metamodel and Re-Installing the Database.
The default file is created at:
<disk>:\ETERRA\e-terrasource\export\MetaModel_MAS.xml
2. In Eclipse, select File > New > Project.
3. In the New Project window, under the Eclipse Modeling Framework
folder, select “EMF Project” and click Next.

4. Enter a name for the EMF project that is used to import the new ETS
Ecore model. Click Next.

Proprietary – See Copyright Page 10 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
5. Select “e-terrasource metamodel” and click Next.

6. Click “Browse File System” to locate the Metamodel_MAS.xml file from


step 1.
The remaining fields are automatically filled.

Proprietary – See Copyright Page 11 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
7. A list of “packages” to generate is shown. If it is not already selected,
select the desired package and click Finish.

At this point, files related to the new ETS Ecore model are generated.
When the process is completed, the Package Explorer on the left
displays a folder for the new project, and the main window displays a
window titled “Metamodel_MAS.genmodel”.

8. On the Windows menu, select Preferences.

Proprietary – See Copyright Page 12 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
9. In the Preferences window, choose “Plug-in Development”, then
“Target Platform”.

10. If the list of “Target definitions” is empty, click the Add button and add
“Default: Default Target for the running platform”.

11. Click Next, and then click Finish in the dialog box.
12. In the Preferences dialog box, click OK.
13. Select the box marked “Running Platform (Active)”.
14. In the Preferences dialog box, click OK.

Proprietary – See Copyright Page 13 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
15. In the main window, right-click the model node and select “Generate
Model Code”.

This generates Java code into the “src” directory, as well as other
plug-in files.
16. Wait for the build that has started to complete.
17. Examine the project in the Package Explorer for any build errors,
indicated by red markers. Warnings are OK.
At this point, the plug-in for the new ETS Ecore model has been
generated. The next step is to deploy the plug-in.
18. On the Package Explorer, double-click the “plugin.xml” file under the
project.
19. In the main window, append “.qualifier” to the Version field, then click
the Save button in the toolbar.

Proprietary – See Copyright Page 14 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
This instructs Eclipse to append the current date as a qualifier to the
plug-in’s version information.
20. Right-click the project in the Package Explorer, then select “Export”.

Proprietary – See Copyright Page 15 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
21. Under “Plug-in Development”, select “Deployable plug-ins and
fragments”, then click Next.

22. Make sure that the only item selected in “Available Plug-ins and
Fragments” is the newly generated plug-in with the name you
specified.

Proprietary – See Copyright Page 16 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
23. Select the “Install into host” radio button. The default Repository name
can be left as is. Click Finish.
24. The plug-in deployment takes place. If a security warning is displayed
regarding unsigned content, click OK.
25. When prompted to restart Eclipse, click the Restart Now button.
26. After Eclipse restarts, on the Help menu, click About.
27. In the dialog box, click the Installation Details button, and then select
the Plug-ins tab.
You should be able to see the new ETS Ecore model as a plug-in. The
plug-in ID matches the project name you specified in step 4.

28. You must now uninstall the previous ETS Ecore model. Select the
Installed Software tab.
You should see your new ETS Ecore model (the ID column matches
the project name from step 4). You should also see the previous ETS
Ecore model, the default being titled “AMF CIM/EMS v1 e-terrasource
Schema”.

Proprietary – See Copyright Page 17 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
29. Select the previous ETS Ecore model, then click the Uninstall button.

30. When the Uninstall Details dialog box appears, click Finish.
31. When the uninstall completes, click the Restart Now button to restart
Eclipse.
32. In order for the e-terrasource CIM/XML import/export service to be
aware of the new metamodel, you must copy the Metamodel_MAS.rdfs
file that is generated by Eclipse to the e-terrasource server directory.
33. After copying the file, restart the e-terrasource CIM/XML import/export
service.
The RDFS file is located in the project you created. For the above
example, the file is located at:
<disk>:\ETERRA\e-terrasource\Transformation\
Workspace_Template_26\MyNewETSEcoreModel\model\
MetaModel_MAS.rdfs
34. You can now reference the new ETS Ecore model in the QVTO code.
Remember to update the URI in the “modeltype” statements, if
necessary.
For your convenience, a “cheat sheet” describing these steps is available
within Eclipse by clicking Help > Cheat Sheets, then expanding the Alstom
Transformation Framework folder and double-clicking “Importing ETS or
HDB schemas – converting to Ecore”.

Proprietary – See Copyright Page 18 Customizing Metadata Without Preserving Data


e-terrasource Metamodel Quick Start Guide
3. Customizing Metadata While Preserving Data
If you have already installed e-terrasource and you want to modify the
business model schema, in most cases, a new schema version must be
created.
To produce a metadata upgrade script that creates a new schema version,
follow the steps below. You can then update your workspaces to use the
new schema version and load your existing models into them.
Physical changes cannot be made to a schema version that has already
been generated. For example, most changes to enumerations, properties,
relationships, and inheritance for entities require that a new entity version
and a new schema version be created.
If you are simply changing validation metadata, you can export a metadata
validation script to update the validation metadata.
It is important to note that a single upgrade script is created that
represents the changes in all of the projects in the workspace. For
example, if your workspace contains projects A, B, and C, where project A
creates a record, project B modifies it, and project C deletes it, the
upgrade script will be empty because the net effect of the three projects is
that there are no changes.

3.1 Updating the Metamodel and Database Installation


To produce a metadata upgrade script that creates a new schema version:
1. Open the metamodel workspace.
You must have the UseMetaModelWorkspace privilege to open a
metamodel workspace.
2. Ensure that the metamodel workspace has the latest Model Authority
Set loaded, which is synchronized with the run-time metadata tables.
If it is not loaded, from the Load toolbar button, click Model Authority
Set to load the latest metamodel Model Authority Set. If a Model
Authority Set other than the latest is already loaded, click the Reset
Workspace toolbar button before trying to load the latest Model
Authority Set.

Proprietary – See Copyright Page 19 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
3. Create a new project to store your changes.

Proprietary – See Copyright Page 20 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
4. Make sure that the SchemaID and the Model Authority Set Type are
both set to “MetaModel”.

5. To create a new schema version, go to the metamodel tree view and


expand the metaSchema folder.
6. To make a copy of the latest schema version, right-click the
metaSchemaVersion CIM/EMS v# and select Deep Copy > Schema
Version Hierarchy.

Proprietary – See Copyright Page 21 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
7. To create the new schema version, on the parent metaSchema record,
click Paste.

8. Select the new metaSchema version (shown as a bullet item with no


name).
9. On the property sheet for the new schema version, expand the
General tab and enter a new schema version and description.
The new schema version should be set to the next integer value that is
one more than the current schema version. The full name and MAS
type are automatically filled in when the changes are saved.

10. Save your changes.


11. A metaEntity represents an object type in the business model (e.g., a
substation). To create new entity versions, click the entity you want to
modify, and click Deep Copy to make a copy of the latest version.

Proprietary – See Copyright Page 22 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
12. To create the new entity version, on the parent entity record, click
Paste.

Proprietary – See Copyright Page 23 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
13. On the property sheet for the new entity version, enter a new entity
version and description.
The new entity version should be set to the next integer value that is
one more than the current entity version.
14. Save your changes.

15. The identity of each new entity version cannot be modified, so first
delete the ACLineSegment v1 metaSchemaVerEntityVer under
“CIM/EMS v2”. Then insert a new metaSchemaVerEntityVer record
and select the ACLineSegment v2 EntityVersion.

16. After selecting the correct EntityVersion, save your changes.

Proprietary – See Copyright Page 24 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
17. Edit the newly created entity version(s) to add, remove, or modify
properties and relationships.

18. If you need to add a calculated/computed property, refer to the


e-terrasource Metamodel Guide for assistance in creating new
metaComputation records.
If needed, metaEnumTypes can be added or modified as well, but
each entity that uses the metaEnumType must have a new entity
version created.

Proprietary – See Copyright Page 25 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
19. Add the new schema version to the metaCIMProfiles table using the
Deep Copy function (right-click ETS to copy, right-click MetaModel at
the top of the tree to paste).
20. Select the new copy, and edit the ID.
The Profile type must be set to “ETS”. The version must be specified
as “CIM/EMS vx”, where x is the version number. The metamodel file
name must be set to match the name that will be used later on in the
document to export the modified metamodel Model Authority Set to a
file.
The following image is an example of the entered values for version 2
of the schema:

Proprietary – See Copyright Page 26 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
21. Add the new CIM profile to the “CimProfiles” metaEnumType, as
shown in the following image (right-click CimProfiles, and select
Insert > metaEnumMember).

22. Save the changes to your project.


23. To validate the metamodel changes, from the Validate toolbar button,
select Validate Workspace.

24. Check for errors in the validation message log and correct them.

Proprietary – See Copyright Page 27 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
25. From the Export toolbar button, click Export Workspace to create a
Metadata Upgrade Script (in SQL).

26. Export the upgrade script.

Proprietary – See Copyright Page 28 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
27. Locate the upgrade script.

28. For Oracle, use the SQL*Plus utility to execute the upgrade script in
the master schema.
A new schema version is created.

For SQL Server, copy the upgrade script directly to the database
machine into the ...\MSSQL\InstallScripts directory, and log in to an
account with administrative privileges. Open a PowerShell command
window, set your current directory to the above location, and run the
following sqlcmd to do the upgrade:
sqlcmd -U <MasterLogin> -P <MasterLoginPassword> -d <database>
-i <upgrade_script_file> -b -S <Server>

Proprietary – See Copyright Page 29 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
Note that the –U and –P parameters must be the first parameters
used, and that all parameters are case-sensitive. If the default
installation settings were used, the master login and password are
“csmlogin” and the database is “csm”. If the upgrade is not successful,
an error message is displayed.
29. Create a new metamodel Model Authority Set version that includes
your changes.
It is very important that the metamodel Model Authority Set remains
synchronized with the actual run-time metadata, so that you have an
accurate starting point for any future metadata changes.

Proprietary – See Copyright Page 30 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
30. Export your metamodel Model Authority Set to a file on disk.
The name chosen for the exported file should match that chosen back
in step 20 as the Metamodel file name (documented as
“CIM_EMS__v2_MAS”); however, the extension is different.
The extension entered for the exported metamodel file should remain
as “.xml”. This file is used for updating the transformation environment.
It should also be saved under Configuration Control.

31. Export the project that contains your metadata customizations and
store it under Configuration Control.

Proprietary – See Copyright Page 31 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
32. Update your workspaces to use the new schema version, and load
your existing models into them.
From the Administration Explorer, create a new workspace. Select the
new version as the Model Schema Version.

The new workspaces should reflect your schema changes.

Proprietary – See Copyright Page 32 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
The new workspace created from schema version 2 should be used for
modeling from this point forward, since it includes the new fields that
may be referenced from modified QVTO files. Previous workspaces
created against schema version 1 may be retained for retrieving and
viewing data and/or history from older Model Authority Sets. For clarity,
workspaces of older schemas should be removed either periodically or
after confidence is gained while working in the new workspace and
with the new schema version.

Proprietary – See Copyright Page 33 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
3.2 Updating the Transformation Environment
The delivered transformation environment contains a run-time
transformation engine that only includes tables and attributes that are
defined in the profiled schemas. This means that only tables and attributes
that are currently referenced by delivered QVTO transformation code are
included, and do not include any new attributes or tables.
In addition, the delivered run-time transformation engine does not allow
the Eclipse user interface to run (for additional information about Eclipse
and its use in transformation, see the e-terrasource Programmer’s Guide).
Once the decision is made to update the delivered metamodel, the run-
time engine must be replaced with the delivered Integrated Development
Environment (IDE) Eclipse engine.
You can find details for installing the transformation IDE for supporting
customizations in the section “Transformation IDE Kit” in the e-terrasource
Programmer’s Guide. This only needs to be done once after installation.
Before you install the Eclipse IDE engine, make sure that the existing
<drive>:\Eterra\e-terrasource\Transformation\Engine\Eclipse
directory is renamed to “Eclipse_runtime”.
After the IDE is installed, adjust the memory size if necessary. Refer to the
section titled “Adjust Memory Sizing for Transformation” in the
e-terrasource Software Installation and Maintenance Guide.
For details on customizing an Eclipse IDE without modifying the run-time
transformation environment, see the section “Using a Development
environment for updating the Eclipse IDE with customs” in the
e-terrasource Programmer’s Guide.
1. Run the eclipse.exe file in the newly installed Eclipse IDE.
2. In Eclipse, select File > New > Project.

Proprietary – See Copyright Page 34 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
3. In the New Project window, under the Eclipse Modeling Framework
folder, select “EMF Project”. Click Next.

4. Enter a name for the EMF project that is used to import the new ETS
Ecore model.
The name should reflect the Ecore version being created. For
example, if the new schema version to be supported after the update is
the CIM/EMS schema version 2, the project should be named
“CIM_EMS__v2”. Click Next.

Proprietary – See Copyright Page 35 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
5. Select “e-terrasource metamodel” and click Next.

WARNING: Before you select “Browse File System” to select a file to


import, make sure that the correct version is entered under “Schema
version to create ecore from” (for the example case, the schema
version is updated to the value “2”). It is important that this value be
entered correctly before you select the file to import.

Proprietary – See Copyright Page 36 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
6. Click “Browse File System” to locate the file created in step 4 (the
default is “CIM_EMS__v2_MAS.xml”).
The remaining fields are automatically filled.

7. A list of packages to generate is shown. If it is not already selected,


select the desired package and click Finish.

At this point, files related to the new ETS Ecore model are generated.
When the process is completed, the Package Explorer on the left
displays a folder for the new project, and the main window displays a
window titled “Metamodel_MAS.genmodel”.

Proprietary – See Copyright Page 37 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
8. On the Windows menu, click Preferences.
9. Update the deployment target in the Eclipse environment.
Note: This only needs to be performed once after installation of the
IDE.
10. In the Preferences window, choose “Plug-in Development”, then
“Target Platform”.

Proprietary – See Copyright Page 38 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
11. If the list of “Target definitions” is empty, click the Add button and add a
“Default: Default Target for the running platform”.

12. Click Next, and then click Finish in the dialog box.
13. Select the box marked “Running Platform (Active)”, and then click OK
in the Preferences dialog box.
14. In the main window, right-click the model node, and select “Generate
Model Code”.

This generates Java code into the “src” directory, as well as other
plug-in files.
15. Wait for the build that has started to complete.
16. Examine the project in the Package Explorer for any build errors,
indicated by red markers. Warnings are OK.
At this point, the plug-in for the new ETS Ecore model has been
generated. The next step is to deploy the plug-in.

Proprietary – See Copyright Page 39 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
17. On the Package Explorer, double-click the “plugin.xml” file under the
project.
18. In the main window, append “.qualifier” to the Version field, then click
the Save button in the toolbar.

This instructs Eclipse to append the current date as a qualifier to the


plug-in’s version information.

Proprietary – See Copyright Page 40 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
19. Right-click the project in the Package Explorer, then select “Export”.

20. Under “Plug-in Development”, select “Deployable plug-ins and


fragments” and click Next.

Proprietary – See Copyright Page 41 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
21. Make sure that the only item selected in “Available Plug-ins and
Fragments” is the newly generated plug-in with the name you
specified.

22. Select the “Install into host” radio button. The default Repository name
can be left as is. Click Finish.
23. The plug-in deployment takes place. If a security warning is displayed
regarding unsigned content, click OK.
24. When prompted to restart Eclipse, click the Restart Now button.
25. After Eclipse restarts, on the Help menu, click About.
26. In the dialog box, click the Installation Details button, and then select
the Plug-ins tab.
You should be able to see the new ETS Ecore model as a plug-in. The
plug-in ID matches the project name you specified in step 4.

Proprietary – See Copyright Page 42 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
Note: For a database upgrade, do not uninstall the default ETS Ecore
model.
27. From outside of the Eclipse environment, the workspace settings must
re-map version 1 of the e-terrasource metamodel to version 2, so that
the QVTO files compile correctly and run against schema version 2.
Open the settings file under the correct resource file within the
workspace.
For example, to modify the URI settings for the
“Workspace_Template_26” workspace, open the file located at:
\eterra\e-terrasource\Transformation\Workspace_Template_26
\amf.ets.qvto.26 \.settings\org.eclipse.m2m.qvt.oml.mmodel.urimap
and change the last mapping entry from:
<mapping sourceURI="http://areva.com/ets/2.0/CIM_EMS__v1/1#"
targetURI="http://areva.com/ets/2.0/CIM_EMS__v1/1#"/>
to:
<mapping sourceURI="http://areva.com/ets/2.0/CIM_EMS__v1/1#"
targetURI="http://areva.com/ets/2.0/CIM_EMS__v2/2#"/>
28. In order for the e-terrasource CIM/XML import/export service to be
aware of the new metamodel, you must copy the
CIM_EMS__v2_MAS.rdfs file that is generated by Eclipse to the
e-terrasource server directory.

Proprietary – See Copyright Page 43 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
After you install the new Ecore, the new metamodel file should exist in
the following location:
\eterra\e-terrasource\Transformation\Workspace_Template_26
\CIM_EMS__v2\model\CIM_EMS__v2_MAS.rdfs
29. Restart the e-terrasource CIM/XML import/export service.
30. If you are using the run-time workspace, after testing the import and
export successfully with your new schema version, copy the created
CIM_EMS__v2 project to another location, and then delete it from the
Eclipse workspace by right-clicking on the project name and selecting
Delete.
Note: Make sure that the option to “Delete project contents on disk
(cannot be undone)” is selected in the deletion pop-up before you
click OK.
This step and the following steps are to clean up the workspace, since
you are working in the workspace template environment that is copied
from for all transformation requests. This clean-up does not need to be
done if you have followed the procedures for developing the Eclipse
engine in a copy of the run-time workspace directory.

Proprietary – See Copyright Page 44 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
31. Run Eclipse, and make sure that the Workspace_Template_26
workspace is selected.
32. From the menu bar, select Project > Clean, and click the OK button in
the pop-up dialog box to refresh the workspace.
No errors should be identified in any of the QVTO code.

Proprietary – See Copyright Page 45 Customizing Metadata While Preserving Data


e-terrasource Metamodel Quick Start Guide
4. Modifying Delivered e-terrahabitat Database
Definitions
If you want to update the current Eclipse IDE with a new version of one of
the delivered DBDEF files, follow the steps below to update the Eclipse
engine with the new version of the schema.
If you are installing a new database, follow the steps in chapter 5 Installing
Custom e-terrahabitat Database Definitions.
The transformation subsystem contains Ecore models for the following
e-terraplatform database definitions:
• NETMOM
• SCADAMOM
• GENMOM
• DTSMOM
• CTGS
• RASMOM
• DYDEF
• RGALM
• ALARM
• OAGMOM
• HYMOM
• RESMOM
For information about specific e-terraplatform versions that are supported,
refer to the e-terrasource Release Notes.
By examining the top of the QVTO files, you can see that the
e-terraplatform Ecore model is declared using a URI that includes the
e-terraplatform version. For example, the model type NETMOM “strictly”
uses “http://areva.com/emp/2.6/NETMOM”.
To update the Ecore model corresponding to one of these database
definitions:
1. Locate the desired database definition file (*.dbdef).
2. Within Eclipse, select Project > Clean from the menu bar, and then
click OK to rebuild the workspace.
To set the default Deployment Target to the current Eclipse
environment, if that has not already been done, follow the procedures
in the previous chapters and in the e-terrasource Metamodel Guide.
3. On the Windows menu, click Preferences.

Proprietary – See Copyright Page 46 Modifying Delivered e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
4. In the Preferences window, choose “Plug-in Development”, then
“Target Platform”.

5. If the list of “Target definitions” is empty, click the Add button and add
“Default: Default Target for the running platform”.

6. Click Next, then click Finish in the dialog box.


7. In the Preferences dialog box, click OK.
8. From the menu bar, select Help > About Eclipse SDK, and then select
Installation Details.
9. Select the Plug-ins tab, sort by Plug-in Identity, and record the
plug-in ID and version of the database that you want to replace.
Note: Make sure you select the correct version (25 versus 26, etc.).

Proprietary – See Copyright Page 47 Modifying Delivered e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
10. In Eclipse, select File > New > Project.
11. In the New Project window, under the Eclipse Modeling Framework
folder, select “EMF Project” and click Next.

Proprietary – See Copyright Page 48 Modifying Delivered e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
12. Enter a name for the EMF project that is to be used to import the new
ETS Ecore model. Click Next.

13. Select “e-terrahabitat HDB schema (DBDEF)” and click Next.

14. Click “Browse File System” to locate the DBDEF file from step 1.
15. Adjust the e-terraplatform version number in the Base URI field if
necessary.
Note: It is very important that the Base URI reflect the correct version
of the schema. If the Base URI needs to be updated, you must re-click
the Load button to re-load the model before clicking Next.

Proprietary – See Copyright Page 49 Modifying Delivered e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
16. A list of “packages” to generate is shown. If it is not already selected,
select the desired package and click Finish.

At this point, files related to the new Hdb Ecore model are generated.
When the process is completed, the Package Explorer on the left
displays a folder for the new project, and the main window displays a
window titled “<database>.genmodel”.
Note: The extension “.genmodel” is an Eclipse term that has nothing to
do with the e-terraplatform Generation Model (GENMODEL)
application.

Proprietary – See Copyright Page 50 Modifying Delivered e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
If your e-terraplatform version is not the default of version 2.6,
additional modifications need to be made to correct the File Extensions
property in the new Eclipse project. For example, if you are using
e-terraplatform 2.5 and replacing the Netmom schema, you need to
change the File Extensions property.
17. Right-click on the “NETMOM” name in the genmodel and select “Show
Properties View”.
18. Scroll down to the File Extensions property and change it from
“netmom” to “netmom25”, as shown below.

Proprietary – See Copyright Page 51 Modifying Delivered e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
19. To save the changes, select File > Save.
WARNING: Do NOT make this modification if your version is
e-terraplatform 2.6.
20. In the main window, right-click the model node and select “Generate
Model Code”.
This generates Java code into the “src” directory as well as other
plug-in files.

Proprietary – See Copyright Page 52 Modifying Delivered e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
21. Wait for the build that has started to complete.
22. Examine the project in the Package Explorer for any build errors,
indicated by red markers. Warnings are OK.
At this point, the plug-in for the new Hdb Ecore model has been
generated.
23. In your new project, double-click the “plugin.xml” file to allow
modification of the plug-in properties.
24. Modify the ID field to the previously recorded value of the plug-in from
step 9.
25. Append “.qualifier” text to the existing version number.
Note: It is very import that the entered name matches the name of the
existing plug-in that you are replacing, and that “.qualifier” is added
correctly without misspelling.

Proprietary – See Copyright Page 53 Modifying Delivered e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
26. To save your changes, from the menu bar, select File > Save.
27. Right-click the project in the Package Explorer, then select “Export”.

Proprietary – See Copyright Page 54 Modifying Delivered e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
28. Under “Plug-in Development”, select “Deployable plug-ins and
fragments” and click Next.

29. On the next screen, make sure that the only item selected in the
“Available Plug-ins and Fragments” is the newly generated plug-in with
the name you specified.

Proprietary – See Copyright Page 55 Modifying Delivered e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
30. Select the “Install into host” radio button. The default Repository name
can be left as is. Click Finish.
31. The plug-in deployment takes place. If a security warning is displayed
regarding unsigned content, click OK.
32. When prompted to restart Eclipse, click the Restart Now button.
33. After Eclipse restarts, on the Help menu, click About.
34. In the dialog box, click the Installation Details button, then select the
Plug-ins tab.
You should be able to see the named plug-in with a new version
number reflecting the current date and time.
35. You can now reference the new Hdb Ecore model in the QVTO code.
Remember to update the URI in the “modeltype” statements, if
necessary.
36. Rename the delivered Eclipse directory in
<disk>:\ETERRA\e-terrasource\ Transformation\Engine
to “Eclipse_Runtime”.
37. Copy your new IDE Eclipse directory under the “Engine” directory, so
that the import and export requests from the UI use the new
environment.
For your convenience, a “cheat sheet” describing these steps is available
within Eclipse by clicking Help > Cheat Sheets, then expanding the Alstom
Transformation Framework folder and double-clicking “Importing ETS or
HDB schemas – converting to Ecore”.

Proprietary – See Copyright Page 56 Modifying Delivered e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
5. Installing Custom e-terrahabitat Database
Definitions
Follow the steps below to install the schema for a new custom DBDEF
database definition into Eclipse (one for which a version of the schema is
not already installed in the Eclipse transformation engine).
1. Locate the desired database definition file (*.dbdef).
2. In Eclipse, select File > New > Project.
3. In the New Project window, under the Eclipse Modeling Framework
folder, select “EMF Project” and click Next.

4. Enter a name for the EMF project that is used to import the new ETS
Ecore model. Click Next.

Proprietary – See Copyright Page 57 Installing Custom e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
5. Select “e-terrahabitat HDB schema (DBDEF)” and click Next.

6. Modify the Base URI to correctly represent the name and version of
the custom database.
7. After updating the URI, click “Browse File System” to locate the
DBDEF file from step 1.
8. Adjust the URI name and version number in the Base URI field if
necessary.

Proprietary – See Copyright Page 58 Installing Custom e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
9. On the next screen, a list of “packages” to generate is shown. If it is not
already selected, select the desired package. Click Finish.

At this point, files related to the new Hdb Ecore model are generated.
When the process is completed, the Package Explorer on the left
displays a folder for the new project, and the main window displays a
window titled “<database>.genmodel”.
Note: The extension “.genmodel” is an Eclipse term that has nothing to
do with the e-terraplatform Generation Model (GENMODEL)
application.

10. On the Windows menu, click Preferences.

Proprietary – See Copyright Page 59 Installing Custom e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
11. To re-build the workspace, in Eclipse, select Project > Clean from the
menu bar, and then click OK.
To set the default Deployment Target to the current Eclipse
environment, if that has not already been done, follow the procedures
in the previous chapters and in the e-terrasource Metamodel Guide.
12. On the Windows menu, click Preferences.
13. In the Preferences window, choose “Plug-in Development”, then
“Target Platform”.

14. If the list of “Target definitions” is empty, click the Add button and add
“Default: Default Target for the running platform”.

Proprietary – See Copyright Page 60 Installing Custom e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
15. Click Next, and then click Finish in the dialog box.
16. Click OK in the Preferences dialog box.
17. In the main window, right-click the model node, and select “Generate
Model Code”.

This generates Java code into the “src” directory as well as other
plug-in files.
18. Wait for the build that has started to complete.
19. Examine the project in the Package Explorer for any build errors,
indicated by red markers. Warnings are OK.
At this point, the plug-in for the new Hdb Ecore model has been
generated. The next step is to deploy the plug-in.
20. Open the plugin.xml file in the newly created project and

Proprietary – See Copyright Page 61 Installing Custom e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
21. Append the “.qualifier” text to the version name.

22. Right-click the project in the Package Explorer and select “Export”.

Proprietary – See Copyright Page 62 Installing Custom e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
23. Under “Plug-in Development”, select “Deployable plug-ins and
fragments” and click Next.

24. Make sure that the only item selected in “Available Plug-ins and
Fragments” is the newly generated plug-in with the name you
specified.

Proprietary – See Copyright Page 63 Installing Custom e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
25. Select the “Install into host” radio button. The default Repository name
can be left as is. Click Finish.
26. The plug-in deployment takes place. If a security warning is displayed
regarding unsigned content, click OK.
27. When prompted to restart Eclipse, click the Restart Now button.
28. After Eclipse restarts, on the Help menu, click About.
29. In the dialog box, click the Installation Details button.
You should be able to see an installed package with your project
name.

30. Select the Plug-ins tab.


You should be able to see the new Hdb Ecore model as a plug-in. The
plug-in ID matches the project name you specified in step 4.

31. You can now reference the new Hdb Ecore model in the QVTO code.

Proprietary – See Copyright Page 64 Installing Custom e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide
For your convenience, a “cheat sheet” describing these steps is available
within Eclipse by clicking Help > Cheat Sheets, then expanding the Alstom
Transformation Framework folder and double-clicking “Importing ETS or
HDB schemas – converting to Ecore”.

Proprietary – See Copyright Page 65 Installing Custom e-terrahabitat DB Definitions


e-terrasource Metamodel Quick Start Guide

You might also like