Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » EMFTVM: Problem using EDataType objects as parameter of lazy rules
EMFTVM: Problem using EDataType objects as parameter of lazy rules [message #1038834] Thu, 11 April 2013 11:59 Go to next message
EtienneB Mising name is currently offline EtienneB Mising name
Messages: 35
Registered: June 2011
Member
Dear all,

I am migrating from ATL "standard VM and compiler" to ATL with the EMFTVM VM and compiler.

In my atl code, I have lazy rules that use objects of metaclass EDataType as parameters. For instance:

lazy rule PropertyAssociationRule {
	from
		p : AADLI!PropertyAssociation,
		referencesOnly:Boolean
...


When running a transformation that invokes this lazy rule, I get the following exception:

java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EDataTypeImpl cannot be cast to org.eclipse.emf.ecore.EClass
	at org.eclipse.m2m.atl.emftvm.impl.InputRuleElementImpl.createIterable(InputRuleElementImpl.java:177)


Basically, the reason is that my second parameter (referencesOnly) is not of metaclass EClass but EDataType. Maybe this problem is already addressed but google did not give me much hint after a first try.

I guess that a rapid fix would be to replace the cast to EClass by a cast to EClassifier.

Let me know how if there is an existing release fixing the problem, and how I can get it.

Best regards,
Etienne.
Re: EMFTVM: Problem using EDataType objects as parameter of lazy rules [message #1038846 is a reply to message #1038834] Thu, 11 April 2013 12:18 Go to previous messageGo to next message
EtienneB Mising name is currently offline EtienneB Mising name
Messages: 35
Registered: June 2011
Member
To be more complete about the topic, I was using the version 3.3 of EMFTVM. I also tried with version 3.4 freshly updated from the following update site:

http://soft.vub.ac.be/eclipse/update-3.7/

but the problem is the same.
Etienne.
Re: EMFTVM: Problem using EDataType objects as parameter of lazy rules [message #1039131 is a reply to message #1038846] Thu, 11 April 2013 19:58 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

Using primitive data types for rule elements is (currently) not supported in
EMFTVM. It is technically quite possible to add this feature, but there's more
to it than one simple ClassCastException; the trace metamodel is also not
prepared for it. You can file a bug for this if you like.

As a workaround for your specific situation, you can split the lazy rule in
two (booleans only have two possible values), and factor out the common part
in a super-rule using rule inheritance.

Kind regards,
Dennis


Cheers,
Dennis
Re: EMFTVM: Problem using EDataType objects as parameter of lazy rules [message #1039646 is a reply to message #1039131] Fri, 12 April 2013 11:54 Go to previous messageGo to next message
EtienneB Mising name is currently offline EtienneB Mising name
Messages: 35
Registered: June 2011
Member
Thanks Dennis,

a more systematic workaround is to use "atl called rules", however I am not yet familiar enough with EMFTVM to know if this change (lazy rule --> called rule) has other impacts in terms of execution semantics.

Besides it is interesting to use rules inheritence as you propose since it is a strong contribution of EMFTVM.

I am porting a lot of code from atl to EMFTVM and I am experiencing several important differences.

I will probably create a new thread for discussing these issues, specially since I beleive the new features of EMFTVM are worth making the effort.
Etienne.

[Updated on: Fri, 12 April 2013 12:01]

Report message to a moderator

Re: EMFTVM: Problem using EDataType objects as parameter of lazy rules [message #1042703 is a reply to message #1039646] Tue, 16 April 2013 19:27 Go to previous message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

This issue is now tracked in bugzilla:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=405641

Dennis


Cheers,
Dennis
Previous Topic:Generate Multiple Elements
Next Topic:No one knows how to solve this problem ?
Goto Forum:
  


Current Time: Wed Oct 22 22:38:39 GMT 2014

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

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