[ATL] UseCase 2 HighLevel rules [message #47336] |
Mon, 18 June 2007 07:53  |
Eclipse User |
|
|
|
Originally posted by: hein..fokus.fraunhofer
Hi all,
I've a problem in formulating the right ATL rules. My source model is an
UML model that contains UseCases, Actors as well as Associations between
them. My target model is also an UML based model that should contains
the same usecases, actors and associations and furthermore classes which
are derived from the usecase, actors and associations information. The
classes should be created in a new package named "ClassPackage".
The transformation of the several entities isn't very difficult
rule Actor{
from a1:UML2!Actor
to a2:UML2!Actor(
name<-a1.name,
general<-a1.general
),
c1:UML2!Class(
name<-a1.name,
general<-if a1.general->size()>0 then
UML2!Class.allInstances()->select(x|x.name=a1.general->first().name)
else Set{} endif
)
}
or...
rule UseCase{
from u1:UML2!UseCase
to u2:UML2!UseCase(
name<-u1.name,
--owner<-u1.owner,
include<-u1.include
),
c1:UML2!Class (
name<-u1.name,
useCase<-u1,
nestedClassifier<- if u1.include->size()>0 then
UML2!Class.allInstances()->select(c |
u1.include->collect(i|i.addition.name)->includes(c.name) )
else Set{} endif
)
}
However, my problem are the creation of the associations. I need to
create two associations that have different association ends in each
cases. Here is my initial rule for association
rule Asscociation{
from a1:UML2!Association
to a2:UML2!Association(
name<-a1.name,
memberEnd<-a1.memberEnd,
ownedEnd<-a1.ownedEnd
),
a3:UML2!Association(
name<-a1.name+'source_target',
ownedEnd<-a1.ownedEnd
)
}
a2 should be a simple copy of a1 (Actor<->UseCase), but a3 should be a
new association between the generated Classes in the target model from
an Actor and an UseCase. How to specify the right OwnedEnd member for
the association a3 with ATL.
Thanks in advance for any help
Christian
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04574 seconds