Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] How to set up the dependency owner or namespace by ATL
[ATL] How to set up the dependency owner or namespace by ATL [message #481676] Sun, 23 August 2009 07:47 Go to next message
micromilua  is currently offline micromilua Friend
Messages: 20
Registered: July 2009
Junior Member
When I do this transformation. The Dependency isn't in the Model
See the Picture
http://img36.imageshack.us/img36/2156/33949981.jpg



I try two method , but I can't transformation successly.

Method1:
--namespace<-t,
Method2:
-owner<-thisModule.Global_UmlModel,

My ATL code is as below:

Firsly, I assign the Model to "thisModule.Global_UmlModel " Variable
=====================================================

rule Model {
from s : UML2!"uml::Model" (thisModule.inElements->includes(s))
to t : UML2!"uml::Model" mapsTo s (
name <- s.name),


do {
thisModule.Global_UmlModel <- t ;
}

=====================================================

And , I want to set up the dependency owner or namespace
=====================================================
rule Class {
from s : UML2!"uml::Class" (
if thisModule.inElements->includes(s) then
s.oclIsTypeOf(UML2!"uml::Class")
else false endif)

to t : UML2!"uml::Class" (
name <- s.name,
package <- s.package),

addDependency: UML2!"uml::Dependency" mapsTo s (
name<-'Dependency',
--namespace<-t,
--owner<-thisModule.Global_UmlModel,

supplier<-(UML2!Class.allInstances()->select(st | st.name = 'Mediator').first()),
client<-t)
}


Thanks a lot

micromilua
Re: [ATL] How to set up the dependency owner or namespace by ATL [message #481779 is a reply to message #481676] Mon, 24 August 2009 09:56 Go to previous messageGo to next message
Freddy Allilaire is currently offline Freddy AllilaireFriend
Messages: 130
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080706000107070303010508
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Micromilua,

Don't you have any way to retrieve the corresponding source "uml Model"
from rule "Model" in rule "Class"?
e.g.:

rule Class {
from s : UML2!"uml::Class" (
if thisModule.inElements->includes(s) then
s.oclIsTypeOf(UML2!"uml::Class")
else false endif)

to t : UML2!"uml::Class" (
name <- s.name,
package <- s.package),
addDependency: UML2!"uml::Dependency" mapsTo s (
name<-'Dependency',
--namespace<-t,
owner<- UML2!Model.allInstances()->select(e |
thisModule.inElements->includes(e))->any()
supplier<-(UML2!Class.allInstances()->select(st | st.name =
'Mediator').first()),
client<-t)

If I don't miss any points, I think this kind of solution would be
better and should work.

Regards,
Freddy.


micromilua a écrit :
> When I do this transformation. The Dependency isn't in the Model
> See the Picture
>
>
>
>
> I try two method , but I can't transformation successly.
>
> Method1:
> --namespace<-t,
> Method2:
> -owner<-thisModule.Global_UmlModel,
>
> My ATL code is as below:
>
> Firsly, I assign the Model to "thisModule.Global_UmlModel " Variable
> =====================================================
>
> rule Model {
> from s : UML2!"uml::Model" (thisModule.inElements->includes(s))
> to t : UML2!"uml::Model" mapsTo s (
> name <- s.name),
>
>
> do {
> thisModule.Global_UmlModel <- t ;
> }
>
> =====================================================
>
> And , I want to set up the dependency owner or namespace
> =====================================================
> rule Class {
> from s : UML2!"uml::Class" (
> if thisModule.inElements->includes(s) then
> s.oclIsTypeOf(UML2!"uml::Class")
> else false endif)
>
> to t : UML2!"uml::Class" (
> name <- s.name,
> package <- s.package),
> addDependency: UML2!"uml::Dependency" mapsTo s (
> name<-'Dependency',
> --namespace<-t,
> --owner<-thisModule.Global_UmlModel,
> supplier<-(UML2!Class.allInstances()->select(st | st.name =
> 'Mediator').first()),
> client<-t)
> }
>
>
> Thanks a lot
> micromilua


--------------080706000107070303010508
Content-Type: text/x-vcard; charset=utf-8;
name="freddy_allilaire.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="freddy_allilaire.vcf"

YmVnaW46dmNhcmQNCmZuOkZyZWRkeSBBbGxpbGFpcmUNCm46QWxsaWxhaXJl O0ZyZWRkeQ0K
b3JnOk9CRU8NCmFkcjo7OzIgcnVlIFJvYmVydCBTY2h1bWFubjtOQU5URVM7 OzQ0NDA4O0Zy
YW5jZQ0KZW1haWw7aW50ZXJuZXQ6ZnJlZGR5LmFsbGlsYWlyZUBvYmVvLmZy DQp0aXRsZTpS
JkQgRW5naW5lZXINCnVybDp3d3cub2Jlby5mcg0KdmVyc2lvbjoyLjENCmVu ZDp2Y2FyZA0K
DQo=
--------------080706000107070303010508--
Re: [ATL] How to set up the dependency owner or namespace by ATL [message #482342 is a reply to message #481779] Wed, 26 August 2009 10:21 Go to previous messageGo to next message
micromilua  is currently offline micromilua Friend
Messages: 20
Registered: July 2009
Junior Member
Thanks for Freddy
I will try and reply you soon~

micromilua
Re: [ATL] How to set up the dependency owner or namespace by ATL [message #482849 is a reply to message #481779] Fri, 28 August 2009 10:52 Go to previous message
micromilua  is currently offline micromilua Friend
Messages: 20
Registered: July 2009
Junior Member
Hi Freddy

the ATL compiler report the question

Could not find operation any on Sequence(OclAny) having supertypes: [Collection(OclAny)]
at A.__applyClass(1 : NTransientLink;) : ??(mediator.atl)
local variables = {t=OUT!Alarm, s=<unnamed>!Alarm, link=TransientLink {rule = 'Class', sourceElements = {s = <unnamed>!Alarm}, targetElements = {addDependency = OUT!Dependency, t = OUT!Alarm}, variables = {}}, self=mediator : ASMModule, null=OUT!mediator_test, addDependency=OUT!Dependency}
local stack = [OUT!Dependency, OUT!Dependency, mediator : ASMModule]

I am trying other solution~ If I have better solution ,
I will reply soon.
Thanks

micromilua
Previous Topic:ATL:Multiple assignments in an iterator
Next Topic:[Announce] Eclipse Modeling Days
Goto Forum:
  


Current Time: Mon Jan 13 21:37:32 GMT 2025

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

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

Back to the top