Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » one element to multiple transformation
one element to multiple transformation [message #1723964] Fri, 19 February 2016 09:57 Go to next message
Lujain AlDakheel is currently offline Lujain AlDakheelFriend
Messages: 7
Registered: December 2015
Junior Member
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 09:27 Go to previous message
Zheng Cheng is currently offline Zheng ChengFriend
Messages: 15
Registered: February 2012
Junior Member
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 09:28]

Report message to a moderator

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


Current Time: Thu Apr 25 05:49:35 GMT 2024

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

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

Back to the top