[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.m2m] Re: [ATL, UML] How to structure output model elements
|
- From: Arnd <kachd@xxxxxx>
- Date: Mon, 09 Jun 2008 09:31:23 +0200
- Newsgroups: eclipse.modeling.m2m
- Organization: EclipseCorner
- User-agent: Thunderbird 2.0.0.14 (Windows/20080421)
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-