I'm trying to port the public2private example to the latest ATL and to UML2.
The fix I'm stuck with now is the containment of newly created elements in refining mode.
With the following code
rule ReadOnlyPublicAttribute {
from
s : UML!Property (
(s.visibility = #public) and
(s.isReadOnly)
)
to
t : UML!Property (
visibility <- #private
),
-- getter
tg : UML!Operation (
name <- 'get' + s.name.firstToUpper(),
visibility <- #public,
isQuery <- true,
ownedParameter <- tgr
),
tgr : UML!Parameter (
...
a new model is created but the getter operations, in the UML model are children of platform instead of being children of the class containing the property (s).
In the original code this was fixed by setting the owner feature which is no more changeable now.
How can this be fixed?
Thanks,
Davide.
[Updated on: Thu, 24 May 2012 14:27]
Report message to a moderator