Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Can I apply helpers just on classes used as main class?
[ATL] Can I apply helpers just on classes used as main class? [message #547686] Mon, 19 July 2010 07:10 Go to next message
Eclipse UserFriend
Hello

I created a helper which has his context related to class ControlFlow.
 helper context EPK!ControlFlow def: isConditionExpression() 


Now I wanted to assign this helper to the rule:

-- Rule 9c / 11b
rule Event {
from
	e : EPK!Event (not e.isConditionExpression())
to 
...


Is this not working (context of helper: ControlFlow / from in rule EPK!Event)? How can I then check this?

thanks for your help. Cheers Roger
Re: [ATL] Can I apply helpers just on classes used as main class? [message #547692 is a reply to message #547686] Mon, 19 July 2010 07:23 Go to previous messageGo to next message
Eclipse UserFriend
Le 19/07/2010 13:10, Roger80 a écrit :
> Hello
> I created a helper which has his context related to class ControlFlow.
> helper context EPK!ControlFlow def: isConditionExpression()
> Now I wanted to assign this helper to the rule:
>
>
> -- Rule 9c / 11b
> rule Event {
> from
> e : EPK!Event (not e.isConditionExpression())
> to ..
>
>
> Is this not working (context of helper: ControlFlow / from in rule
> EPK!Event)? How can I then check this?
>
> thanks for your help. Cheers Roger

ATL and EMF respect inheritance principles so if you want to apply your
rule to multiple types which inherit from a main class, you have to put
the main type as context of this rule !!!
--
Cordialement

Vincent MAHÉ

Ingénieur Expert - Projet IDM++ - Équipe AtlanMod
École des Mines de Nantes
La Chantrerie - 4, rue Alfred Kastler
B.P. 20722 - F-44307 NANTES Cedex 3
Tel: (33)2 51 85 81 00
Re: [ATL] Can I apply helpers just on classes used as main class? [message #547706 is a reply to message #547686] Mon, 19 July 2010 08:12 Go to previous messageGo to next message
Eclipse UserFriend
Ok, but then my helper is not working anymore...i need this helper for both rules, once for the Event rule and once for the Control flow rule...do I have to make then two rules?
Re: [ATL] Can I apply helpers just on classes used as main class? [message #547708 is a reply to message #547686] Mon, 19 July 2010 08:15 Go to previous messageGo to next message
Eclipse UserFriend
Use an OclAny context if there is no common EClass in the inheritance trees of the two classes.
icon14.gif  Re: [ATL] Can I apply helpers just on classes used as main class? [message #547768 is a reply to message #547686] Mon, 19 July 2010 11:00 Go to previous message
Eclipse UserFriend
Thanks, through your answer I was able to solve it.
Previous Topic:java code
Next Topic:[QVTo] Return from mapping
Goto Forum:
  


Current Time: Sat Jul 19 11:24:30 EDT 2025

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

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

Back to the top