Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » generating code while refering to a runtime instance of a model
generating code while refering to a runtime instance of a model [message #431783] Sun, 26 July 2009 19:45 Go to next message
Sandro Boehme is currently offline Sandro BoehmeFriend
Messages: 95
Registered: July 2009
Member
Hello

I have a *.ecore file that refers to elements of a runtime instance of
an other model. If I try to create a genmodel for that there is no
referenced generator model to select at the last page of the wizard and
the root package of the referenced runtime instance of the model is not
shown either.
I already checked that the referenced model has the following extension
point declared:
<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri = "http://www.eclipse.org/jcrm/0.8.0/dmodel"
class = "org.eclipse.emf.jcrm.dmodel.DmodelPackage"
genModel = "model/domainmodel.genmodel" />
</extension>

Any help is much appreciated.

Best,

Sandro

--
Eclipse JCR Management
http://jcrmanagement.blogspot.com/
Re: generating code while refering to a runtime instance of a model [message #431796 is a reply to message #431783] Mon, 27 July 2009 09:53 Go to previous messageGo to next message
Mario Winterer is currently offline Mario WintererFriend
Messages: 136
Registered: July 2009
Senior Member
Hi Sandro!

Sandro Böhme schrieb:
> Hello
>
> I have a *.ecore file that refers to elements of a runtime instance of
> an other model.

What do you mean with "runtime instance of another model"? Your
..ecore-file refers to model elements of another .ecore file?

> If I try to create a genmodel for that there is no
> referenced generator model to select at the last page of the wizard and
> the root package of the referenced runtime instance of the model is not
> shown either.

You have to create a .genmodel file for your referenced model and add
this file on the last wizard page you mentioned.

> I already checked that the referenced model has the following extension
> point declared:
> <extension point="org.eclipse.emf.ecore.generated_package">
> <package
> uri = "http://www.eclipse.org/jcrm/0.8.0/dmodel"
> class = "org.eclipse.emf.jcrm.dmodel.DmodelPackage"
> genModel = "model/domainmodel.genmodel" />
> </extension>

Although extending the generated_package extension point is necessary
(or at least highly recommended) for model plugins, (as far as I know)
it has nothing to do with your cross model references issue.

> Any help is much appreciated.
>
> Best,
>
> Sandro
>

Mario
Re: generating code while refering to a runtime instance of a model [message #431798 is a reply to message #431796] Mon, 27 July 2009 10:59 Go to previous messageGo to next message
Sandro Boehme is currently offline Sandro BoehmeFriend
Messages: 95
Registered: July 2009
Member
Mario Winterer schrieb:
> Hi Sandro!
>
> Sandro Böhme schrieb:
>> Hello
>>
>> I have a *.ecore file that refers to elements of a runtime instance of
>> an other model.
>
> What do you mean with "runtime instance of another model"? Your
> .ecore-file refers to model elements of another .ecore file?
When loading a resource to an ecore file one can choose between a
runtime instance and a development instance of a resource. In my case I
need a runtime instance. I learned that this runtime instance uses the
package URI (in my case http://www.eclipse.org/jcrm/0.8.0/dmodel) of the
model in the actual reference within the ecore file while the
development instance uses the file URI to the *.ecore file.
When I used the development instance there was no problem creating the
genmodel including references to an other model. But since I now need
the runtime instance it doesn't work anymore.

>
> > If I try to create a genmodel for that there is no
>> referenced generator model to select at the last page of the wizard
>> and the root package of the referenced runtime instance of the model
>> is not shown either.
>
> You have to create a .genmodel file for your referenced model and add
> this file on the last wizard page you mentioned.
>
>> I already checked that the referenced model has the following
>> extension point declared:
>> <extension point="org.eclipse.emf.ecore.generated_package">
>> <package
>> uri = "http://www.eclipse.org/jcrm/0.8.0/dmodel"
>> class = "org.eclipse.emf.jcrm.dmodel.DmodelPackage"
>> genModel = "model/domainmodel.genmodel" />
>> </extension>
>
> Although extending the generated_package extension point is necessary
> (or at least highly recommended) for model plugins, (as far as I know)
> it has nothing to do with your cross model references issue.
>
>> Any help is much appreciated.
>>
>> Best,
>>
>> Sandro
>>
>
> Mario
Re: generating code while refering to a runtime instance of a model [message #431802 is a reply to message #431798] Mon, 27 July 2009 13:13 Go to previous messageGo to next message
Mario Winterer is currently offline Mario WintererFriend
Messages: 136
Registered: July 2009
Senior Member
Sandro Böhme schrieb:
> Mario Winterer schrieb:
>> Hi Sandro!
>>
>> Sandro Böhme schrieb:
>>> Hello
>>>
>>> I have a *.ecore file that refers to elements of a runtime instance
>>> of an other model.
>>
>> What do you mean with "runtime instance of another model"? Your
>> .ecore-file refers to model elements of another .ecore file?
> When loading a resource to an ecore file one can choose between a
> runtime instance and a development instance of a resource. In my case I
> need a runtime instance. I learned that this runtime instance uses the
> package URI (in my case http://www.eclipse.org/jcrm/0.8.0/dmodel) of the
> model in the actual reference within the ecore file while the
> development instance uses the file URI to the *.ecore file.
> When I used the development instance there was no problem creating the
> genmodel including references to an other model. But since I now need
> the runtime instance it doesn't work anymore.

OK. I've tried to do the same and it worked for me - but "runtime
models" refers to all models that are registered in the currently
running platform (e.g. emf plugins and others), and not to models that
you have defined somewhere in your workspace (e.g. in your domain model
plug-in).
How did you manage to add a reference to your model? Did you modify the
ecore xml directly, or did you use the default ecore editor's "load
resource..." context menu and then choose "Browse registered packages"?

>>
>> > If I try to create a genmodel for that there is no
>>> referenced generator model to select at the last page of the wizard
>>> and the root package of the referenced runtime instance of the model
>>> is not shown either.
>>
>> You have to create a .genmodel file for your referenced model and add
>> this file on the last wizard page you mentioned.
>>
>>> I already checked that the referenced model has the following
>>> extension point declared:
>>> <extension point="org.eclipse.emf.ecore.generated_package">
>>> <package
>>> uri = "http://www.eclipse.org/jcrm/0.8.0/dmodel"
>>> class = "org.eclipse.emf.jcrm.dmodel.DmodelPackage"
>>> genModel = "model/domainmodel.genmodel" />
>>> </extension>
>>
>> Although extending the generated_package extension point is necessary
>> (or at least highly recommended) for model plugins, (as far as I know)
>> it has nothing to do with your cross model references issue.
>>
>>> Any help is much appreciated.
>>>
>>> Best,
>>>
>>> Sandro
>>>
>>
>> Mario
Re: generating code while refering to a runtime instance of a model [message #431803 is a reply to message #431802] Mon, 27 July 2009 13:40 Go to previous messageGo to next message
Sandro Boehme is currently offline Sandro BoehmeFriend
Messages: 95
Registered: July 2009
Member
Hi Mario,

Mario Winterer schrieb:
> Sandro Böhme schrieb:
>> Mario Winterer schrieb:
>>> Hi Sandro!
>>>
>>> Sandro Böhme schrieb:
>>>> Hello
>>>>
>>>> I have a *.ecore file that refers to elements of a runtime instance
>>>> of an other model.
>>>
>>> What do you mean with "runtime instance of another model"? Your
>>> .ecore-file refers to model elements of another .ecore file?
>> When loading a resource to an ecore file one can choose between a
>> runtime instance and a development instance of a resource. In my case
>> I need a runtime instance. I learned that this runtime instance uses
>> the package URI (in my case http://www.eclipse.org/jcrm/0.8.0/dmodel)
>> of the model in the actual reference within the ecore file while the
>> development instance uses the file URI to the *.ecore file.
>> When I used the development instance there was no problem creating the
>> genmodel including references to an other model. But since I now need
>> the runtime instance it doesn't work anymore.
>
> OK. I've tried to do the same and it worked for me - but "runtime
> models" refers to all models that are registered in the currently
> running platform (e.g. emf plugins and others), and not to models that
> you have defined somewhere in your workspace (e.g. in your domain model
> plug-in).
> How did you manage to add a reference to your model? Did you modify the
> ecore xml directly, or did you use the default ecore editor's "load
> resource..." context menu and then choose "Browse registered packages"?

I used the "load resource..." action. In my case I have a generic model
in one Eclipse instance and start a second one. In this second instance
I create a new model refering to the runtime version of the generic model.
Thanks for having a look into it.

Best,

Sandro
Re: generating code while refering to a runtime instance of a model [message #431808 is a reply to message #431803] Mon, 27 July 2009 16:25 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30700
Registered: July 2009
Senior Member
Sandro,

You need to refer to the development time instance to generate code.
I'm not sure what else to say...


Sandro Böhme wrote:
> Hi Mario,
>
> Mario Winterer schrieb:
>> Sandro Böhme schrieb:
>>> Mario Winterer schrieb:
>>>> Hi Sandro!
>>>>
>>>> Sandro Böhme schrieb:
>>>>> Hello
>>>>>
>>>>> I have a *.ecore file that refers to elements of a runtime
>>>>> instance of an other model.
>>>>
>>>> What do you mean with "runtime instance of another model"? Your
>>>> .ecore-file refers to model elements of another .ecore file?
>>> When loading a resource to an ecore file one can choose between a
>>> runtime instance and a development instance of a resource. In my
>>> case I need a runtime instance. I learned that this runtime instance
>>> uses the package URI (in my case
>>> http://www.eclipse.org/jcrm/0.8.0/dmodel) of the model in the actual
>>> reference within the ecore file while the development instance uses
>>> the file URI to the *.ecore file.
>>> When I used the development instance there was no problem creating
>>> the genmodel including references to an other model. But since I now
>>> need the runtime instance it doesn't work anymore.
>>
>> OK. I've tried to do the same and it worked for me - but "runtime
>> models" refers to all models that are registered in the currently
>> running platform (e.g. emf plugins and others), and not to models
>> that you have defined somewhere in your workspace (e.g. in your
>> domain model plug-in).
>> How did you manage to add a reference to your model? Did you modify
>> the ecore xml directly, or did you use the default ecore editor's
>> "load resource..." context menu and then choose "Browse registered
>> packages"?
>
> I used the "load resource..." action. In my case I have a generic
> model in one Eclipse instance and start a second one. In this second
> instance I create a new model refering to the runtime version of the
> generic model.
> Thanks for having a look into it.
>
> Best,
>
> Sandro
Re: generating code while refering to a runtime instance of a model [message #431815 is a reply to message #431808] Mon, 27 July 2009 16:57 Go to previous message
Sandro Boehme is currently offline Sandro BoehmeFriend
Messages: 95
Registered: July 2009
Member
I just thought I can use a model containing a reference to a runtime
version of a model for both - generating code and working with it
reflectively as described in my post from last week.
But in this case I will just try to generate different ecore files with
MWE one with a development time reference and one with a runtime reference.
Thanks for your feedback Ed.

Cheers,

Sandro

Ed Merks schrieb:
> Sandro,
>
> You need to refer to the development time instance to generate code.
> I'm not sure what else to say...
>
>
> Sandro Böhme wrote:
>> Hi Mario,
>>
>> Mario Winterer schrieb:
>>> Sandro Böhme schrieb:
>>>> Mario Winterer schrieb:
>>>>> Hi Sandro!
>>>>>
>>>>> Sandro Böhme schrieb:
>>>>>> Hello
>>>>>>
>>>>>> I have a *.ecore file that refers to elements of a runtime
>>>>>> instance of an other model.
>>>>>
>>>>> What do you mean with "runtime instance of another model"? Your
>>>>> .ecore-file refers to model elements of another .ecore file?
>>>> When loading a resource to an ecore file one can choose between a
>>>> runtime instance and a development instance of a resource. In my
>>>> case I need a runtime instance. I learned that this runtime instance
>>>> uses the package URI (in my case
>>>> http://www.eclipse.org/jcrm/0.8.0/dmodel) of the model in the actual
>>>> reference within the ecore file while the development instance uses
>>>> the file URI to the *.ecore file.
>>>> When I used the development instance there was no problem creating
>>>> the genmodel including references to an other model. But since I now
>>>> need the runtime instance it doesn't work anymore.
>>>
>>> OK. I've tried to do the same and it worked for me - but "runtime
>>> models" refers to all models that are registered in the currently
>>> running platform (e.g. emf plugins and others), and not to models
>>> that you have defined somewhere in your workspace (e.g. in your
>>> domain model plug-in).
>>> How did you manage to add a reference to your model? Did you modify
>>> the ecore xml directly, or did you use the default ecore editor's
>>> "load resource..." context menu and then choose "Browse registered
>>> packages"?
>>
>> I used the "load resource..." action. In my case I have a generic
>> model in one Eclipse instance and start a second one. In this second
>> instance I create a new model refering to the runtime version of the
>> generic model.
>> Thanks for having a look into it.
>>
>> Best,
>>
>> Sandro
Previous Topic:Errorneous code generated
Next Topic:XMLResource.OPTION_USE_DEPRECATED_METHODS option in EMF Book
Goto Forum:
  


Current Time: Mon Dec 16 11:05:50 GMT 2019

Powered by FUDForum. Page generated in 0.02048 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top