| Convert Float to Double - by refInvokeOperation? [message #987622] |
Tue, 27 November 2012 05:56  |
Gunnar Arndt Messages: 46 Registered: June 2012 |
Member |
|
|
Hi members,
I'm trying to assign a Float value from a source model object to a Double attribute of the matching target model object:
rule Real2Term {
from
source: transformate!RealTransformer
to
otxTerm: otx!FloatLiteral (
value <- source.value -> refInvokeOperation('doubleValue', Sequence{})
)
}
which produces the error org.eclipse.m2m.atl.engine.emfvm.VMException: Wrong use of refInvokeOperation .
otxTerm.value is Double, source.value is Float. There is no doubleValue helper (similar to longValue), so I'm trying to access the Java method, which fails.
Thanks for helping.
|
|
|
|
| Re: Convert Float to Double - by refInvokeOperation? [message #987655 is a reply to message #987635] |
Tue, 27 November 2012 08:05   |
Hugo Bruneliere Messages: 467 Registered: July 2009 |
Senior Member |
|
|
The refInvokeOperation allows to call an operation of a given element type.
For instance considering an operation SampleOperation defined for the type transformate!RealTransformer in your example, it could be called like this:
source.refInvokeOperation('SampleOperation',Sequence{})
Hugo
------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02163 seconds