Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » create model from .ecore(This description is about create model from metamodel in eclipse based on EMF)
| | | | |
Re: create model from .ecore [message #1080134 is a reply to message #1079927] |
Mon, 05 August 2013 14:00 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
Mahsa,
Comments below.
On 05/08/2013 10:44 AM, Mahsa P wrote:
> Ed Merks wrote on Mon, 05 August 2013 03:02
>> Mahsa,
>>
>> If you generate code there is a factory and you'd use
>> XyzFactory.eINSTANCE.createAbc, otherwise if you just have an EClass
>> you can use EcoreUtil.create(EClass).
>>
>>
>> On 04/08/2013 9:32 PM, Mahsa P wrote:
>> > I would want to create model instance from .ecore that now i'm
>> using > GMF!Thanks from your following.
>
> Thanks! but can you explain more about EcoreUtil.create?
Have you looked at what it does? Have you tried it?
> I have .ecore model contained EClass and EReference and so on. this
> .ecore model is metamodel
What exactly does that mean?
> and I want to create model from it!
EMF only supports creating model instances from Ecore itself. If you
use Ecore to define some other metamodel, you'll need to also define how
to create instances of such things.
> do you say i must use EcoreUtil.create?
> as I had said, I'm using GMF now but if you think i must use from
> EcoreUtil.create,help me with more explanation.Thanks alot
To start, it's better if you be very specific with some details of what
you're doing.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: create model from .ecore [message #1080245 is a reply to message #1080134] |
Mon, 05 August 2013 17:29 |
Mahsa P Messages: 115 Registered: July 2013 |
Senior Member |
|
|
Ed Merks wrote on Mon, 05 August 2013 10:00Mahsa,
Comments below.
On 05/08/2013 10:44 AM, Mahsa P wrote:
> Ed Merks wrote on Mon, 05 August 2013 03:02
>> Mahsa,
>>
>> If you generate code there is a factory and you'd use
>> XyzFactory.eINSTANCE.createAbc, otherwise if you just have an EClass
>> you can use EcoreUtil.create(EClass).
>>
>>
>> On 04/08/2013 9:32 PM, Mahsa P wrote:
>> > I would want to create model instance from .ecore that now i'm
>> using > GMF!Thanks from your following.
>
> Thanks! but can you explain more about EcoreUtil.create?
Have you looked at what it does? Have you tried it?
> I have .ecore model contained EClass and EReference and so on. this
> .ecore model is metamodel
What exactly does that mean?
> and I want to create model from it!
EMF only supports creating model instances from Ecore itself. If you
use Ecore to define some other metamodel, you'll need to also define how
to create instances of such things.
> do you say i must use EcoreUtil.create?
> as I had said, I'm using GMF now but if you think i must use from
> EcoreUtil.create,help me with more explanation.Thanks alot
To start, it's better if you be very specific with some details of what
you're doing.
>Have you looked at what it does? Have you tried it?
Yes i search about it but I didn't understand how use from it! do i should convert .ecore to java and use from it's methods?
for other your question,I think it's better if I express my problem!
I have .ecore file that this is one metamodel, i heve .ecorediag from it too. this meta model is one specification that describes concepts and rules for instancing the models of it's domain. i want create one model from it. in other word, my model witch created from this .ecore file should conform this metamodel(.ecore file). i studied about it and found GMF that creates graphical model from .ecore file! so i use from it! but i embrace best way!
|
|
|
Re: create model from .ecore [message #1080364 is a reply to message #1080245] |
Mon, 05 August 2013 21:11 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
Mahsa,
Comments below.
On 05/08/2013 7:29 PM, Mahsa P wrote:
> Ed Merks wrote on Mon, 05 August 2013 10:00
>> Mahsa,
>>
>> Comments below.
>>
>> On 05/08/2013 10:44 AM, Mahsa P wrote:
>> > Ed Merks wrote on Mon, 05 August 2013 03:02
>> >> Mahsa,
>> >>
>> >> If you generate code there is a factory and you'd use >>
>> XyzFactory.eINSTANCE.createAbc, otherwise if you just have an EClass
>> >> you can use EcoreUtil.create(EClass).
>> >>
>> >>
>> >> On 04/08/2013 9:32 PM, Mahsa P wrote:
>> >> > I would want to create model instance from .ecore that now i'm
>> >> using > GMF!Thanks from your following.
>> >
>> > Thanks! but can you explain more about EcoreUtil.create?
>> Have you looked at what it does? Have you tried it?
>> > I have .ecore model contained EClass and EReference and so on. this
>> > .ecore model is metamodel What exactly does that mean?
>> > and I want to create model from it!
>> EMF only supports creating model instances from Ecore itself. If you
>> use Ecore to define some other metamodel, you'll need to also define
>> how to create instances of such things.
>> > do you say i must use EcoreUtil.create?
>> > as I had said, I'm using GMF now but if you think i must use from >
>> EcoreUtil.create,help me with more explanation.Thanks alot
>> To start, it's better if you be very specific with some details of
>> what you're doing.
>
>
>> Have you looked at what it does? Have you tried it?
> Yes i search about it but I didn't understand how use from it! do i
> should convert .ecore to java and use from it's methods?
There are tutorials for the basics, so follow one of them.
> for other your question,I think it's better if I express my problem!
>
> I have .ecore file that this is one metamodel, i heve .ecorediag from
> it too. this meta model is one specification that describes concepts
> and rules for instancing the models of it's domain.
So you have concepts and rules...
> i want create one model from it.
It isn't already a model?
> in other word, my model witch created from this .ecore file should
> conform this metamodel(.ecore file).
Which tells me pretty much nothing concrete.
> i studied about it and found GMF that creates graphical model from
> .ecore file! so i use from it! but i embrace best way!
Sorry, I don't understand what you're asking. Please describe something
specific and concrete.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| |
Re: create model from .ecore [message #1080638 is a reply to message #1080612] |
Tue, 06 August 2013 07:44 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
Mahsa,
Comments below.
On 06/08/2013 8:57 AM, Mahsa P wrote:
> I'm so sorry if i explain bad!
>
> my .ecore file is metamodel likes UML models and model witch should be
> created from it should be one instance from it.
I see. EMF only directly supports creating instances for the Ecore
metamodel, i.e., you can create an EObject given an EClass. If you
have some EObject instance of some Ecore model, e.g., a UML Class from
the UML model, there is no support for creating an instance of that.
For something like UML (or XML Schema) there is support for mapping UML
models (or XML Schema models) to corresponding Ecore models, and from
that you can of course create an instance. But that's all.
> i need to select elements of metamodel(.ecore file) and connect them
> for designing one instance from .ecore! this work is like create model
> from UML! i think GMF could make graphical IDE for instancing of
> .ecore. i'm grateful if know your idea.
This sounds a little different from your first sentence. With GMF or
Graphiti you can create graphical visualizations/editors for any Ecore
model to work with instances. That's how Papyrus provides diagrams for
editing UML graphically. Questions about such things should be directed
to the GMF newsgroup, but the response will likely be similar, i.e.,
have you tried out the GMF tutorials?
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: create model from .ecore [message #1081089 is a reply to message #1080638] |
Tue, 06 August 2013 19:55 |
Mahsa P Messages: 115 Registered: July 2013 |
Senior Member |
|
|
Ed Merks wrote on Tue, 06 August 2013 03:44Mahsa,
Comments below.
On 06/08/2013 8:57 AM, Mahsa P wrote:
> I'm so sorry if i explain bad!
>
> my .ecore file is metamodel likes UML models and model witch should be
> created from it should be one instance from it.
I see. EMF only directly supports creating instances for the Ecore
metamodel, i.e., you can create an EObject given an EClass. If you
have some EObject instance of some Ecore model, e.g., a UML Class from
the UML model, there is no support for creating an instance of that.
For something like UML (or XML Schema) there is support for mapping UML
models (or XML Schema models) to corresponding Ecore models, and from
that you can of course create an instance. But that's all.
> i need to select elements of metamodel(.ecore file) and connect them
> for designing one instance from .ecore! this work is like create model
> from UML! i think GMF could make graphical IDE for instancing of
> .ecore. i'm grateful if know your idea.
This sounds a little different from your first sentence. With GMF or
Graphiti you can create graphical visualizations/editors for any Ecore
model to work with instances. That's how Papyrus provides diagrams for
editing UML graphically. Questions about such things should be directed
to the GMF newsgroup, but the response will likely be similar, i.e.,
have you tried out the GMF tutorials?
My mean is witch you understand from second sentences. I read about GMF and work by it. but i thought EcoreUtil could be useful for me! Thank alot for all your answers:)
|
|
|
Re: create model from .ecore [message #1081365 is a reply to message #1081089] |
Wed, 07 August 2013 06:21 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
Mahsa,
Yes try GMF (or Graphiti). There's nothing in EMF that will let you
create an instance from an arbitrary EObject; there's only
EcoreUtil.create to let you create an instance of an EClass. In other
words, Ecore itself is the only metamodel that directly supports
creating model instances.
On 06/08/2013 9:55 PM, Mahsa P wrote:
>
> Ed Merks wrote on Tue, 06 August 2013 03:44
>> Mahsa,
>>
>> Comments below.
>>
>> On 06/08/2013 8:57 AM, Mahsa P wrote:
>> > I'm so sorry if i explain bad!
>> >
>> > my .ecore file is metamodel likes UML models and model witch should
>> be > created from it should be one instance from it.
>> I see. EMF only directly supports creating instances for the Ecore
>> metamodel, i.e., you can create an EObject given an EClass. If you
>> have some EObject instance of some Ecore model, e.g., a UML Class
>> from the UML model, there is no support for creating an instance of
>> that. For something like UML (or XML Schema) there is support for
>> mapping UML models (or XML Schema models) to corresponding Ecore
>> models, and from that you can of course create an instance. But
>> that's all.
>> > i need to select elements of metamodel(.ecore file) and connect
>> them > for designing one instance from .ecore! this work is like
>> create model > from UML! i think GMF could make graphical IDE for
>> instancing of > .ecore. i'm grateful if know your idea.
>> This sounds a little different from your first sentence. With GMF
>> or Graphiti you can create graphical visualizations/editors for any
>> Ecore model to work with instances. That's how Papyrus provides
>> diagrams for editing UML graphically. Questions about such things
>> should be directed to the GMF newsgroup, but the response will likely
>> be similar, i.e., have you tried out the GMF tutorials?
>
> My mean is witch you understand from second sentences. I read about
> GMF and work by it. but i thought EcoreUtil could be useful for me!
> Thank alot for all your answers:)
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: create model from .ecore [message #1081387 is a reply to message #1081365] |
Wed, 07 August 2013 07:03 |
Ed Willink Messages: 7670 Registered: July 2009 |
Senior Member |
|
|
Hi Mahsa
It's far from clear what you want.
Ecore/EMF does have a way of creating instances.
While editing an Ecore diagrams you can select an EClass and invoke
"Create Dynamic instance" which gives you an XMI file with an instnace
of that class. YOu can then use the SAmple Reflective Ecore Editor to
elaborate that XMI file.
Maybe this is what you're looking for. Obviously a custom GMF editor
will be prettier, but Ecore can still be useful. The Sirius project
provides aids to creating custom GMF editors.
Regards
Ed Willink
On 07/08/2013 07:21, Ed Merks wrote:
> Mahsa,
>
> Yes try GMF (or Graphiti). There's nothing in EMF that will let you
> create an instance from an arbitrary EObject; there's only
> EcoreUtil.create to let you create an instance of an EClass. In other
> words, Ecore itself is the only metamodel that directly supports
> creating model instances.
>
>
> On 06/08/2013 9:55 PM, Mahsa P wrote:
>>
>> Ed Merks wrote on Tue, 06 August 2013 03:44
>>> Mahsa,
>>>
>>> Comments below.
>>>
>>> On 06/08/2013 8:57 AM, Mahsa P wrote:
>>> > I'm so sorry if i explain bad!
>>> >
>>> > my .ecore file is metamodel likes UML models and model witch
>>> should be > created from it should be one instance from it.
>>> I see. EMF only directly supports creating instances for the Ecore
>>> metamodel, i.e., you can create an EObject given an EClass. If
>>> you have some EObject instance of some Ecore model, e.g., a UML
>>> Class from the UML model, there is no support for creating an
>>> instance of that. For something like UML (or XML Schema) there is
>>> support for mapping UML models (or XML Schema models) to
>>> corresponding Ecore models, and from that you can of course create
>>> an instance. But that's all.
>>> > i need to select elements of metamodel(.ecore file) and connect
>>> them > for designing one instance from .ecore! this work is like
>>> create model > from UML! i think GMF could make graphical IDE for
>>> instancing of > .ecore. i'm grateful if know your idea.
>>> This sounds a little different from your first sentence. With GMF or
>>> Graphiti you can create graphical visualizations/editors for any
>>> Ecore model to work with instances. That's how Papyrus provides
>>> diagrams for editing UML graphically. Questions about such things
>>> should be directed to the GMF newsgroup, but the response will
>>> likely be similar, i.e., have you tried out the GMF tutorials?
>>
>> My mean is witch you understand from second sentences. I read about
>> GMF and work by it. but i thought EcoreUtil could be useful for me!
>> Thank alot for all your answers:)
>
|
|
|
Re: create model from .ecore [message #1081583 is a reply to message #1081365] |
Wed, 07 August 2013 12:20 |
Mahsa P Messages: 115 Registered: July 2013 |
Senior Member |
|
|
Thanks Ed Merks. i'm using GMF it's good but i have one problem for GMF that i have introduced it in GMF newsgroup but don't get answer yet!
Ed Merks wrote on Wed, 07 August 2013 02:21Mahsa,
Yes try GMF (or Graphiti). There's nothing in EMF that will let you
create an instance from an arbitrary EObject; there's only
EcoreUtil.create to let you create an instance of an EClass. In other
words, Ecore itself is the only metamodel that directly supports
creating model instances.
On 06/08/2013 9:55 PM, Mahsa P wrote:
>
> Ed Merks wrote on Tue, 06 August 2013 03:44
>> Mahsa,
>>
>> Comments below.
>>
>> On 06/08/2013 8:57 AM, Mahsa P wrote:
>> > I'm so sorry if i explain bad!
>> >
>> > my .ecore file is metamodel likes UML models and model witch should
>> be > created from it should be one instance from it.
>> I see. EMF only directly supports creating instances for the Ecore
>> metamodel, i.e., you can create an EObject given an EClass. If you
>> have some EObject instance of some Ecore model, e.g., a UML Class
>> from the UML model, there is no support for creating an instance of
>> that. For something like UML (or XML Schema) there is support for
>> mapping UML models (or XML Schema models) to corresponding Ecore
>> models, and from that you can of course create an instance. But
>> that's all.
>> > i need to select elements of metamodel(.ecore file) and connect
>> them > for designing one instance from .ecore! this work is like
>> create model > from UML! i think GMF could make graphical IDE for
>> instancing of > .ecore. i'm grateful if know your idea.
>> This sounds a little different from your first sentence. With GMF
>> or Graphiti you can create graphical visualizations/editors for any
>> Ecore model to work with instances. That's how Papyrus provides
>> diagrams for editing UML graphically. Questions about such things
>> should be directed to the GMF newsgroup, but the response will likely
>> be similar, i.e., have you tried out the GMF tutorials?
>
> My mean is witch you understand from second sentences. I read about
> GMF and work by it. but i thought EcoreUtil could be useful for me!
> Thank alot for all your answers:)
|
|
|
Re: create model from .ecore [message #1081597 is a reply to message #1081387] |
Wed, 07 August 2013 12:38 |
Mahsa P Messages: 115 Registered: July 2013 |
Senior Member |
|
|
Ed Willink so thanks from your pursuit.
Ed Willink wrote on Wed, 07 August 2013 03:03Hi Mahsa
It's far from clear what you want.
Ecore/EMF does have a way of creating instances.
While editing an Ecore diagrams you can select an EClass and invoke
"Create Dynamic instance" which gives you an XMI file with an instnace
of that class. YOu can then use the SAmple Reflective Ecore Editor to
elaborate that XMI file.
Maybe this is what you're looking for. Obviously a custom GMF editor
will be prettier, but Ecore can still be useful. The Sirius project
provides aids to creating custom GMF editors.
Regards
Ed Willink
On 07/08/2013 07:21, Ed Merks wrote:
> Mahsa,
>
> Yes try GMF (or Graphiti). There's nothing in EMF that will let you
> create an instance from an arbitrary EObject; there's only
> EcoreUtil.create to let you create an instance of an EClass. In other
> words, Ecore itself is the only metamodel that directly supports
> creating model instances.
>
>
> On 06/08/2013 9:55 PM, Mahsa P wrote:
>>
>> Ed Merks wrote on Tue, 06 August 2013 03:44
>>> Mahsa,
>>>
>>> Comments below.
>>>
>>> On 06/08/2013 8:57 AM, Mahsa P wrote:
>>> > I'm so sorry if i explain bad!
>>> >
>>> > my .ecore file is metamodel likes UML models and model witch
>>> should be > created from it should be one instance from it.
>>> I see. EMF only directly supports creating instances for the Ecore
>>> metamodel, i.e., you can create an EObject given an EClass. If
>>> you have some EObject instance of some Ecore model, e.g., a UML
>>> Class from the UML model, there is no support for creating an
>>> instance of that. For something like UML (or XML Schema) there is
>>> support for mapping UML models (or XML Schema models) to
>>> corresponding Ecore models, and from that you can of course create
>>> an instance. But that's all.
>>> > i need to select elements of metamodel(.ecore file) and connect
>>> them > for designing one instance from .ecore! this work is like
>>> create model > from UML! i think GMF could make graphical IDE for
>>> instancing of > .ecore. i'm grateful if know your idea.
>>> This sounds a little different from your first sentence. With GMF or
>>> Graphiti you can create graphical visualizations/editors for any
>>> Ecore model to work with instances. That's how Papyrus provides
>>> diagrams for editing UML graphically. Questions about such things
>>> should be directed to the GMF newsgroup, but the response will
>>> likely be similar, i.e., have you tried out the GMF tutorials?
>>
>> My mean is witch you understand from second sentences. I read about
>> GMF and work by it. but i thought EcoreUtil could be useful for me!
>> Thank alot for all your answers:)
>
|
|
|
Re: create model from .ecore [message #1081598 is a reply to message #1081583] |
Wed, 07 August 2013 12:38 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
Mahsa,
I can't help with GMF. Often it seems Graphiti questions are answered
more quickly.
On 07/08/2013 2:20 PM, Mahsa P wrote:
> Thanks Ed Merks. i'm using GMF it's good but i have one problem for
> GMF that i have introduced it in GMF newsgroup but don't get answer yet!
> Ed Merks wrote on Wed, 07 August 2013 02:21
>> Mahsa,
>>
>> Yes try GMF (or Graphiti). There's nothing in EMF that will let you
>> create an instance from an arbitrary EObject; there's only
>> EcoreUtil.create to let you create an instance of an EClass. In
>> other words, Ecore itself is the only metamodel that directly
>> supports creating model instances.
>>
>>
>> On 06/08/2013 9:55 PM, Mahsa P wrote:
>> >
>> > Ed Merks wrote on Tue, 06 August 2013 03:44
>> >> Mahsa,
>> >>
>> >> Comments below.
>> >>
>> >> On 06/08/2013 8:57 AM, Mahsa P wrote:
>> >> > I'm so sorry if i explain bad!
>> >> >
>> >> > my .ecore file is metamodel likes UML models and model witch
>> should >> be > created from it should be one instance from it.
>> >> I see. EMF only directly supports creating instances for the
>> Ecore >> metamodel, i.e., you can create an EObject given an
>> EClass. If you >> have some EObject instance of some Ecore model,
>> e.g., a UML Class >> from the UML model, there is no support for
>> creating an instance of >> that. For something like UML (or XML
>> Schema) there is support for >> mapping UML models (or XML Schema
>> models) to corresponding Ecore >> models, and from that you can of
>> course create an instance. But >> that's all.
>> >> > i need to select elements of metamodel(.ecore file) and connect
>> >> them > for designing one instance from .ecore! this work is like
>> >> create model > from UML! i think GMF could make graphical IDE for
>> >> instancing of > .ecore. i'm grateful if know your idea.
>> >> This sounds a little different from your first sentence. With
>> GMF >> or Graphiti you can create graphical visualizations/editors
>> for any >> Ecore model to work with instances. That's how Papyrus
>> provides >> diagrams for editing UML graphically. Questions about
>> such things >> should be directed to the GMF newsgroup, but the
>> response will likely >> be similar, i.e., have you tried out the GMF
>> tutorials?
>> >
>> > My mean is witch you understand from second sentences. I read about
>> > GMF and work by it. but i thought EcoreUtil could be useful for me!
>> > Thank alot for all your answers:)
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Mon Sep 23 12:47:22 GMT 2024
Powered by FUDForum. Page generated in 0.04889 seconds
|