Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Migration from ATL to EMFTVM
Migration from ATL to EMFTVM [message #1039708] Fri, 12 April 2013 13:40 Go to next message
EtienneB Mising name is currently offline EtienneB Mising name
Messages: 35
Registered: June 2011
Member
Dear all,

I am migrating quite a lot of code from ATL to EMFTVM. I thought the modification would be quite straight forward but I experienced several differences. Is there some documentation about the differences; or some guidelines on how to do this kind of migration?

For instance, a difference is that in atl, the any() operator returns OclUndefined if no object is found; while emftvm thows an exception in that case. Another important difference is that atl allows to initialize a local variable to OclUndefined and then to give avalue to this variable in the do section; while EMFTVM does not allow this.

Some how the question is: what are the constructs of atl that should be avoided when using EMFTVM?

Thanks,
Etienne.
Re: Migration from ATL to EMFTVM [message #1041075 is a reply to message #1039708] Sun, 14 April 2013 15:23 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

Op 12-04-13 15:40, EtienneB Mising name schreef:
> For instance, a difference is that in atl, the any() operator returns
> OclUndefined if no object is found; while emftvm thows an exception in that
> case. Another important difference is that atl allows to initialize a local
> variable to OclUndefined and then to give avalue to this variable in the do
> section; while EMFTVM does not allow this.

EMFTVM includes a re-implementation of the OCL standard library, this time
based on OCL 2.2 instead of OCL 2.0. OCL 2.2 introduces OclVoid and OclInvalid
as a replacement for OclUndefined. As ATL syntax uses OclUndefined, I decided
to use the following mapping:

OclVoid -> OclUndefined (null in Java)
OclInvalid -> throw exception (fail fast principle)

OCL specifies the semantics of any() as select()->first() for Sequence. I
interpreted the outcome of first() on an empty Sequence to be OclInvalid,
hence exception. This is also compatible with the way Java treats collections.

That said, transforming empty collections to OclUndefined and vice versa is a
very common scenario in ATL, so this should be easy to do. Also, Java
collections cannot contain null values, so there is no ambiguity in returning
OclUndefined on Sequence::first().

Anyone else like to comment on this?

Dennis


Cheers,
Dennis
Re: Migration from ATL to EMFTVM [message #1041909 is a reply to message #1041075] Mon, 15 April 2013 18:50 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

XText OCL console gives:

Evaluating:
self.eStructuralFeatures->select(e|false)->first()
Results:
Evaluation failure
Empty 'OrderedSet' for 'first'

Evaluating:
self.eStructuralFeatures->any(e|false)
Results:
null

OCL console gives:

Evaluating:
self.eStructuralFeatures->select(e|false)->first()
Results:
OclInvalid

Evaluating:
self.eStructuralFeatures->any(e|false)
Results:


I suppose that settles it: any() will return OclUndefined on an empty
collection. It's the pragmatic thing to do, and it coincides with current ATL
behaviour, as well as Eclipse OCL behaviour.

Dennis


Cheers,
Dennis
Re: Migration from ATL to EMFTVM [message #1041969 is a reply to message #1041909] Mon, 15 April 2013 20:49 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4098
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi<br>
<br>
There is no OclUndefined.<br>
<br>
This is OMG Issue 18504.<br>
<br>
The OCL specification is superficially ambiguous.<br>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=UTF-8">
<p style="font-weight: normal"><font size="2">The 'equivalent' OCL
of</font></p>
<p style="margin-top: 0.2cm; page-break-before: auto" align="LEFT"
lang="en-US">
<font face="Courier New, monospace"><font size="2">source-&gt;select(iterator
|
body)-&gt;asSequence()-&gt;first()</font></font></p>
<p style="font-weight: normal"><font size="2">returns invalid if no
elements are selected, rather than null as the words say.</font></p>
<p style="font-weight: normal"><font size="2">As identified in Issue
18125, null could also be a valid value, so the words are
clearly
wrong.</font></p>
<title></title>
<meta name="GENERATOR" content="LibreOffice 4.0.0.3 (Windows)">
<style type="text/css">
<!--
@page { size: 21cm 29.7cm; margin: 2cm }
P { margin-top: 0.42cm; margin-bottom: 0cm; text-align: left }
P.western { font-family: "Arial", sans-serif; font-size: 12pt }
P.cjk { font-size: 12pt }
A:visited { color: #800080; text-decoration: underline }
A:link { color: #0000ff; text-decoration: underline }
-->
</style><br>
Eclipse OCL is changing. The Pivot binding has no legacy and so can
just change.<br>
The Ecore binding can be corrected by a new preference option.<br>
<br>
    Regards<br>
<br>
        Ed Willink<br>
<br>
On 15/04/2013 19:50, Dennis Wagelaar wrote:
<blockquote cite="mid:kkhi5e$e1a$1@xxxxxxxxe.org" type="cite">
<pre wrap="">I suppose that settles it: any() will return OclUndefined on an empty
collection. It's the pragmatic thing to do, and it coincides with current ATL
behaviour, as well as Eclipse OCL behaviour.

Dennis
</pre>
</blockquote>
<br>
</body>
</html>
Re: Migration from ATL to EMFTVM [message #1042635 is a reply to message #1041969] Tue, 16 April 2013 17:32 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

Op 15-04-13 22:49, Ed Willink schreef:
> Hi
>
> There is no OclUndefined.

Not anymore, but ATL's syntax is still based on OCL 2.0.

>
> This is OMG Issue 18504.
>
> The OCL specification is superficially ambiguous.
>
> The 'equivalent' OCL of
>
> source->select(iterator | body)->asSequence()->first()
>
> returns invalid if no elements are selected, rather than null as the words say.
>
> As identified in Issue 18125, null could also be a valid value, so the words
> are clearly wrong.
>
>
> Eclipse OCL is changing. The Pivot binding has no legacy and so can just change.
> The Ecore binding can be corrected by a new preference option.
>
> Regards
>
> Ed Willink
>

Thanks for the update! We'll have to track this issue, and see how it is
resolved then.

Dennis


Cheers,
Dennis
Re: Migration from ATL to EMFTVM [message #1042702 is a reply to message #1042635] Tue, 16 April 2013 19:26 Go to previous messageGo to next 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=405820

Dennis


Cheers,
Dennis
Re: Migration from ATL to EMFTVM [message #1050628 is a reply to message #1042702] Sat, 27 April 2013 13:39 Go to previous messageGo to next message
EtienneB Mising name is currently offline EtienneB Mising name
Messages: 35
Registered: June 2011
Member
Dear all,

Continuing the migration, I experienced another important difference: this has to do with adding elements to a list of the output model.

I filed a bug for this, which was not really a bug but maybe something more difficult to deal with on my end.
Here is a reference to the bug I initially posted:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=406100

after trying a lot to have this working, I am still quite puzzled by the answer.

Here is basically my need.

I have an element of class C that contains an attribute ATTR and list L. I am not using the refining mode however my input and output metamodels are the same. When I match an element c of type C, I want to copy the list from c in a list of c' (image of c). This is easy, and I do it in a matched rule. Now, when I match the attribute ATTR of c in another matched rule, I want to add an element in the image of L, produced by the previous rule.

Usinf the ATL runtime, I would basically write something like this: c'.L.add(...); in a "do" section. To be precise, c' can be retreived in this second rule using the resolveTemp operation.

However the 'add' operation is not supported by EMFTVM. Trying to use attribute helpers make the code very difficult to write, read, understand and debug...

So, I am asking for some advice to add elements to a list in different rules? Could rules inheritence be of any help here?

I could basically create c' and L' in a rule R1 and add elements to L' in a rule R2 that matches L and inherits from R1. Would that be how you would proceed? If so, my problem is that I have L defined in a resource res1 and c defined in another resource res2 that reference res1. As I only pass res1 as an input resource, my matched rules will thus only apply to elements from the resource res1 and L will not be matched. Thus R1 would be a matched rule and R2 a lazy rule... And I cannot use inheritence.

Finally, another option is to add res2 as an input of the model transformation. Then my question is: can I have an unknown number of input resources? I basically take resources from a set of file that varies, this set being provided by the users of my tool...

I am quite lost now: I think EMFTVM provides really nice features (specially for rules inheritence and traces mechanisms) but to my opinion it either needs an "add()" operation for lists of the output models, or a way to give a list of input models without enumerating each of them in advance.

What do you think? I hope I have been clear in enumerating the different problems/solutions; don't hesitate to ask if it is not the case.
Thanks in advance for your answer and best regards,
Etienne.

Re: Migration from ATL to EMFTVM [message #1050771 is a reply to message #1050628] Sat, 27 April 2013 18:45 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

Op 27/04/13 15:39, EtienneB Mising name schreef:
> So, I am asking for some advice to add elements to a list in different rules?
> Could rules inheritence be of any help here?

You should normally try to collect all elements you want to assign to the list
reference in the same rule as where you create the element that owns the list
reference:

rule ... {
from ...
to t : MM!C (
list <- MM!Child.allInstances()->select(c | ...)->union(...)
)
}

>
> I could basically create c' and L' in a rule R1 and add elements to L' in a
> rule R2 that matches L and inherits from R1. Would that be how you would
> proceed? If so, my problem is that I have L defined in a resource res1 and c
> defined in another resource res2 that reference res1. As I only pass res1 as
> an input resource, my matched rules will thus only apply to elements from the
> resource res1 and L will not be matched. Thus R1 would be a matched rule and
> R2 a lazy rule... And I cannot use inheritence.

You can indeed not mix rule types in rule inheritance.

>
> Finally, another option is to add res2 as an input of the model
> transformation. Then my question is: can I have an unknown number of input
> resources? I basically take resources from a set of file that varies, this set
> being provided by the users of my tool...

You can add many unknown models to your run config, and you can use their
contents in matched rules, as long as you don't require those rules to match
on specific input models. So like this:

rule ... {
from s : MM!Class
to ...
}

....and not like this:

rule ... {
from s : MM!Class in IN
to ...
}

NOTE that this doesn't work in the other ATL VMs, as the compiler always
compiles in a filter on a specific input model. This was done to work around
the issue that the other ATL VMs could otherwise match metamodel elements in
addition to input model elements. EMFTVM does not require this workaround, and
can match over all input (and in/out) models in general.

>
> I am quite lost now: I think EMFTVM provides really nice features (specially
> for rules inheritence and traces mechanisms) but to my opinion it either needs
> an "add()" operation for lists of the output models, or a way to give a list
> of input models without enumerating each of them in advance.

You could perhaps use the trace model to collect the elements created by your
various rules, and use that to assign to your reference list. That way you
don't even have to come up with a complex expression to collect the elements.

>
> What do you think? I hope I have been clear in enumerating the different
> problems/solutions; don't hesitate to ask if it is not the case.
> Thanks in advance for your answer and best regards,
> Etienne.
>
>

I've given some ideas to write your transformation in an alternative way. It
will generally be much easier to get ATL/EMFTVM to do what you want using
declarative/functional style programming and matched or lazy rules. In
addition, you can use reflection on the trace model.

Hope this helps!
Dennis


Cheers,
Dennis
Re: Migration from ATL to EMFTVM [message #1053439 is a reply to message #1050771] Sun, 05 May 2013 20:47 Go to previous messageGo to next message
EtienneB Mising name is currently offline EtienneB Mising name
Messages: 35
Registered: June 2011
Member
Hi Dennis,

yes, the information you provided really helped! Out of the different improvement provided by EMFTVM, this one (matching every input resource) would have been put first in my motivations for the migration! ... This is just great!

Thanks a lot,
Etienne.
Migration from ATL to EMFTVM [message #1219497 is a reply to message #1039708] Wed, 04 December 2013 09:24 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Hello,

I'm trying to migrate from ATL to EMFTVM but I have some issues with TupleType. I have several unique lazy rule where the element from is a Tuple, because the generation of an unique element depends of several constrains that are represents in the differents tuple values. That rules work properly with ATL but when I migrate to EMFTVM I get the error:
org.eclipse.m2m.atl.emftvm.util.VMException: java.lang.NoSuchFieldException: Field org.eclipse.m2m.atl.emftvm.util.Tuple::beanName not found


The rule is this:
unique lazy rule presentationObject { 
	from
		beanNameAndContainer : Type(beanName : String, objectContainer : mmMIGRARIAMVC!ObjectRequestContainer)
	to 
		presentationObject : mmMIGRARIAMVC!PresentationObject (
			name <- beanNameAndContainer.beanName,
			container <- (beanNameAndContainer.objectContainer),				
		)
}


Best regards,
Víctor Pavón.


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: Migration from ATL to EMFTVM [message #1219504 is a reply to message #1219497] Wed, 04 December 2013 10:26 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 523
Registered: July 2009
Senior Member
Can't you use multiple from elements instead ?
Re: Migration from ATL to EMFTVM [message #1219517 is a reply to message #1219504] Wed, 04 December 2013 11:43 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Hello Sylvain,

I can't use multiple elements because I need that for each different value of the pair of element generate a new element. If I use multiple element ATL only consider the firstone to run the unique lazy rule, and I get less elements that I want.

Thank you.


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: Migration from ATL to EMFTVM [message #1219534 is a reply to message #1219517] Wed, 04 December 2013 13:15 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARD
Messages: 523
Registered: July 2009
Senior Member
There's a workaround for that.
You can compute a "unique" string and use that as the first element in the lazy rule even if you don't use it in the rule itself
Re: Migration from ATL to EMFTVM [message #1219561 is a reply to message #1219517] Wed, 04 December 2013 16:04 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

Victor Pavon wrote on Wed, 04 December 2013 12:43
Hello Sylvain,

I can't use multiple elements because I need that for each different value of the pair of element generate a new element. If I use multiple element ATL only consider the firstone to run the unique lazy rule, and I get less elements that I want.

Thank you.

Hmm, this should work with ATL/EMFTVM. Can you try it?


Cheers,
Dennis
Re: Migration from ATL to EMFTVM [message #1219562 is a reply to message #1219497] Wed, 04 December 2013 16:20 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

Victor Pavon wrote on Wed, 04 December 2013 10:24
Hello,

I'm trying to migrate from ATL to EMFTVM but I have some issues with TupleType. I have several unique lazy rule where the element from is a Tuple, because the generation of an unique element depends of several constrains that are represents in the differents tuple values. That rules work properly with ATL but when I migrate to EMFTVM I get the error:
org.eclipse.m2m.atl.emftvm.util.VMException: java.lang.NoSuchFieldException: Field org.eclipse.m2m.atl.emftvm.util.Tuple::beanName not found


The rule is this:
unique lazy rule presentationObject { 
	from
		beanNameAndContainer : Type(beanName : String, objectContainer : mmMIGRARIAMVC!ObjectRequestContainer)
	to 
		presentationObject : mmMIGRARIAMVC!PresentationObject (
			name <- beanNameAndContainer.beanName,
			container <- (beanNameAndContainer.objectContainer),				
		)
}


That's a bug in EMFTVM: you may report it in bugzilla.


Cheers,
Dennis
Re: Migration from ATL to EMFTVM [message #1219565 is a reply to message #1219562] Wed, 04 December 2013 16:38 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

Dennis Wagelaar wrote on Wed, 04 December 2013 17:20
Victor Pavon wrote on Wed, 04 December 2013 10:24
Hello,

I'm trying to migrate from ATL to EMFTVM but I have some issues with TupleType. I have several unique lazy rule where the element from is a Tuple, because the generation of an unique element depends of several constrains that are represents in the differents tuple values. That rules work properly with ATL but when I migrate to EMFTVM I get the error:
org.eclipse.m2m.atl.emftvm.util.VMException: java.lang.NoSuchFieldException: Field org.eclipse.m2m.atl.emftvm.util.Tuple::beanName not found


The rule is this:
unique lazy rule presentationObject { 
	from
		beanNameAndContainer : Type(beanName : String, objectContainer : mmMIGRARIAMVC!ObjectRequestContainer)
	to 
		presentationObject : mmMIGRARIAMVC!PresentationObject (
			name <- beanNameAndContainer.beanName,
			container <- (beanNameAndContainer.objectContainer),				
		)
}


That's a bug in EMFTVM: you may report it in bugzilla.


You may work around this bug by accessing the tuple entry using the "get" operation:

beanNameAndContainer.get ('beanName')


Cheers,
Dennis
Re: Migration from ATL to EMFTVM [message #1219646 is a reply to message #1219565] Thu, 05 December 2013 08:09 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Dennis Wagelaar wrote on Wed, 04 December 2013 17:38
Dennis Wagelaar wrote on Wed, 04 December 2013 17:20
Victor Pavon wrote on Wed, 04 December 2013 10:24
Hello,

I'm trying to migrate from ATL to EMFTVM but I have some issues with TupleType. I have several unique lazy rule where the element from is a Tuple, because the generation of an unique element depends of several constrains that are represents in the differents tuple values. That rules work properly with ATL but when I migrate to EMFTVM I get the error:
org.eclipse.m2m.atl.emftvm.util.VMException: java.lang.NoSuchFieldException: Field org.eclipse.m2m.atl.emftvm.util.Tuple::beanName not found


The rule is this:
unique lazy rule presentationObject { 
	from
		beanNameAndContainer : Type(beanName : String, objectContainer : mmMIGRARIAMVC!ObjectRequestContainer)
	to 
		presentationObject : mmMIGRARIAMVC!PresentationObject (
			name <- beanNameAndContainer.beanName,
			container <- (beanNameAndContainer.objectContainer),				
		)
}


That's a bug in EMFTVM: you may report it in bugzilla.


You may work around this bug by accessing the tuple entry using the "get" operation:

beanNameAndContainer.get ('beanName')


Thank you Dennis, it works properly


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.

[Updated on: Thu, 05 December 2013 08:09]

Report message to a moderator

Re: Migration from ATL to EMFTVM [message #1219647 is a reply to message #1219646] Thu, 05 December 2013 08:13 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Know I found another problem. When I have a rule with multiple to elements and I reference someone in other I get the error:
org.eclipse.m2m.atl.emftvm.util.VMException: java.lang.IllegalArgumentException: Cannot assign MIGRARIA_MVC.View.impl.ObjectPresentationCollectionImpl@1e3fc30 (name: subjects) (paginated: false, orderCriteria: null, multiSelection: false) to multi-valued field DataSet_PA::items
at rule presentationObjectAndPresentationCollectionCase2b@applier#50(platform:/resource//migraria.m2m.strutsJSP2MIGRARIAMVC_View/transformations/strutsJPS2MIGRARIAMVCview.atl#[228:5-228:36])
	Local variables: [__trace__: TRACE!TraceLink = c1c9d3:TRACE!TraceLink, logicIterate: mmStrutsJSP!JSPActionStrutsLogicIterate = logic:iterate:mmStrutsJSP!JSPActionStrutsLogicIterate, presentationCollection: mmMIGRARIAMVC!ObjectPresentationCollection = subjects:mmMIGRARIAMVC!ObjectPresentationCollection, presentationAttributeParentObjet: mmMIGRARIAMVC!DataSet_PA = subjects:mmMIGRARIAMVC!DataSet_PA]
at static EMFTVM!ExecEnv::main() : Object(platform:/resource//migraria.m2m.strutsJSP2MIGRARIAMVC_View/transformations/strutsJPS2MIGRARIAMVCview.atl)
	Local variables: []


This is an excerpt of the rule:
	rule presentationObjectAndPresentationCollectionCase2b {
		from
			logicIterate : mmStrutsJSP!JSPActionStrutsLogicIterate 
		to
			presentationCollection : mmMIGRARIAMVC!ObjectPresentationCollection (
				...
			),
			presentationAttributeParentObjet : mmMIGRARIAMVC!DataSet_PA (
				...
				items <- presentationCollection				
				...
			)		 
	}


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: Migration from ATL to EMFTVM [message #1219661 is a reply to message #1219647] Thu, 05 December 2013 10:31 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

Apparently, "items" is a collection attribute. Regular ATL is forgiving on this, and just adds your valua to the collection. EMFTVM requires that you assign the correct type:

items <- Sequence{presentationCollection}


Cheers,
Dennis
Re: Migration from ATL to EMFTVM [message #1219702 is a reply to message #1219661] Thu, 05 December 2013 13:23 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Dennis Wagelaar wrote on Thu, 05 December 2013 11:31
Apparently, "items" is a collection attribute. Regular ATL is forgiving on this, and just adds your valua to the collection. EMFTVM requires that you assign the correct type:

items <- Sequence{presentationCollection}


Thank you, solve problem.

When I finish the migration, I'll post all the changes that I have to do to adapt the rules.


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: Migration from ATL to EMFTVM [message #1219703 is a reply to message #1219702] Thu, 05 December 2013 13:25 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Other problem that I found is for example in helpers that return an EenumType I get the error (DirectionalTypes is the EenumType name):
Quote:
org.eclipse.m2m.atl.emftvm.util.VMException: Error during module loading: Type DirectionalTypes not found in metamodel org.eclipse.m2m.atl.emftvm.impl.MetamodelImpl@1f6013a (resource: migraria.mvc)


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: Migration from ATL to EMFTVM [message #1219717 is a reply to message #1219703] Thu, 05 December 2013 14:48 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

Victor Pavon wrote on Thu, 05 December 2013 14:25
Other problem that I found is for example in helpers that return an EenumType I get the error (DirectionalTypes is the EenumType name):
Quote:
org.eclipse.m2m.atl.emftvm.util.VMException: Error during module loading: Type DirectionalTypes not found in metamodel org.eclipse.m2m.atl.emftvm.impl.MetamodelImpl@1f6013a (resource: migraria.mvc)


EMFTVM currently only supports EClass instances as parameter/return types. Using "OclAny" will solve your issue for now. However, we should look into supporting all EClassifier instances as type declarations within EMFTVM. You may report this as a bug, so I will remember to look into it Wink.


Cheers,
Dennis
Re: Migration from ATL to EMFTVM [message #1220082 is a reply to message #1219717] Mon, 09 December 2013 14:51 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Dennis Wagelaar wrote on Thu, 05 December 2013 15:48
Victor Pavon wrote on Thu, 05 December 2013 14:25
Other problem that I found is for example in helpers that return an EenumType I get the error (DirectionalTypes is the EenumType name):
Quote:
org.eclipse.m2m.atl.emftvm.util.VMException: Error during module loading: Type DirectionalTypes not found in metamodel org.eclipse.m2m.atl.emftvm.impl.MetamodelImpl@1f6013a (resource: migraria.mvc)


EMFTVM currently only supports EClass instances as parameter/return types. Using "OclAny" will solve your issue for now. However, we should look into supporting all EClassifier instances as type declarations within EMFTVM. You may report this as a bug, so I will remember to look into it Wink.


Thank you, problem solved Wink


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: Migration from ATL to EMFTVM [message #1220210 is a reply to message #1220082] Tue, 10 December 2013 11:55 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Hello,

After execute full ATL rule without errors after adaptation from ATL. When I open the trace model I get an error like:
org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'iDataSet_PA:null -> []' is not legal. (platform:/resource/migraria.m2m.strutsJSP2MIGRARIAMVC_View/mTarget/crs/trace.xmi, 22073, 5681)


The element iDataSet_PA is an unique lazy rule.

Best regards, Víctor.


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: Migration from ATL to EMFTVM [message #1220249 is a reply to message #1220210] Tue, 10 December 2013 15:49 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

I can't tell why your trace model cannot be read back. Can you upload your zipped project somewhere (e.g. Google Drive)?

Cheers,
Dennis
Re: Migration from ATL to EMFTVM [message #1222509 is a reply to message #1220249] Fri, 20 December 2013 16:17 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Dennis Wagelaar wrote on Tue, 10 December 2013 16:49
I can't tell why your trace model cannot be read back. Can you upload your zipped project somewhere (e.g. Google Drive)?


Hello Dennis,

Thank you for your help. Finally I found the problem. The problem was that I used an element of tuple type in the from clause. I change this for several from elements and now it works properly.

Best regards, Víctor.


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: Migration from ATL to EMFTVM [message #1222532 is a reply to message #1222509] Fri, 20 December 2013 17:38 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Hello Dennis,

about the operation toSequence(), isn't it supported in EMFTVM?

Best regards, Víctor.


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: Migration from ATL to EMFTVM [message #1223251 is a reply to message #1222532] Sun, 22 December 2013 22:43 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

op 20-12-13 18:38, Victor Pavon schreef:
> Hello Dennis,
>
> about the operation toSequence(), isn't it supported in EMFTVM?
>
> Best regards, Víctor.

String::toSequence() is indeed not (yet) supported; it's not part of the OCL
2.2 spec, but is an ATL addition. You can implement it as follows, however:

helper context String def : toSequence() : Sequence(String) =
Sequence{}
->includingRange(0, self.size() - 1)
->collect(i | self.charAt(i).toString());

Cheers,
Dennis


Cheers,
Dennis
Re: Migration from ATL to EMFTVM [message #1228958 is a reply to message #1223251] Wed, 08 January 2014 12:20 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Thank you very much, Dennis.

Dennis Wagelaar wrote on Sun, 22 December 2013 23:43
op 20-12-13 18:38, Victor Pavon schreef:
> Hello Dennis,
>
> about the operation toSequence(), isn't it supported in EMFTVM?
>
> Best regards, Víctor.

String::toSequence() is indeed not (yet) supported; it's not part of the OCL
2.2 spec, but is an ATL addition. You can implement it as follows, however:

helper context String def : toSequence() : Sequence(String) =
Sequence{}
->includingRange(0, self.size() - 1)
->collect(i | self.charAt(i).toString());

Cheers,
Dennis



Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: Migration from ATL to EMFTVM [message #1384823 is a reply to message #1228958] Mon, 02 June 2014 11:15 Go to previous messageGo to next message
Victor Pavon is currently offline Victor Pavon
Messages: 49
Registered: April 2012
Location: Spain
Member
Hello,

I still migrating some transformations to EMFTVM, and I have problems with regexReplaceAll operation. It is supported by EMFTVM?

Best Regards,
Víctor.


Víctor Pavón,
Research at Quercus Software Engineering Group
University of Extremadura, Spain.
Re: Migration from ATL to EMFTVM [message #1384919 is a reply to message #1384823] Tue, 03 June 2014 07:13 Go to previous message
Dennis Wagelaar is currently offline Dennis Wagelaar
Messages: 166
Registered: September 2012
Senior Member

EMFTVM exposes the underlying Java API, instead of ATL's renamed "replace*" operations:

http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#replaceAll(java.lang.String, java.lang.String)
http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#replace(java.lang.CharSequence, java.lang.CharSequence)

So: regexReplaceAll() becomes replaceAll() and replaceAll() becomes replace()


Cheers,
Dennis
Previous Topic:AM3 installation for ATL Version 3.x
Next Topic:[EMFTVM] Problem with inout model in ANT lauch file
Goto Forum:
  


Current Time: Sat Oct 25 23:38:19 GMT 2014

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

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