|
Re: [Acceleo] Problem execution operation defined in meta model [message #559029 is a reply to message #559016] |
Wed, 15 September 2010 11:20   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------020709020606030108000501
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Hi Simon,
Could you elaborate on what you'd like to do, and how? I can't really
understand what you're trying to achieve.
Laurent Goubet
Obeo
Simon harrer wrote:
> I have a method defined in my meta model using OCL. This method is
> invoked in an MTL file and always produces an error evaluating to an
> dynamic object reference in the text output.
> How is the model to generate to enable the execution of operations
> defined in OCL in Acceleo?
>
> Best regards,
> Simon
--------------020709020606030108000501
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"
YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------020709020606030108000501--
|
|
|
|
Re: [Acceleo] Problem execution operation defined in meta model [message #559038 is a reply to message #559034] |
Wed, 15 September 2010 11:56   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------020105080708090503020200
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Simon,
Acceleo Plugin applications mean "in Eclipse" while "Java Application"
mean "standalone". When running standalone applications, you have some
more things to setup (the things Eclipse does for you otherwise).
If I am not mistaken, you should have one (or more) report in your error
log (in Eclipse : Windows => show view => Error Log) saying that one (or
more) package(s) couldn't be found. You'll have to register those
packages as explained on
http://wiki.eclipse.org/MDT/UML2/FAQ#What.27s_required_to_lo ad_a_UML_.28.uml.29_resource_from_a_standalone_application.3 F
or
http://eclipsemde.blogspot.com/2010/06/package-with-uri-not- found.html
(these both use UML as an example).
There might also be some more things to setup from an OCL point of view,
but I don't think so.
Laurent Goubet
Obeo
Simon harrer wrote:
> ok, I will explain in some detail now:
>
> my metamodel:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ecore:EPackage xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="my"
> nsURI="http://my" nsPrefix="my">
> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
> <details key="invocationDelegates"
> value="http://www.eclipse.org/emf/2002/Ecore/OCL"/>
> <details key="settingDelegates"
> value="http://www.eclipse.org/emf/2002/Ecore/OCL"/>
> <details key="validationDelegates"
> value="http://www.eclipse.org/emf/2002/Ecore/OCL"/>
> </eAnnotations>
> <eClassifiers xsi:type="ecore:EClass" name="MyTest">
> <eOperations name="testOperation" eType="ecore:EDataType
> http://www.eclipse.org/emf/2002/Ecore#//EString">
> <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore/OCL">
> <details key="body" value="name.concat('asdf')"/>
> </eAnnotations>
> </eOperations>
> <eStructuralFeatures xsi:type="ecore:EAttribute" name="name"
> eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
> </eClassifiers>
> </ecore:EPackage>
>
>
> I want to use the operation testOperation() inside my template which is
> shown here:
>
> [template public generate(m : MyTest)]
>
> [comment @main /]
> [file (m.name, false, 'UTF-8')]
> [m.testOperation()/]
> [/file]
>
> [/template]
>
>
> If I use this as an AcceleoPluginApplication, everything works. If I run
> this as a JavaApplication, the method could not be instantiated. The
> output then looks the following:
>
> org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1fc8efd1 (eClass:
> org.eclipse.emf.ecore.impl.EClassImpl@40f892a4 (name: OclInvalid_Class)
> (instanceClassName: null) (abstract: false, interface: false))
>
--------------020105080708090503020200
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"
YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------020105080708090503020200--
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03726 seconds