GMF 实时约束 - 验证

发布于 2024-10-02 16:17:28 字数 300 浏览 0 评论 0原文

我有一个 emf 模型,我想制作一个 GMF 编辑器来创建此元模型的实例。我还想要一些实时约束,以避免我的 EMF 模型组件之间的某些连接。例如:我的 EMF 由 A 组成, B、C、D 组件派生自称为 F 的通用类,并且 F 内有连接 F->F 的引用,因此这能够为我提供 A、B、C、D 组件之间的连接。 但是当我在 GMF 编辑器时,我想要一种机制来避免连接 A->B 并只允许连接 A->C。 我读到这可以通过 OCL 语言和链接约束来实现,这些约束可以添加到 gmfmap 文件中。 但我找不到任何包含 OCL 词汇的教程以及进行实时验证的示例 有人指示吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心舞飞扬 2024-10-09 16:17:28

经过更深入的搜索,我发现了一个非常有用且快速的验证框架。它被称为Eugenia,属于Epsilon族。

Eugenia 允许您通过单个文件为最终 GMF 编辑器创建所有适当的文件(非常棒,因为否则您必须自己声明 gfmtool、gmfgraph 等),然后您可以创建一个新的 EVL 文件,其中包含约束和通过在元模型 URI 处提供扩展点,可以轻松完成映射,您所要做的就是在最终 Eclipse 配置中包含包含 evl 文件的新插件。 http://www.eclipse.org/gmt/epsilon /doc/articles/evl-gmf-integration/

(请注意,不要将图表代码生成为 RPC 应用程序,因为 RPC 将无法工作。有关任何详细信息,请查看此处:http://giampow.blogspot.com/2010/06/eclipse -rcp-application-custom-problems.html

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 )

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文