|
|
Re: [ATL] Re: Can I do a helper that return a enumeration? [message #89064 is a reply to message #89017] |
Tue, 26 August 2008 09:17 |
Amalia Garcia Messages: 9 Registered: July 2009 |
Junior Member |
|
|
William Piers wrote:
> Hello,
> Can you please remember to prefix the subject of your ATL-related posts
> with [ATL] as I just did in this reply? Thanks.
> If you mean that you want to return an enumeration literal, here is a
> sample :
> Consider that "MM" (a metamodel) defines an enumeration called
> "EnumTest" and containing the value "SOME_LITERAL".
> helper context <some metaclass> def: getSomeEnumLiteral() :
> MM!EnumTest = #SOME_LITERAL;
> Otherwise if you want to return an enumeration (so your metamodel
> defines the enumeration data type), the helper should be like this :
> helper context <some metaclass> def: getSomeEnumeration() :
> UML!Enumeration = <helper code>;
> Best regards,
> William
> Amalia Garcia a écrit :
>> Hello,
>>
>> I want to do a helper that return a enumeration.
>>
>> Can you help me, please?.
>>
>> Thanks
>>
Hello Willian,
I want to do the second option, that it is:
helper context <some metaclass> def: getSomeEnumeration() :
UML!Enumeration = <helper code>;
But my doubt is : how I create and return a enumeration.
Example:
I have a enumeration that its name is MCD_MetaModel!TipoCardinalidad and
it has the following values: #Cero_a_uno, #Cero_a_muchos, #Uno and
#Uno_a_muchos.
I want to create a enumeration of this type that its value will be #Uno.
How do I do this helper?
helper def :getCardinality (cardinality: Logical!CardinaltyType) :
MCD_MetaModel!TipoCardinalidad = ?¿?¿?¿?¿?
The parte has ?¿?¿? I don't to do.
Thank you.
|
|
|
Re: [ATL] Re: Can I do a helper that return a enumeration? [message #89079 is a reply to message #89064] |
Tue, 26 August 2008 09:44 |
Amalia Garcia Messages: 9 Registered: July 2009 |
Junior Member |
|
|
Amalia Garcia wrote:
> William Piers wrote:
>> Hello,
>> Can you please remember to prefix the subject of your ATL-related posts
>> with [ATL] as I just did in this reply? Thanks.
>> If you mean that you want to return an enumeration literal, here is a
>> sample :
>> Consider that "MM" (a metamodel) defines an enumeration called
>> "EnumTest" and containing the value "SOME_LITERAL".
>> helper context <some metaclass> def: getSomeEnumLiteral() :
>> MM!EnumTest = #SOME_LITERAL;
>> Otherwise if you want to return an enumeration (so your metamodel
>> defines the enumeration data type), the helper should be like this :
>> helper context <some metaclass> def: getSomeEnumeration() :
>> UML!Enumeration = <helper code>;
>> Best regards,
>> William
>> Amalia Garcia a écrit :
>>> Hello,
>>>
>>> I want to do a helper that return a enumeration.
>>>
>>> Can you help me, please?.
>>>
>>> Thanks
>>>
> Hello Willian,
> I want to do the second option, that it is:
> helper context <some metaclass> def: getSomeEnumeration() :
> UML!Enumeration = <helper code>;
> But my doubt is : how I create and return a enumeration.
> Example:
> I have a enumeration that its name is MCD_MetaModel!TipoCardinalidad and
> it has the following values: #Cero_a_uno, #Cero_a_muchos, #Uno and
> #Uno_a_muchos.
> I want to create a enumeration of this type that its value will be #Uno.
> How do I do this helper?
> helper def :getCardinality (cardinality: Logical!CardinaltyType) :
> MCD_MetaModel!TipoCardinalidad = ?¿?¿?¿?¿?
> The parte has ?¿?¿? I don't to do.
> Thank you.
Hello Wllians,
I have de following helpers:
helper def :getCardinality (cardinality: Logical!CardinaltyType) :
MCD_MetaModel!TipoCardinalidad =
if (cardinality=#ZERO_TO_MANY) then
#cero_a_muchos
else
#cero_a_uno
endif;
When I execute the helper, this produces next exception, do you know which
is my problem:
java.lang.RuntimeException
at org.eclipse.m2m.atl.engine.vm.SimpleDebugger.error(Unknown Source)
at org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Unk nown
Source)
at org.eclipse.m2m.atl.engine.vm.StackFrame.printStackTrace(Unk nown
Source)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(Unknown Source)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(Unk nown
Source)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(Unk nown
Source)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(Unknown Source)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(Unknown Source)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(Unknown Source)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(Unk nown
Source)
at org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.invoke(Unk nown
Source)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(Unknown Source)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.exec(Unknown Source)
at org.eclipse.m2m.atl.engine.vm.ASMInterpreter.<init>(Unknown Source)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(Unknown Source)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(Unknown Source)
at org.eclipse.m2m.atl.engine.AtlLauncher.launch(Unknown Source)
at org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(Unknown
Source)
at org.eclipse.m2m.atl.adt.launching.AtlRegularVM.runAtlLaunche r(Unknown
Source)
at org.eclipse.m2m.atl.adt.launching.AtlRegularVM.launch(Unknow n Source)
at
org.eclipse.m2m.atl.adt.launching.AtlLaunchConfigurationDele gate.launch(Unknown
Source)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(U nknown
Source)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(U nknown
Source)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(U nknown
Source)
at org.eclipse.debug.internal.ui.DebugUIPlugin$6.run(Unknown Source)
at org.eclipse.core.internal.jobs.Worker.run(Unknown Source)
Caused by: java.lang.NullPointerException
at org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.asm2E MF(Unknown
Source)
at org.eclipse.m2m.atl.drivers.emf4atl.ASMEMFModelElement.set(U nknown
Source)
at org.eclipse.m2m.atl.engine.vm.ASMOperation.realExec(Unknown Source)
... 23 more
Thank you
|
|
|
Powered by
FUDForum. Page generated in 0.03975 seconds