Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » simple rules transformation problem(Transformation problem)
simple rules transformation problem [message #1689579] Mon, 23 March 2015 21:53 Go to next message
FSM ISFSM is currently offline FSM ISFSMFriend
Messages: 21
Registered: March 2015
Junior Member
Hello everybody,

I'm working on some issues I'm meeting trying to make transformation rules from MetaSysml to MetaAcme.

Here are 2 very simple rules:

rule Bddiagram2Family {
	from  fam: MetaSysml!BDDiagram
	to  
	     t : MetaAcme!Family (  name        <- fam.name
)}

rule   Bddiagram2System {
	from sys: MetaSysml!BDDiagram 
	to  
	     t : MetaAcme!System ( 
		  name     <- 'System' ,
		 family   <- s.extend
)}


The problem is that I get this error when executed:

org.eclipse.m2m.atl.engine.emfvm.VMException: Trying to register several rules as default for element org.eclipse.emf.ecore.impl.DynamicEObjectImpl@9fff91 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@68160c (name: BDDiagram) (instanceClassName: null) (abstract: false, interface: false)) : Bddiagram2Family and Bddiagram2System

Do I need to modify the metamodel? or maybe some other solutions exists...

Thank you very much.
Re: simple rules transformation problem [message #1690090 is a reply to message #1689579] Wed, 25 March 2015 08:22 Go to previous message
Alexander R is currently offline Alexander RFriend
Messages: 211
Registered: July 2013
Senior Member
Hi,

the problem is that both matched rules [Bddiagram2Family / Bddiagram2System], are called for (every) input-element with type MetaSysml!BDDiagram in your input model!
The easiest way to solve it, is to use some guards on the input-elements.

Just look at the following example:

https://www.eclipse.org/atl/documentation/basicExamples_Patterns/article.php?file=Tree2List/index.html

With a guard on a matched rule, you can specify an OCL-Condition that each element have to comply.

Hope this helps,

~Alex
Previous Topic: rules transformation problem
Next Topic:Bug (?) in Inheritance-hierarchy of matched rules
Goto Forum:
  


Current Time: Thu Apr 25 12:59:39 GMT 2024

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

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

Back to the top