Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL, UML] How to structure output model elements
[ATL, UML] How to structure output model elements [message #83355] Mon, 02 June 2008 09:48 Go to next message
Eclipse UserFriend
Originally posted by: kachd.web.de

Dear ATL-Team!

I have a problem using ATL. I want to iterate through all
InstanceSpecifications, check for a certain stereotype and generate an
output model element at a certain place.

If i simply use a matched rule (from i: uml!InstanceSpecification), the
new Element is generated under the root of the output model, but i need
it inside a certain structure.

If i use a for-loop inside the "do"-section of a rule (for (i in
m.Instancespecification)), ATL stops saying "message: feature
InstanceSpecification does not exist on uml!Model"

I don't know if this manual iteration is possible at all, and i can't
find how to do it.

Thanks for your help,

Bragenheim
Re: [ATL, UML] How to structure output model elements [message #83382 is a reply to message #83355] Mon, 02 June 2008 10:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: amehmood.sophia.inria.fr

A good question by bragenheim. I have a question similar to it that I want
to have multiple hierarchies at the output xmi.For two layers i can do it
but what for multiple layers.I have tried this code:

rule processor {
from s :UML2!Component(s.isStereotypeApplied('HwProcessor') )
to t : MYUML!component ( name<-s.name,

busInterfaces<-ibusIf,
model<-imodel,
cpus<-icpus ),

ibusIf : MYUML!busInterface,
imodel : MYUML!model (ports<-prt),
icpus : MYUML!cpus (cpu<-icpu),
prt : MYUML!logicalPort(name<-prt.name),
icpu : MYUML!cpu (name<-s.name)
}

Here i try to create the component object and in it, i create the
name,busInterface,model and cpus. But when I want to extend this
hierarchy, I mean i create ports in the model and cpu in the cpus, it
actually creates them outside the processor main component.

I wanted to have multiple hierarchies. Any help is really appreciating.

Thanks alot,

-aamir-
Re: [ATL, UML] How to structure output model elements [message #83909 is a reply to message #83382] Mon, 09 June 2008 07:31 Go to previous message
Eclipse UserFriend
Originally posted by: kachd.web.de

I found a solution...

I have to use a rule like this:

rule Model2System {
from
m : uml!Model
to
ar : symtas!ArchitectureType(),
root : symtas!SymTASystemType ()
do {
for (i in uml!InstanceSpecification.allInstances()) {
ar.bus <- thisModule.generateArchitectureBus();
}
}
}

This way, a root is created, the "architecture"-structure is generated
within, and in the loop new elements are generated at the right place...

It should work fine with multiple structures, too...

Bye,

Bragenheim




Aamir schrieb:
> A good question by bragenheim. I have a question similar to it that I
> want to have multiple hierarchies at the output xmi.For two layers i can
> do it but what for multiple layers.I have tried this code:
>
> rule processor {
> from s :UML2!Component(s.isStereotypeApplied('HwProcessor') )
> to t : MYUML!component ( name<-s.name,
>
> busInterfaces<-ibusIf,
> model<-imodel,
> cpus<-icpus ),
>
> ibusIf :
> MYUML!busInterface,
> imodel : MYUML!model
> (ports<-prt),
> icpus : MYUML!cpus
> (cpu<-icpu),
> prt :
> MYUML!logicalPort(name<-prt.name),
> icpu : MYUML!cpu
> (name<-s.name)
> }
>
> Here i try to create the component object and in it, i create the
> name,busInterface,model and cpus. But when I want to extend this
> hierarchy, I mean i create ports in the model and cpu in the cpus, it
> actually creates them outside the processor main component.
>
> I wanted to have multiple hierarchies. Any help is really appreciating.
>
> Thanks alot,
>
> -aamir-
>
>
>
>
Previous Topic:How to set TYPE in UMl models
Next Topic:[ATL] Saving Model Programmatically
Goto Forum:
  


Current Time: Sun Aug 18 19:03:08 GMT 2019

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

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

Back to the top