Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Generating an EChar during transformation(Generating an EChar during transformation)
[ATL] Generating an EChar during transformation [message #834165] Sun, 01 April 2012 14:09 Go to next message
Louis Bertrand is currently offline Louis BertrandFriend
Messages: 2
Registered: April 2012
Junior Member
I'm trying to generate an EChar in the transformation, but I wasn't able to do so. The transformation rule goes as following (LogClass.log is of type EChar):

rule RenameAll {
from oldName : MM!LogClass
to newName : MM!LogClass (
log <- 'a'
)

ERROR:

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

Regards
Re: [ATL] Generating an EChar during transformation [message #834182 is a reply to message #834165] Sun, 01 April 2012 14:43 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Louis

EChar is a form of Integer.

OCL has a variety of substring operations but they yield single
character Strings rather than Characters.

Perhaps OCL should have a codePoints() operation, but that would violate
encapsulation, which is currently preserved in both directions. Do you
have a strong justification for breaking it?

To solve this today you will need a Java operation.

Regards

Ed Willink

On 01/04/2012 15:09, Louis Bertrand wrote:
> I'm trying to generate an EChar in the transformation, but I wasn't
> able to do so. The transformation rule goes as following (LogClass.log
> is of type EChar):
>
> rule RenameAll {
> from oldName : MM!LogClass
> to newName : MM!LogClass (
> log <- 'a'
> )
>
> ERROR:
>
> org.eclipse.m2m.atl.engine.emfvm.VMException: The value of type 'class
> java.lang.String' must be of type 'class java.lang.Character'
>
> Regards
Re: [ATL] Generating an EChar during transformation [message #834215 is a reply to message #834182] Sun, 01 April 2012 16:00 Go to previous messageGo to next message
Louis Bertrand is currently offline Louis BertrandFriend
Messages: 2
Registered: April 2012
Junior Member
Edward,

Thanks for the prompt response. So that means I can invoke native java functions from atl? How do I do that?

Regards
Re: [ATL] Generating an EChar during transformation [message #834233 is a reply to message #834215] Sun, 01 April 2012 16:36 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Louis

No idea; I'm not an ATL user.

Try the documentation, search the newsgroup.

I'd be very surprised it there is no solution.

Regards

Ed Willink

On 01/04/2012 17:00, Louis Bertrand wrote:
> Edward,
>
> Thanks for the prompt response. So that means I can invoke native java
> functions from atl? How do I do that?
>
> Regards
Previous Topic:Invoke QVT In JAVA
Next Topic:[ATL] Problem to run ATL in JAVA
Goto Forum:
  


Current Time: Thu Mar 28 07:56:48 GMT 2024

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

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

Back to the top