[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.gmf] Customizing initializers with more OCL
|
- From: Christophe Bouhier <dzonekl@xxxxxxxxx>
- Date: Thu, 04 Dec 2008 11:27:59 +0100
- Newsgroups: eclipse.modeling.gmf
- Organization: EclipseCorner
- User-agent: Thunderbird 2.0.0.16 (Macintosh/20080707)
Hi,
I am looking for a bit of advise on how to achieve my next challenge:
What I want to do is to have a more customized way to enforce
constraints when linking nodes in a diagram.
1. I have two models, one model holds the rules for allowing
relationships, this model is not edited by the diagram editor. The
second model has the nodes and relationships and manipulated with the
diagram editor.
From the GMF tutorial, I learned constraints can be set in i.e.
LinkMapping using the OCL language. Sniffing around a bit, I believe
this goes into a class called "ElementInializers" (in the package
*.providers).
Now back to my case, where I need to constrain based on the values in my
second model.
1. Should I use the "LinkMapping" constraint principle, and try to use
OCL to query a second model? (Is this even possible with OCL)
2. Shall I manually extend the "ElementInitializers" class to add
queries to my second model?
3. Am I totally of, and there is a more practical way to do these things?
Many thanks, Christophe Bouhier