|
|
|
|
Re: [Xpand]: FeatureNotFoundException in workflow when metamodel references Ecore metamodel [message #511929 is a reply to message #511917] |
Wed, 03 February 2010 13:06 |
Andreas Werner Messages: 5 Registered: July 2009 |
Junior Member |
|
|
I got it now! ;)
The problem was, that I subTyped ENamedElement in the metamodel.ecore,
which is not allowed, because ENamedElement is not an EClass...
When subTyping EClass instead of ENamedElement the workflow executes without errors.
But I think it's strange that the EcoreEditor as well as the DynamicInstanceEditor no
warnings or errors have been given!?!?
Am 03.02.2010 13:25, schrieb Sven Efftinge:
> Is model.xmi and instance of Ecore.ecore?
> If you have another *.ecore file which Model.xmi is an instance of,
> you'll have to register that.
> Usually one refers to ecore files by it's nsURI (check the uri in your
> *.ecore file). In that case you only need to register your ecore model
>
> <registerEcoreFile
> value="platform:/resource/my.project/model/my.ecore" />
>
> This will register the epackage with the EPackage.Registry.
>
> You don't need to specify the EPackages when configuring the metamodel,
> since it uses the EPackage.Registry by default.
>
> <metaModel id="mm"
> class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
>
> is sufficient.
>
> Sven
>
> Andreas Werner schrieb:
>> Hi Sven,
>>
>> here is my generator.mwe with some experiments I've done so far.
>>
>> <?xml version="1.0"?>
>> <workflow>
>> <property name="model" value="my.generator.project/src/Model.xmi" />
>> <property name="src-gen" value="src-gen" />
>> <!-- set up EMF for standalone execution -->
>> <bean class="org.eclipse.emf.mwe.utils.StandaloneSetup" >
>> <platformUri value=".."/>
>> <!-- 1. Plugin URI doesn't sem to be supported (URI copyied from
>> metamodel.ecore as seen in the editor)
>> <registerEcoreFile
>> value="platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore " />
>> -->
>> <!-- 2. Tried this after copying the Ecore project into workspace
>> <registerEcoreFile
>> value="platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore " />
>> -->
>> <!-- 3. Tried this after copying the Ecore model to sample project
>> <registerEcoreFile
>> value=" platform:/resource/my.generator.project/src/metamodel/Ecore. ecore "
>> />
>> -->
>> <!-- 4. ...
>> <registerGeneratedEPackage value="org.eclipse.emf.ecore.EcorePackage"/>
>> -->
>> </bean>
>>
>> <!-- load model and store it in slot 'model' -->
>> <component class="org.eclipse.emf.mwe.utils.Reader">
>> <uri value="platform:/resource/${model}" />
>> <modelSlot value="model" />
>> </component>
>>
>> <!-- check model -->
>> <component class="org.eclipse.xtend.check.CheckComponent">
>> <metaModel id="mm"
>> class="org.eclipse.xtend.typesystem.emf.EmfRegistryMetaModel "/>
>> <checkFile value="metamodel::Checks" />
>> <emfAllChildrenSlot value="model" />
>> </component>
>>
>> <!-- generate code -->
>> <component class="org.eclipse.xpand2.Generator">
>> <metaModel idRef="mm"/>
>> <!-- 5. ...
>> <metaModel class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
>> <metaModelPackage value="org.eclipse.emf.ecore.EcorePackage"/>
>> </metaModel>
>> <metaModel class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
>> <metaModelFile
>> value="platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore "/>
>> </metaModel>
>> <metaModel class="org.eclipse.xtend.typesystem.emf.EmfMetaModel">
>> <metaModelFile
>> value="platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore "/>
>> </metaModel>
>> -->
>> <expand
>> value="template::Template::main FOR model" />
>> <outlet path="${src-gen}" >
>> <postprocessor class="org.eclipse.xpand2.output.JavaBeautifier" />
>> </outlet>
>> </component>
>> </workflow>
>>
>> Am 03.02.2010 11:33, schrieb Sven Efftinge:
>>> Please post your workflow and the way you reference ecore (ie is it
>>> nsURI or resource uri).
>>>
>>> Sven
>>>
>>> Andreas Werner schrieb:
>>>> Hi newsgroup,
>>>>
>>>> i'm totally desperated!
>>>>
>>>> My problem is, that when my metamodel is using some elements from the
>>>> ecore metamodel the workflow aborts with an
>>>> org.eclipse.emf.ecore.xmi.FeatureNotFoundException...
>>>>
>>>> You may reproduce it by changing the Xpand Sample Project in this way:
>>>> 1. In the metamodel.ecore file load ecore metamodel resource.
>>>> 2. Remove the name attribute from Type and therefore add ENamedElement
>>>> as a esuper type.
>>>> 3. Running the workflow now you will get the Exception.
>>>>
>>>> I found some similar problems with referenced metamodels that gave
>>>> some hints regarding the workflow definition (none of them helpful):
>>>> - add metaModel tags to Generator component
>>>> - add referenced ecore file tag to StandaloneSetup bean
>>>> - ...?
>>>>
>>>>
>>>> Has anybody an idea how to solve this issue???
>>>> Perhaps someone can share a working workflow definition for my Sample
>>>> Project example?
>>>>
>>>> Regards, Andreas
>>>
>>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03949 seconds