[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.m2m] [ATL] Generate Output Elements at runtime/dynamically
|
Hello ATL Friends,
I am trying to workout some way that I may generate the output model
elements dynamically(at runtime). For example, I search at run-time, the
no. of ports on the UML component under consideration, and I try to
generate the output 'port' element but I get one and only one element for
all iterations. and also for that one element, i can't add its attributes
like,
t.model <- myML!port(name<-s.name);
Even if i write the same line two times (without for loop), i will get
only one element at the output, like
t.model <- myML!port(name<-s.name);
t.model <- myML!port(name<-s.name);
Or else if I know in advance that I have to generate 3 ports at runtime,
then how can i do it in 'do' part or the 'to' part of ATL rule.
I can't use another rule becoz the ports under search r directly related
to the component (and later on 'required interfaces' used, can't trace
their container components and those interfaces can only be accessed from
their components in UML!!!). Here is the code below:
rule processor {
from s : UML2!Component (s.isStereotypeApplied('HwBus'))
to t : myML!component (name<-s.name)
do {
for(p in s.getFeatures()){
t.model <- myML!port;
}
}
}
I am totally stuck here, any help (from Jouault, Freddy, Ivano, Hugo or
anyone else) is highly appreciating...
Thanking you all in anticipation,
-aamir-