Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » EMF operation invocation in an ATL module
EMF operation invocation in an ATL module [message #1075395] Mon, 29 July 2013 06:59 Go to next message
Kosala Yapa is currently offline Kosala Yapa
Messages: 159
Registered: September 2010
Senior Member
Hi there,

rule rule_getDevice{
from
a: source!DeviceItem
to
p:target!Device(
name <- a.Name,
s7DeviceReference<-a.DeviceReference,
isSelectedWithinStep7 <-a.stringToBool(a.IsSelected)
)

}

stringToBool() defined in the source EMF meta-model. I set the Operation Reflection feature of the gen model to True.

I get the following error, When I run this transformation using ATL Run configuration,

org.eclipse.m2m.atl.engine.emfvm.VMException: Operation not found: IN!<unnamed>.stringToBool(java.lang.String)

Any help is appreciated.

Cheers,
Kosala
Re: EMF operation invocation in an ATL module [message #1075499 is a reply to message #1075395] Mon, 29 July 2013 10:38 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 603
Registered: July 2009
Senior Member
Hello,

Invoking such Java-implemented operations is generally not a recommended practice in ATL.
However, the refInvokeOperation operation allows to do so when really needed.

Best regards,


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: EMF operation invocation in an ATL module [message #1075504 is a reply to message #1075499] Mon, 29 July 2013 10:48 Go to previous messageGo to next message
Kosala Yapa is currently offline Kosala Yapa
Messages: 159
Registered: September 2010
Senior Member
Hi Hugo,

Thanks. Do you have any clue how to use refInvokeOperation in the above example?

isSelectedWithinStep7 <-a.stringToBool(a.IsSelected)

Cheers,

[Updated on: Mon, 29 July 2013 10:50]

Report message to a moderator

Re: EMF operation invocation in an ATL module [message #1075506 is a reply to message #1075504] Mon, 29 July 2013 10:51 Go to previous message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 603
Registered: July 2009
Senior Member
As explained in the manual, something like: a.refInvokeOperation('stringToBool',Sequence{a.IsSelected})

Best regards,


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Previous Topic:Incremental ATL
Next Topic:problem in helper
Goto Forum:
  


Current Time: Tue Sep 02 15:00:16 EDT 2014

Powered by FUDForum. Page generated in 0.10504 seconds