Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » ATL - error getting some fields from UML model
ATL - error getting some fields from UML model [message #870503] Tue, 08 May 2012 13:16 Go to next message
Fernanda R.F. is currently offline Fernanda R.F.Friend
Messages: 64
Registered: May 2012
Member
Hi,

I'm getting the follow error when I'm trying to read a UML file into ATL code:

org.eclipse.m2m.atl.engine.emfvm.VMException: The value of type 'class org.eclipse.emf.ecore.impl.DynamicEObjectImpl' must be of type 'class java.lang.String'

I've a UML sequence diagram as Input and it will generate a new UML file, however this error is appearing when I try to get the covered, or sendEvent, or receiveEvent or represents value from UML.

One rule is it:

rule msg {

from
y: UML!Message

to
w: input!mensagem (
name <- y.name,
sender <- y.sendEvent

)
}


I can get the name from tag "message" from UML (xmi) file.

Thanks in advance

[Updated on: Thu, 10 May 2012 17:17]

Report message to a moderator

Re: ATL - error getting some fields from UML model [message #871061 is a reply to message #870503] Thu, 10 May 2012 17:19 Go to previous messageGo to next message
Fernanda R.F. is currently offline Fernanda R.F.Friend
Messages: 64
Registered: May 2012
Member
Nobody can help me?
Re: ATL - error getting some fields from UML model [message #871351 is a reply to message #871061] Sat, 12 May 2012 10:07 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
On 10/05/2012 18:19, Fernanda R.F. wrote:
> Nobody can help me?
I'm not an ATL user, but it looks like bad package registrations.

I suggest finding an ATL UML example that works and adapting it
gradually to your requirements.

Regards

Ed Willink
Re: ATL - error getting some fields from UML model [message #871382 is a reply to message #871351] Sat, 12 May 2012 23:53 Go to previous messageGo to next message
Fernanda R.F. is currently offline Fernanda R.F.Friend
Messages: 64
Registered: May 2012
Member
Thanks for your answer Ed Willink.

So, I resolved it.
The problem was that was being returned a pointer and not a value. Then I needed to use it to pick up the value from another attribute from class that this pointer was pointing.
Re: ATL - error getting some fields from UML model [message #883324 is a reply to message #871382] Fri, 08 June 2012 09:40 Go to previous messageGo to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
Dear Fernanda R.F.,
Can you tell me how you solved this problem.
I have the same problem.
Can you show me you corrected rule PLZ?

thank you
Re: ATL - error getting some fields from UML model [message #883341 is a reply to message #883324] Fri, 08 June 2012 10:14 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The previous answer makes no sense:

"The problem was that was being returned a pointer and not a value. Then
I needed to use it to pick up the value from another attribute from
class that this pointer was pointing."

OCL, ATL, and Java do not have pointers.

I suspect that the author was confusing OCL's collection navigation
operator "->" with C's pointer operator "->".

So it may be that the previous answer was identifying the need to use
the correct object "." or collection "->" navigation operator.

Regards

Ed Willink



On 08/06/2012 10:40, Fy Za wrote:
> Dear Fernanda R.F.,
> Can you tell me how you solved this problem.
> I have the same problem.
> Can you show me you corrected rule PLZ?
>
> thank you
>
Re: ATL - error getting some fields from UML model [message #883419 is a reply to message #883341] Fri, 08 June 2012 13:44 Go to previous messageGo to next message
Fy Za is currently offline Fy ZaFriend
Messages: 245
Registered: March 2010
Senior Member
Dear Edward Willink,
Thank you for your reply.
I solved the problem Smile
the situation is as following :
I have a model a (conforms to MetaModel Ma) which references to some elements
in model b (conforms to MetaModel Mb)
I want to create a model c (conforms to MetaModel Mc) from model a while maintaining references to model b.

a(Ma) ------> b(Mb) ======> c(Mc)-------->b(Mb)

I found that in (Ma) and (Mc), my references are referred to two different metamodels (Mb).
So, I updated my references that referred to same metamodel (Mb).

Regards
Fy Za
Re: ATL - error getting some fields from UML model [message #884704 is a reply to message #883419] Mon, 11 June 2012 16:24 Go to previous message
Fernanda R.F. is currently offline Fernanda R.F.Friend
Messages: 64
Registered: May 2012
Member
Sorry, I saw it just now. I used the following steps to solve it:

metamodel!Class->allInstances.asSequence().field1.asSequence().first().field2

So, as some fields in my xmi was pointing to another fields, for example, ownerId as being called into sendEvent, so I wanted the sendEvent from that message, because of it I couldn't get the ownerId from the beginning of the xmi, I needed to use allInstances and asSequences with different fields to get the id.
Previous Topic:How to run ATL using a java program?
Next Topic:Transformation Rules
Goto Forum:
  


Current Time: Thu Apr 18 04:13:56 GMT 2024

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

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

Back to the top