Skip to main content



      Home
Home » Modeling » ATL » one element to multiple transformation
one element to multiple transformation [message #1723964] Fri, 19 February 2016 04:57 Go to next message
Eclipse UserFriend
Hello,

i have a simple transformation rules where the first class in Source has a Name and transformed to a name too in the target class. its work very well.


the thing is, i have another class which has 3 attributes + 2 associations to another classes in the source model and each association should take an attribute from another class which already been transformed.

the simple rule i wrote:
rule ResCons2Token {
	from
		D: UML!ResConsumption
	to
		Token: CPN!ResConsToken (
		
				ResCons <- D.CompName+','+D.Compunit+','+D.CPUCons+','+D.MemoryCons+','+D.PowerCons)
}


CompName + Compunit are the association names, the Ekeys for them are the attributes i need them to get from Class Components, Compunits where they already transformed for a target elements.

how can i do that? how can i use the source element to multiple transformation?

the error i got while running this transformation is:
org.eclipse.m2m.atl.engine.emfvm.VMException: Trying to register several rules as default for element org.eclipse.emf.ecore.impl.DynamicEObjectImpl@3832ea3f (eClass: org.eclipse.emf.ecore.impl.EClassImpl@3acb97b7 (name: AllocateProblem) (instanceClassName: null) (abstract: false, interface: true)) : Component2Token and CompUnit2Token

Component2Token, CompUnit2Token are the 2 rules i create before and need to get their source element in my other rule.

Thanks in Advance
Re: one element to multiple transformation [message #1724191 is a reply to message #1723964] Mon, 22 February 2016 04:27 Go to previous message
Eclipse UserFriend
It looks like you have one source element can match both of these rules, which is not allowed for the ATL matching rule in default execution mode.



[Updated on: Mon, 22 February 2016 04:28] by Moderator

Previous Topic:BigDecimal conversion problem
Next Topic:Generate UML component diagrams with ATL
Goto Forum:
  


Current Time: Sun Jul 27 08:15:46 EDT 2025

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

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

Back to the top