Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Metameta modeling with EMF?(Going from an ecore metametamodel, to create an instance that is a metamodel, from which we create the M0 model)
Metameta modeling with EMF? [message #1422242] Fri, 12 September 2014 14:44 Go to next message
Poissy B. is currently offline Poissy B.Friend
Messages: 31
Registered: June 2012
Member
Hello,

I have been stumbling with this issue for some time now and I don't think I can pursue it any further by myself and decided to kindly ask for your help.

Here is my problem: I am creating a business process metamodel (MA): flownodes (eg. activities, events...) each referencing a nextAction and previousAction flownode reference, constraints, inputs/outputs, etc. From metamodel MA, I want to create an instance (MB) that, say, have activity "Prepare order", followed by (i.e. nextAction=) "Ship Order", followed by "Receive Payment". "Prepare order" has one input object of type "Order" and 1..* objects of type Product and one output object of type Package.
(Note.: Order, Product and Package are EClasses from another ecore model serving as the informational model, that I include)

What I am trying to achieve it this:
1. I create the MA ecore metamodel;
2. Using MA's editor, I want to create MB model that I could save as an ecore file
3. Using MB's ecore, I generate java code and editors to create concrete instances of MB.

One way I was able to do that is by:
- Create an MA.ecore
- Create an MB model and include MA. Each activity has FlowNode as its super type.
- Generate the code and create instances of MB

This works fine but not in an elegant way: I have no way to enforce that an instance of "PrepareOrder" must have a an instance of "ShipOrder" since I cannot redeclare the "nextAction" feature. Sure I can do that with OCL but that is still not elegant enough for me (e.g. in the editor, the nextAction dropdown will give me all the FlowNode instances).

I hope this problem makes sense to you guys and you could point me to the right direction, or at least confirm that I shouldn't persue this. My problem generalizes as: is it possible to metametamodel with EMF? That is going from an ecore to generate an ecore?

Thanks for your help!

Anis
Re: Metameta modeling with EMF? [message #1422308 is a reply to message #1422242] Fri, 12 September 2014 16:57 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6457
Registered: July 2009
Senior Member
Hi

As you've discovered, EMF supports structural metamodeling and that is
not enough. For more interesting metamodels you need constraints.

If you use UML you can express the constraints as OCL within Stereotypes.

In EMF, you can use the OCL->Load Resource to load additional
constraints that will apply during Validate / OCL->Validate. See the
Complete OCL tutorial.

The Sample Ecore Editor is just that, a sample. If you want to exploit
your constraints to affect the menu entries feel free to contribute an
enhancement.

Regards

Ed Willink


On 12/09/2014 15:44, Poissy B. wrote:
> Hello,
> I have been stumbling with this issue for some time now and I don't
> think I can pursue it any further by myself and decided to kindly ask
> for your help.
> Here is my problem: I am creating a business process metamodel (MA):
> flownodes (eg. activities, events...) each referencing a nextAction and
> previousAction flownode reference, constraints, inputs/outputs, etc.
> From metamodel MA, I want to create an instance (MB) that, say, have
> activity "Prepare order", followed by (i.e. nextAction=) "Ship Order",
> followed by "Receive Payment". "Prepare order" has one input object of
> type "Order" and 1..* objects of type Product and one output object of
> type Package. (Note.: Order, Product and Package are EClasses from
> another ecore model serving as the informational model, that I include)
>
> What I am trying to achieve it this: 1. I create the MA ecore metamodel;
> 2. Using MA's editor, I want to create MB model that I could save as an
> ecore file
> 3. Using MB's ecore, I generate java code and editors to create concrete
> instances of MB.
> One way I was able to do that is by: - Create an MA.ecore
> - Create an MB model and include MA. Each activity has FlowNode as its
> super type. - Generate the code and create instances of MB
>
> This works fine but not in an elegant way: I have no way to enforce that
> an instance of "PrepareOrder" must have a an instance of "ShipOrder"
> since I cannot redeclare the "nextAction" feature. Sure I can do that
> with OCL but that is still not elegant enough for me (e.g. in the
> editor, the nextAction dropdown will give me all the FlowNode instances).
> I hope this problem makes sense to you guys and you could point me to
> the right direction, or at least confirm that I shouldn't persue this.
> My problem generalizes as: is it possible to metametamodel with EMF?
> That is going from an ecore to generate an ecore?
>
> Thanks for your help!
>
> Anis
>
Previous Topic:Ecore Tools and Ecore digram in eclipse Luna
Next Topic:Deserialize an Ecore File
Goto Forum:
  


Current Time: Mon Sep 16 10:08:47 GMT 2019

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

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

Back to the top