Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] OCL queries
[ATL] OCL queries [message #73983] Wed, 30 January 2008 17:57 Go to next message
Eclipse UserFriend
Originally posted by: frederic.thomas.cea.fr

Hi,

I use ATL for UML model transformations. In my case study, I need to
transform a UML model in which some OCL constraints must parametrized the
transformation execution. In other words, I need to check those
constraints during the transformation execution.

Does it exist a way to call OCL queries during an ATL transformation
execution ?

Of course, their syntaxes should be conformed to the OCL implementation of
ATL.
Re: [ATL] OCL queries [message #74345 is a reply to message #73983] Tue, 05 February 2008 13:22 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 147
Registered: July 2009
Senior Member
Frédéric Thomas wrote:
> Hi,
>
> I use ATL for UML model transformations. In my case study, I need to
> transform a UML model in which some OCL constraints must parametrized
> the transformation execution. In other words, I need to check those
> constraints during the transformation execution.

Are those OCL constraints on UML elements or on MOF elements? ATL only
support OCL applied to MOF. UML OCL expressions, such as operation pre-
and postconditions, cannot be evaluated by ATL.

> Does it exist a way to call OCL queries during an ATL transformation
> execution ?
>
> Of course, their syntaxes should be conformed to the OCL implementation
> of ATL.
>

Here I assume you use OCL applied to MOF, as is the case for ATL. If you
want ATL to evaluate ATL code from its input model (that includes OCL),
then you need to use a higher-order transformation. A higher-order
transformation generates a new ATL transformation that includes your OCL
code.

An example higher-order transformation is ATL2Tracer:
http://www.eclipse.org/m2m/atl/atlTransformations/#ATL2Trace r
--
Dennis
Re: [ATL] OCL queries [message #74402 is a reply to message #73983] Tue, 05 February 2008 16:01 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi,

> I use ATL for UML model transformations. In my case study, I need to
> transform a UML model in which some OCL constraints must parametrized
> the transformation execution. In other words, I need to check those
> constraints during the transformation execution.
> Does it exist a way to call OCL queries during an ATL transformation
> execution ?

There are several possibilities. For instance:
- "Dynamically": you could parse the OCL expressions using the
String.inject(...) operation, then interpret the expressions using helpers.
- "Statically": you could run a first transformation from UML to ATL
that would extract the OCL expressions and encapsulate them in a
transformation, then run this transformation. In this case, you would be
using a Higher Order Transformation (HOT).



Regards,

Frédéric Jouault
Re: [ATL] OCL queries [message #74419 is a reply to message #74402] Tue, 05 February 2008 16:03 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi again,

I have just noticed Dennis'message, in which he also suggested the HOT
approach :-).


Regards,

Frédéric Jouault


Frédéric Jouault wrote:
> Hi,
>
> > I use ATL for UML model transformations. In my case study, I need to
> > transform a UML model in which some OCL constraints must parametrized
> > the transformation execution. In other words, I need to check those
> > constraints during the transformation execution.
> > Does it exist a way to call OCL queries during an ATL transformation
> > execution ?
>
> There are several possibilities. For instance:
> - "Dynamically": you could parse the OCL expressions using the
> String.inject(...) operation, then interpret the expressions using helpers.
> - "Statically": you could run a first transformation from UML to ATL
> that would extract the OCL expressions and encapsulate them in a
> transformation, then run this transformation. In this case, you would be
> using a Higher Order Transformation (HOT).
>
>
>
> Regards,
>
> Frédéric Jouault
Re: [ATL] OCL queries [message #74563 is a reply to message #74402] Wed, 06 February 2008 09:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: frederic_thomas_fr.yahoo.fr

Hi,

Frédéric Jouault a écrit :
> There are several possibilities. For instance:
> - "Dynamically": you could parse the OCL expressions using the
> String.inject(...) operation, then interpret the expressions using helpers.
> - "Statically": you could run a first transformation from UML to ATL
> that would extract the OCL expressions and encapsulate them in a
> transformation, then run this transformation. In this case, you would be
> using a Higher Order Transformation (HOT).

Thanks a lot for your answer.

In fact, I have implemented a third solution. I have forked the uml24atl
driver.This new driver is called ocluml24atl. It provides a new
operation named checkConstraint() which call the emf.ocl.validator. This
plugin parses the constraint body by itself and evaluates the
constraint. In my case OCL constraints are only invariants. Hence, that
new ATL VM operation returns a boolean. I can check OCL invariant
constraints stored in my input UML model during the ATL transformation
execution. It's certainly not the best solution but It works fine.

Anyway, I am interresting to improve my solution. I am prototyping a
tool in which several ATL transformations are aleady chained. I can add
a new transformation from UML to ATL (the HOT transformation that you
mentioned). Nevertheless, body of OCL constraints in UML models are
strings. Hence I have to inject (with TCS for example) that strings to a
model conforms to an OCL metamodel (The ATL one for example) and at last
to execute the HOT transformation.

Does it already exist such TCS OCL injector in the ATL toolkit ?

What is the String.inject() operation that you mentionned ?
I don't find any documentation on the ATL manual. I maybe miss something.

Regards,

Frédéric
Re: [ATL] OCL queries [message #74599 is a reply to message #74563] Wed, 06 February 2008 10:03 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi,


You can find more information about String.inject(...) at:
http://dev.eclipse.org/newslists/news.eclipse.modeling.m2m/m sg00673.html

Let us know if we can help you further in improving your solution.


Regards,

Frédéric Jouault


Frédéric Thomas wrote:
> Hi,
>
> Frédéric Jouault a écrit :
>> There are several possibilities. For instance:
>> - "Dynamically": you could parse the OCL expressions using the
>> String.inject(...) operation, then interpret the expressions using helpers.
>> - "Statically": you could run a first transformation from UML to ATL
>> that would extract the OCL expressions and encapsulate them in a
>> transformation, then run this transformation. In this case, you would be
>> using a Higher Order Transformation (HOT).
>
> Thanks a lot for your answer.
>
> In fact, I have implemented a third solution. I have forked the uml24atl
> driver.This new driver is called ocluml24atl. It provides a new
> operation named checkConstraint() which call the emf.ocl.validator. This
> plugin parses the constraint body by itself and evaluates the
> constraint. In my case OCL constraints are only invariants. Hence, that
> new ATL VM operation returns a boolean. I can check OCL invariant
> constraints stored in my input UML model during the ATL transformation
> execution. It's certainly not the best solution but It works fine.
>
> Anyway, I am interresting to improve my solution. I am prototyping a
> tool in which several ATL transformations are aleady chained. I can add
> a new transformation from UML to ATL (the HOT transformation that you
> mentioned). Nevertheless, body of OCL constraints in UML models are
> strings. Hence I have to inject (with TCS for example) that strings to a
> model conforms to an OCL metamodel (The ATL one for example) and at last
> to execute the HOT transformation.
>
> Does it already exist such TCS OCL injector in the ATL toolkit ?
>
> What is the String.inject() operation that you mentionned ?
> I don't find any documentation on the ATL manual. I maybe miss something.
>
> Regards,
>
> Frédéric
>
>
>
>
>
>
>
Re: [ATL] OCL queries [message #74785 is a reply to message #74563] Mon, 11 February 2008 14:12 Go to previous message
Milan Milanovich is currently offline Milan MilanovichFriend
Messages: 201
Registered: July 2009
Senior Member
Dear Frédéric,

> Does it already exist such TCS OCL injector in the ATL toolkit ?

Yes, there is OCL TCS injector, but it is not part of the ATL toolkit,
you can find it here:

http://www.eclipse.org/m2m/atl/atlTransformations/#OCL2SWRL

You should know also that it have some constraints, e.g., now it only
parse invariants, etc.

_____________________________
Best regards, Milan Milanovic

Frédéric Thomas wrote:

> Hi,

> Frédéric Jouault a écrit :
>> There are several possibilities. For instance:
>> - "Dynamically": you could parse the OCL expressions using the
>> String.inject(...) operation, then interpret the expressions using helpers.
>> - "Statically": you could run a first transformation from UML to ATL
>> that would extract the OCL expressions and encapsulate them in a
>> transformation, then run this transformation. In this case, you would be
>> using a Higher Order Transformation (HOT).

> Thanks a lot for your answer.

> In fact, I have implemented a third solution. I have forked the uml24atl
> driver.This new driver is called ocluml24atl. It provides a new
> operation named checkConstraint() which call the emf.ocl.validator. This
> plugin parses the constraint body by itself and evaluates the
> constraint. In my case OCL constraints are only invariants. Hence, that
> new ATL VM operation returns a boolean. I can check OCL invariant
> constraints stored in my input UML model during the ATL transformation
> execution. It's certainly not the best solution but It works fine.

> Anyway, I am interresting to improve my solution. I am prototyping a
> tool in which several ATL transformations are aleady chained. I can add
> a new transformation from UML to ATL (the HOT transformation that you
> mentioned). Nevertheless, body of OCL constraints in UML models are
> strings. Hence I have to inject (with TCS for example) that strings to a
> model conforms to an OCL metamodel (The ATL one for example) and at last
> to execute the HOT transformation.

> Does it already exist such TCS OCL injector in the ATL toolkit ?

> What is the String.inject() operation that you mentionned ?
> I don't find any documentation on the ATL manual. I maybe miss something.

> Regards,

> Frédéric
Previous Topic:[ATL] variable number of output models
Next Topic:ATL website changes
Goto Forum:
  


Current Time: Fri May 24 15:26:40 GMT 2019

Powered by FUDForum. Page generated in 0.02198 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top