Java Reference
In-Depth Information
<entity extends="PageStyle"/>
</eclass>
<eclass name="ConnectorStyle">
<entity extends="RoutingStyle"/>
</eclass>
</epackage>
</persistence-mapping>
A curious feature in the notation model implementation requires another
change for Teneo to function properly. See bug 159226 in Eclipse Bugzilla and
the GMFEListPropertyHandler class in the sample project for more informa-
tion. Hopefully by the time you read this, the bug will be resolved and the cus-
tom handler will no longer be required.
To initialize Teneo, we create a StoreController class. The class is pro-
vided in the sample project and comes largely from the original tutorial. You can
easily generate this class and the remaining code required to use Teneo in com-
bination with GMF using a decorator to the generator model and custom tem-
plates.
In the StoreController , a URI is defined using the datastore name and
query using the hbxml scheme, which initializes a HibernateXMLResource
class. In this case, our scenario data store is queried to load the Process element
of the domain model and Diagram element of the notation model into the
resource root.
public static final URI DATABASE_URI = URI.createURI(
"hbxml://?dsname=scenario&query1=from Process&query2=from Diagram");
An instance HbSessionDataStore class is created and initialized as shown
next in the contents of our initializeDataStore() method. The EPackage s
used include the domain model, the GMF notation model, the Ecore model, and
the Ecore XML type model. The teneo.properties with connection informa-
tion and annotations.xml are also loaded and used in the initialization. This
method and the corresponding closeDataStore() method should be called
from our plug-in Activator's start() and stop() methods, respectively.
final HbSessionDataStore localDataStore = new HbSessionDataStore();
localDataStore.setName("scenario");
HbHelper.INSTANCE.register(localDataStore);
final EPackage[] ePackages = new EPackage[] {
ScenarioPackage.eINSTANCE, NotationPackage.eINSTANCE,
Search WWH ::




Custom Search