Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] asSequence(): RegularVM vs EMF-VM
icon5.gif  [ATL] asSequence(): RegularVM vs EMF-VM [message #645538] Fri, 17 December 2010 17:42 Go to next message
Alvaro Jimenez Rielo is currently offline Alvaro Jimenez RieloFriend
Messages: 41
Registered: July 2009
Location: Rey Juan Carlos Universit...
Member
Hello,

I have this code:
self.source.asSequence()->first().oclIsUndefined()

for different Metaclasses that its 'source' attribute is 1..1 or 1..N (It depends on the metaclass). Using "asSequence()" in RegularVM, the code works for all metaclasses. But in EMF-VM, I receive this error:
org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found: IN!Member.asSequence()

because 'source' attribute in Member Metaclass is 1..1.

so, my question is: are there any possibility to convert 'source' to a collection type using EMF-VM?

Thanks for advance,
Alvaro.

[Updated on: Fri, 17 December 2010 17:43]

Report message to a moderator

Re: [ATL] asSequence(): RegularVM vs EMF-VM [message #645924 is a reply to message #645538] Tue, 21 December 2010 08:38 Go to previous messageGo to next message
Vincent MAHE is currently offline Vincent MAHEFriend
Messages: 129
Registered: July 2009
Senior Member
Le 17/12/2010 18:42, ajimenezr a écrit :
> Hello,
>
> I have this code:
> self.source.asSequence()->first().oclIsUndefined() for different
> Metaclasses that its 'source' attribute is 1..1 or 1..N (It depends on
> the metaclass). Using "asSequence()" in RegularVM, the code works for
> all metaclasses. But in EMF-VM, I receive this error:
> org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found:
> IN!Member.asSequence() because 'source' attribute in Member Metaclass is
> 1..1.
>
> so, my question is: are there any possibility to convert 'source' to a
> collection type using EMF-VM?

Some "facilities" of the old VM were more bugs than features. The recent
one is more strict so it needs to expurge old "lazy" code which was
relying on these holes in the checker.

In your case, I recommend you test the status of the 'source' attribute
in an 'if' structure, which will also document better your transformation.
--
Cordialement

Vincent MAHÉ

Ingénieur Expert - Projet IDM++ - Équipe AtlanMod
École des Mines de Nantes
La Chantrerie - 4, rue Alfred Kastler
B.P. 20722 - F-44307 NANTES Cedex 3
Tel: (33)2 51 85 81 00
Re: [ATL] asSequence(): RegularVM vs EMF-VM [message #646937 is a reply to message #645538] Mon, 03 January 2011 09:54 Go to previous message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
or you can do :

Sequence{self.source}->flatten()->first().oclIsUndefined()
Previous Topic:MOF to EMF using ATL
Next Topic:[ATL] CDO model as an input
Goto Forum:
  


Current Time: Thu Apr 25 03:43:34 GMT 2024

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

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

Back to the top