Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] UML Component with stereotypes issue
[ATL] UML Component with stereotypes issue [message #651258] Fri, 28 January 2011 15:27 Go to next message
nicholas pacini is currently offline nicholas paciniFriend
Messages: 31
Registered: December 2010
Member
hello all,

i was wondering if anyone here could help me with this problem i'm having using ATL:

i'm writing a transformation from an UML Profile to another metamodel. Whenever i found an UML Component in the source metamodel with a particular Stereotype applied, i have to transform it in an element of the target mm. Then i have to set some attributes of this element with values from the properties of the Stereotype.
I used "getAppliedStereotypes()" to check if the Stereotype is applied to the Component and it works To read the value of the properties i wanted to use "getValue(...)", but when i try to run the transformation a i get an error saying that the operation is not found which is strange because Component should inherit it from Element.

Have you got any piece if advice? i'm pretty new to ATL so any help wold be welcomed.

Thanks,
Nicholas

BTW, here's a piece of the transformation:
module chess2dim;
create OUT : DependabilityintermediateModel from IN : UML2;

...

rule StatefulHardware2DIMComponent {
	from
		sfh : UML2!Component (sfh.getAppliedStereotypes()-> exists(e| e.name = 'StatefulHardware'))
	to
		c : DependabilityintermediateModel!Component (
			Name <- sfh.name,
			intermediateModel <- UML2!Model.allInstances()->first(),
			Faults <- ft,
			Errors <- e
		),
		
		fo : DependabilityintermediateModel!Exponential(
			Rate <- sfh.getValue(sfh.getAppliedStereotype('CHESS-ML::StatefulHardware'), 'faultOcc')
		)...,


...and this is the exception i get:
org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found: IN!ComponentA.getValue(org.eclipse.m2m.atl.engine.emfvm.lib.OclUndefined,java.lang.String)
	at __applyStatefulHardware2DIMComponent#63(chess2dim.atl[24:12-24:92])
		local variables: self=chess2dim : ASMModule, link=TransientLink {rule = StatefulHardware2DIMComponent, sourceElements = {sfh = org.eclipse.uml2.uml.internal.impl.ComponentImpl@1946e0c (name: ComponentA, visibility: <unset>) (isLeaf: false, isAbstract: false) (isActive: false) (isIndirectlyInstantiated: true)}, targetElements = {e = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@142708b (eClass: org.eclipse.emf.ecore.impl.EClassImpl@13d8d75 (name: Error) (instanceClassName: null) (abstract: false, interface: false)), el = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@ead518 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@15a4590 (name: Exponential) (instanceClassName: null) (abstract: false, interface: false)), c = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@14c4636 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@1a079fe (name: Component) (instanceClassName: null) (abstract: false, interface: false)), fge = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@9585f1 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@115142a (name: FaultsGenerateErrors) (instanceClassName: null) (abstract: false, interface: false)), ft = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@8cbb92 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@26bab (name: InternalFault) (instanceClassName: null) (abstract: false, interface: false)), fo = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@16e9aa2 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@15a4590 (name: Exponential) (instanceClassName: null) (abstract: false, interface: false))}, variables = {}}, sfh=IN!ComponentA, c=OUT!<unnamed>, fo=OUT!<unnamed>, el=OUT!<unnamed>, ft=OUT!<unnamed>, e=OUT!<unnamed>, fge=OUT!<unnamed>
	at __exec__#18(chess2dim.atl)
		local variables: self=chess2dim : ASMModule, e=TransientLink {rule = StatefulHardware2DIMComponent, sourceElements = {sfh = org.eclipse.uml2.uml.internal.impl.ComponentImpl@1946e0c (name: ComponentA, visibility: <unset>) (isLeaf: false, isAbstract: false) (isActive: false) (isIndirectlyInstantiated: true)}, targetElements = {e = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@142708b (eClass: org.eclipse.emf.ecore.impl.EClassImpl@13d8d75 (name: Error) (instanceClassName: null) (abstract: false, interface: false)), el = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@ead518 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@15a4590 (name: Exponential) (instanceClassName: null) (abstract: false, interface: false)), c = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@14c4636 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@1a079fe (name: Component) (instanceClassName: null) (abstract: false, interface: false)), fge = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@9585f1 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@115142a (name: FaultsGenerateErrors) (instanceClassName: null) (abstract: false, interface: false)), ft = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@8cbb92 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@26bab (name: InternalFault) (instanceClassName: null) (abstract: false, interface: false)), fo = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@16e9aa2 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@15a4590 (name: Exponential) (instanceClassName: null) (abstract: false, interface: false))}, variables = {}}
	at main#24(chess2dim.atl)
		local variables: self=chess2dim : ASMModule

[Updated on: Mon, 31 January 2011 11:37]

Report message to a moderator

Re: [ATL] UML Component with stereotypes issue [message #651665 is a reply to message #651258] Tue, 01 February 2011 08:00 Go to previous message
nicholas pacini is currently offline nicholas paciniFriend
Messages: 31
Registered: December 2010
Member
nevermind, i managed to find a workaround that seems ok. I replaced this operation:

sfh.getAppliedStereotype('CHESS-ML::StatefulHardware')

with this one:

sfh.getAppliedStereotypes()->select(g|g.name = 'StatefulHardware')->first())
Previous Topic:GetAppliedStereotypes for Class in UML using ATL
Next Topic:[QVTo] Content assist and truncating file
Goto Forum:
  


Current Time: Sun Jun 16 10:55:03 GMT 2019

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

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

Back to the top