[ATL] Feature ... is not changeable [message #788838] |
Thu, 02 February 2012 04:33  |
Eclipse User |
|
|
|
Hi,
i'm trying to perform a M2M-transformation from an Java-Model (created with MoDisco) to an UML-Model.
My Problem: If i try to set the owner of a UML::Property i always get the error message "Feature owner is not changeable". I know that in the UML Metamodel owner is declared as not changeable, but despite that is there a way to set the owner during the transformation? Perhaps to force ATL to set this attribute?
I already tried to set the ownedAttribute-Field of an UML::Class to the corresponding attributes of the Java-Modell, but that didn't work either.
So, i hope that there is a possibility to force ATL to set this owner-Field.
Thanks for your answers!
Best regards,
Stoehm
|
|
|
|
|
Re: [ATL] Feature ... is not changeable [message #789126 is a reply to message #789116] |
Thu, 02 February 2012 11:22   |
Eclipse User |
|
|
|
Hi
Cross-resource containment is a different issue. I think it's normally
disabled because it's expensive but you can enable it when you genmodel.
However the message may indicate something nastier like putting an input
element ion an output resource. I've never been able to understand ATL
so I cannot help you on ATL-specific subtleties.
Regards
Ed Willink
On 02/02/2012 16:12, st oehm wrote:
> Edward Willink wrote on Thu, 02 February 2012 04:52
>> Hi
>>
>> The UML meta-model has a variety of subset properties and generally
>> you can only change one of them.
>>
>> I suggest checking that you add to the container from which the
>> subsets are built.
>>
>> Regards
>>
>> Ed Willink
>
>
> Hi Ed,
>
> thanks for your answer. But i think i dont get it.
>
> Now i've tried it that way:
>
> rule Class2Class {
> from
> jClassDeclaration : JAVA!ClassDeclaration,
> jClassModifier : JAVA!Modifier (
> jClassDeclaration.modifier = jClassModifier
> )
> to
> umlClass : UML!Class (
> name <- jClassDeclaration.name,
> package <- jClassDeclaration.package,
> visibility <- jClassModifier.getVisibility(),
> isAbstract <- jClassModifier.isAbstract(),
> isLeaf <- jClassModifier.isFinal(),
> -- isActive <-
> -- elementImport <- -- packageImport <-
> -- clientDependency <-
> -- nestedClassifier <- -- ownedOperation <-
> ownedAttribute <-
> jClassDeclaration.bodyDeclarations->select(e |
> e.oclIsKindOf(JAVA!FieldDeclaration))
> -- ownedConnector <- -- ownedPort <-
> -- generalization <-
> -- general <-
> -- interfaceRealization <-
> -- superClass <- jClassDeclaration.superClass.type
> -- _ <- jClassDeclaration.superInterfaces
> )
> }
>
> But I always get the warning "Cannot set feature ownedAttribute to
> value ... containment references cannot span across models."
>
> I don't know whats the Problem with that transformation. In an other
> transformation I do it that way: packagedElement <-
> jPackage.ownedElements and that works fine.
>
>
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03776 seconds