| Problem with getValue [message #1093281] |
Fri, 23 August 2013 17:43  |
Jeni Martin Messages: 24 Registered: November 2012 |
Junior Member |
|
|
Hi,
I have defined a helper that a class uses and I want to count the number of elements that have a specific value. So I used getValue but I receive error. Can any one help?
helper context MM! Class
def: MappedSize (): Integer=
MM!Association.allInstancesFrom('IN')->select (e|e.hasStereotype('Pro::Mapps')
and e.endType->first()=self) ->
select (e|e.endType->last().getValue(e.endType->last().getAppliedStereotypes()-> at(1), 'source')='IN')->size()
;
here is the error that I receive in console:
org.eclipse.m2m.atl.engine.emfvm.VMException: Exception during invocation of operation getValue on org.eclipse.uml2.uml.internal.impl.ClassImpl@2fd9cee8
Thanks a lot.
|
|
|
|
| Re: Problem with getValue [message #1094882 is a reply to message #1093292] |
Mon, 26 August 2013 06:34   |
Hugo Bruneliere Messages: 560 Registered: July 2009 |
Senior Member |
|
|
Hello,
What is the actual type of the element returned by the expression e.endType->last()?
I'm not sure you have to call getValue() on it.
Best regards,
------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
|
|
|
|
| Re: Problem with getValue [message #1095654 is a reply to message #1095220] |
Tue, 27 August 2013 06:49  |
Hugo Bruneliere Messages: 560 Registered: July 2009 |
Senior Member |
|
|
Hello,
Have you tried something like e.endType->last().source to access to the expected value?
Related to enumerations, the way to refer to an enumeration literal is the following one: e.myAttributeOfTypeEnum = #myEnumLiteral (cf. also the ATL user guide).
Best regards,
------------------------------------------
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.02156 seconds