long-winded to copy all properties [message #88897] |
Mon, 25 August 2008 10:12 |
Eclipse User |
|
|
|
Originally posted by: xxx.tullball.no
I am defining a transformation where the source and target models are both
UML 2 activity models.
I use superimposition on the UML2Copy module in order to simply keep the
unchanged parts.
In my transformation I will override the ControlFlow rule since I will
only keep non-circular edges. The only change is to add a rule guard
(inCF.source <> inCF.target):
rule ControlFlow {
from inCF : UML2 ! ControlFlow (inCF.source <> inCF.target)
to outCF: UML2 ! ControlFlow (
source <- inCF.source,
target <- inCF.target,
guard <- inCF.guard,
-- All the other properties will also be copied...
)
}
It is long-winded to relist all the properties of a control flow object.
Is there no super() method or similar when doing superimposition?
I also tried to skip the copy part (the to-body) and add the follow do
section instead:
do {
outCF <- inCF;
}
But the latter does not work.
Am I missing something or is there no clever way to do this?
|
|
|
|
Re: long-winded to copy all properties [message #88954 is a reply to message #88912] |
Tue, 26 August 2008 06:54 |
Eclipse User |
|
|
|
Originally posted by: xxx.tullball.no
Now I tried your suggestion to use inheritance,
but I get a compilation error. The compiler cannot find the super rule,
ControlFlow. It is maybe not surprising, since the the ControlFlow rule
appears in the UML2Copy rule, and the transformation module I am writing
on is superimposed on the UML2Copy.
Does this mean I do not get any further, since I cannot combine
superimpose and do inheritance on the superimposed module?
rule SubControlFlow extends ControlFlow { -- COMPILATION ERROR: superRule
ControlFlow not found!
from inCF : UML2 ! ControlFlow (inCF.source <> inCF.target)
to outCF: UML2 ! ControlFlow (
)
}
|
|
|
|
Re: [ATL] Re: long-winded to copy all properties [message #89123 is a reply to message #88983] |
Tue, 26 August 2008 11:55 |
Eclipse User |
|
|
|
Originally posted by: xxx.tullball.no
William wrote "But you can try to duplicate the ControlFlow rule into the
superimposed module".
================================
Yes, but that would then be the same as copying all the properties.
And the conclusion is that I have to copy all the properties within my
transformation module.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03414 seconds