Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Feature ... is not changeable
[ATL] Feature ... is not changeable [message #788838] Thu, 02 February 2012 09:33 Go to next message
st oehm is currently offline st oehm
Messages: 79
Registered: October 2009
Member
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 #788858 is a reply to message #788838] Thu, 02 February 2012 09:52 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
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


On 02/02/2012 09:33, stoehm Mising name wrote:
> 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 #789116 is a reply to message #788858] Thu, 02 February 2012 16:12 Go to previous messageGo to next message
st oehm is currently offline st oehm
Messages: 79
Registered: October 2009
Member
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.

Re: [ATL] Feature ... is not changeable [message #789126 is a reply to message #789116] Thu, 02 February 2012 16:22 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4046
Registered: July 2009
Senior Member
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.
>
>
Re: [ATL] Feature ... is not changeable [message #789146 is a reply to message #789126] Thu, 02 February 2012 17:00 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 522
Registered: July 2009
Senior Member
are you sure you do have a rule to transform "jClassDeclaration.bodyDeclarations->select(e | e.oclIsKindOf(JAVA!FieldDeclaration))" to UML properties ?
Re: [ATL] Feature ... is not changeable [message #792075 is a reply to message #789146] Mon, 06 February 2012 15:25 Go to previous messageGo to next message
Mifaz Ke is currently offline Mifaz Ke
Messages: 3
Registered: November 2011
Junior Member
Yes, i'm sure.
Here it is. By the way thisModule.resolveTemp doesn't work either.

rule Attribute2Property {
	from
		jFieldDeclaration : JAVA!FieldDeclaration,
		jModifier : JAVA!Modifier
			(jModifier.bodyDeclaration = jFieldDeclaration)
	to
		umlProperty : UML!Property (
			name <- jFieldDeclaration.fragments->collect(e | e.name),
			visibility <- jModifier.getVisibility(),
			class <- thisModule.resolveTemp(jFieldDeclaration.abstractTypeDeclaration, 'umlClass')
--			owner <- jFieldDeclaration.abstractTypeDeclaration.refImmediateComposite()
--			class <- jFieldDeclaration.abstractTypeDeclaration.refImmediateComposite()
		)
}
Re: [ATL] Feature ... is not changeable [message #825020 is a reply to message #792075] Tue, 20 March 2012 11:07 Go to previous messageGo to next message
Guillaume Mockly is currently offline Guillaume Mockly
Messages: 3
Registered: March 2012
Junior Member
I got the same problem.
For me the cause was that in the ecore file I used, the associations were not declared as containments.
Checking "is Contaiment" in the ecore editor for your different associations should resolve the problem.
Re: [ATL] Feature ... is not changeable [message #840607 is a reply to message #788838] Tue, 10 April 2012 09:42 Go to previous messageGo to next message
st oehm is currently offline st oehm
Messages: 79
Registered: October 2009
Member
Hi again,

i solved the Problem two Month ago, and i only want to post the answer for that Problem.

The Key was the FieldDeclaration2Property-Transformation. I matched FieldDeclaration AND Modifier, and so the created Properties didn't go into the ownedAttribute because of the Modifier-Match.

Now my Rule FieldDeclaration2Property works without the Modifier-Match and the Properties are all on the place where they should be Smile

Greetings,
Stoehm

[Updated on: Tue, 10 April 2012 09:42]

Report message to a moderator

Re: [ATL] Feature ... is not changeable [message #865698 is a reply to message #840607] Mon, 30 April 2012 14:28 Go to previous message
Tex Iano is currently offline Tex Iano
Messages: 99
Registered: February 2012
Member
great, thanks! Smile
Previous Topic:[ATL] WSDL: Access name attribute
Next Topic:Regla que cree y retorne coleccion de objetos
Goto Forum:
  


Current Time: Sat Sep 20 04:09:40 GMT 2014

Powered by FUDForum. Page generated in 0.09426 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software