[ATL] Generating an EChar during transformation [message #834165] |
Sun, 01 April 2012 14:09  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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 #834233 is a reply to message #834215] |
Sun, 01 April 2012 16:36  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.02586 seconds