开发者

GMF live constraints - validation

I have an emf model and i'd like to make a GMF editor to create instances of this metamodel.I'd like also开发者_运维问答 some live constraints to avoid some connections between the components of my EMF model.e.g:My EMF consists of A,B,C,D components which derive from a General class called F and there is reference within F which connects F->F,as such this is able to provide me with connections in between the A,B,C,D components. But when i am at the GMF editor i'd like a mechanism to avoid connection A->B and allow only connection A->C. I read that this is able to be achieved with OCL language and link constraints that are able to be added at the gmfmap file. But i couldn't find any tutorial with the vocabulary of OCL and examples doing that live validation Any directions from someone?


After a deeper search I found a very useful and fast framework for validation. It is called Eugenia from the Epsilon group.

Eugenia lets you create all the appropriate files for the final GMF editor through a single file (extremely awesome,because otherwise you have to declare gfmtool, gmfgraph, etc by your own) and afterwards you can create a new EVL file which holds the constraints and the invariants of your model.The mapping is been doing easily by providing and extension point at your metamodel URI and all you have to do is to include your new plugin which containts the evl file at your final Eclipse configuration. http://www.eclipse.org/gmt/epsilon/doc/articles/evl-gmf-integration/

(Be careful, do not generate the diagram code as an RPC application because the RPC is not going to work. For any further information have a look here : http://giampow.blogspot.com/2010/06/eclipse-rcp-application-custom-problems.html )

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜