This is a draft.
This document assumes that:
UC1 - Create query set: The developer creates a query set by declaring its identifier and the used meta-models. Each query set contains one or more queries. The developer has to add queries in the new query set ( UC2)
UC2 - Add a query in a query set: The developer selects an existing query set and adds a new query in this query set. Each query has a name and this name is the query identifier. To add a model query the developer has to provide: the name, the parameters, the description and the implementation. All the model query sets are automatically detected and added into a catalog.
UC3 - Use a model query: To use a model query the user has to find it in the model query set catalog ( UC5). To execute a query the user has to provide an execution context (a set of models and of model elements) and the parameter values.
UC4 - Add a query to a meta-class: The developer wants to create a query dedicated to a certain meta-class by selecting the meta-class or one of its instances. He has to choose a query set in the catalog, or create a new query set ( UC1) and then create a new query.
UC5 - Find a query in the catalog: by scope, by name, by query set name, by return type.
UC6 - Publish a model query: The developer publishes a query set to allow other users to install the query set in their working environment. A published and/or installed query cannot be modified by the query set user (to make sure that the published model query set will never be modified). An installed model query set is available through the model query set catalog. A published query set has a version number.
Actors: query developer, query user
Functional components:
Implementation classes:
Scope: This wizard can be called using a popup menu on the main menu, package explorer, navigator, etc.. If a project was selected, it is automatically chosen in the wizard. This wizard can also be called from the query panel of the "Query Execution" view
Implementation classes: org.eclipse.gmt.modisco.infra.query.editor.presentation.QueryModelWizard
Scope:
Behaviour:
Extension point:
Implementation classes:
Uses:
Functional operation | Realization |
---|---|
ModelQuerySetEditor::createModelQuerySet() | Wizard "New QuerySet model" |
ModelQuerySetEditor::editModelQuerySet() | EMF generated model editor |
ModelQuerySetCatalog::addQuerySet() | |
ModelQuerySetCatalog::removeQuerySet() | |
ModelQuerySetCatalog::getAllModelQuerySet() | |
ModelQuerySetCatalog:: findQueryByName() | |
Sharing::commit() | org.eclipse.team |
Sharing::checkout() | org.eclipse.team |
ModelQuery::editQuery() | Query property view |
ModelQuery::evaluate | "Query Execution" view |
Publisher::publish() | PDE Export plug-in |
Publisher::get() | PDE Import plug-in |
Installer::install() | P2 |
ModelQuerySet::addQuery() | Wizard "Create Query Wizard" |
MetaClass::addQuery | |
Create a MoDisco project named test001
In the project test001, create a query set:
In the query set My, create an OCL query:
Save My.querySet
Open the Ecore meta-model ( http://www.eclipse.org/emf/2002/Ecore) using the MoDisco model browser.
Select a set of EClass, right-click > Execute Query
In the "Query Execution" view select the query My/self and execute the query.
In the project test001, create a query set named My1.querySet.
In the project test001, create a query set named My2.querySet.
In the "Query Execution" view,
Press Next
Press Finish
Implement the method my1.Attr.evaluate(…):
return context.getEAllAttributes();
In "Query Execution" view
Import the uml browser customization example
Open the "Query set view"