The metamodel of my domain independent language is specified in Ecore (*.ecore).

For instance, assuming that the name of my language is "ABCD", i have the metamodel: ABCD.ecore that defines my language ABCD.

Thus, a model of my ABCD language is for example (myFirstModel.xmi), possibly rename for myFirstModel.abcd,

wherein the xmi instance of that ecore model is, in fact, my ABCD model.

Now, if i want to add OCL constraints to my model myFirstModel.xmi/myFirstModel.abcd,

Is there a way to do this using OCL implementation of Eclipse?

Until now, i have figured out that OCL only specifies constraints in Ecore & UML models.

Thus i think that it is not possible to parse the constraints against that ABCD model (xmi instance of Ecore model).

Am i right?

I've been struggling with this issue a long time ago,

My solution for this problem today is just transform my ABCD model into UML model in order to

parse the constraints against the ABCD model. Doing that, i'm able to use the OCL/UML binding provided by EMF's implementation of OCL.

Att.

John]]>

It is easy to get confused by meta-levels, which just might be your

problem, but probably not.

You suggest transforming to the OCL/UML binding. This is perhaps the

hardest approach since UML is so rich. Ecore would be easier.

I'm not clear whether you are familiar with the OCLinEcore editor, which

makes life much easier. It uses Xtext technology and a UML-aligned pivot

model, so that you could say it actually does an Ecore/UML to Pivot

transformation to use OCL.

You could replicate that with an ABCD to Pivot transformation.

I haven't checked whether this actually works, but in principle if you

have a model that extends the lightweight DomainPackage, DomainClass,

DomainProperty, DomainOperation etc interfaces you might be able to use

OCL more directly. Of course you'll be the first to try so expect

teething difficulties.

But returning to the meta-model levels, do you really need your own

language? you will have to replicate a lot of tools, whereas if you can

use Ecore as your language all the EMF projects are there for free.

Of course if you really want your own language, do you really want OCL?

If you can live with Java-like pragmatisms, Xtext, Xbase and their

friends provide a very powerful, better integrated, better supported

solution.

Regards

Ed Willink

On 21/02/2013 15:48, John Guerson wrote:

> Hi,

>

> The metamodel of my domain independent language is specified in Ecore

> (*.ecore). For instance, assuming that the name of my language is

> "ABCD", i have the metamodel: ABCD.ecore that defines my language ABCD.

>

> Thus, a model of my ABCD language is for example (myFirstModel.xmi),

> possibly rename for myFirstModel.abcd, wherein the xmi instance of

> that ecore model is, in fact, my ABCD model.

>

> Now, if i want to add OCL constraints to my model

> myFirstModel.xmi/myFirstModel.abcd,

> Is there a way to do this using OCL implementation of Eclipse?

>

> Until now, i have figured out that OCL only specifies constraints in

> Ecore & UML models. Thus i think that it is not possible to parse the

> constraints against that ABCD model (xmi instance of Ecore model).

> Am i right?

>

> I've been struggling with this issue a long time ago,

> My solution for this problem today is just transform my ABCD model

> into UML model in order to parse the constraints beeing able to use

> the OCL/UML binding provided by EMF's implementation of OCL.

>

> Att.

> John]]>

Yes, i first thought in transforming it into Ecore but i ended up transforming it into UML anyway.

The thing is that i need to somehow get those textual OCL constraints, related to that ABCD model (xmi instance of Ecore i.e. my model ) for transformation purposes i.e.

transforming those OCL constraints to another language via Java.

I'm not familiar with OCLinEcore. If i understood correctly, the solution pointed by you is to transform the ABCD model to the UML-aligned Pivot model, right?

I do not understand much of that Pivot implementation. Can you give me a reference?

I'm only familiar with the OCL implementations: org.eclipse.ocl.ecore/uml. I use the Complete OCL Editor to write the OCL constraints in the generated UML model equivalent to my ABCD model.

With respect to the language, yes, in fact, it is an implementation made by other colleagues and for now, it will remain like that i.e. designed in Ecore, even with the downsides, i am aware of that.

With respect to the use of OCL, i need to write rules to complement that ABCD model (mainly invariants and derivations).

Are you aware of another reference for other types of languages that play the same role of OCL w.r.t. invariant rules and derivations?

The ABCD language should be in fact an UML profile, an extension of UML, but it was implemented as another language, designed in Ecore, therefore, with that, i think we lost some important UML and OCL tool support.

I really appreciate your attention,

Many thanks

John

]]>

I'm sorry, but my previous reply seems to answer your questions.

Look at the OCL project page fior links through to documentationm.

Regards

Ed Willink

On 22/02/2013 00:53, John Guerson wrote:

>

> Hi Ed, thanks for the quickly reply, as always.

>

> Yes, i first thought in transforming it into Ecore but i ended up

> transforming it into UML anyway.

>

> The thing is that i need to somehow get those textual OCL constraints,

> related to that ABCD model (xmi instance of Ecore i.e. my model ) for

> transformation purposes i.e. transforming those OCL constraints to

> another language via Java.

>

> I'm not familiar with OCLinEcore. If i understood correctly, the

> solution pointed by you is to transform the ABCD model to the

> UML-aligned Pivot model, right?

> I do not understand much of that Pivot implementation. Can you give me

> a reference?

> I'm only familiar with the OCL implementations:

> org.eclipse.ocl.ecore/uml. I use the Complete OCL Editor to write the

> OCL constraints in the generated UML model equivalent to my ABCD model.

>

> With respect to the language, yes, in fact, it is an implementation

> made by other colleagues and for now, it will remain like that i.e.

> designed in Ecore, even with the downsides, i am aware of that.

> With respect to the use of OCL, i need to write rules to complement

> that ABCD model (mainly invariants and derivations).

> Are you aware of another reference for other types of languages that

> play the same role of OCL w.r.t. invariant rules and derivations?

> I really appreciate your attention,

>

> Many thanks

> John

>]]>