1

I am trying to create a stand alone Java application that accepts an xmi model and an OCL file containing constraints applied to the model's meta-model. The application then validates the model against the ocl.

I have managed to do this inside eclipse using the EMF. However when I start to create the java app, many libraries are missing. Some of which I was able to locate in the plugins directory but some seem to be missing.

For example

org.eclipse.ocl.examples.library.oclstdlib.OCLstdlib;

cannot be found.

Is there a straight forward way, using the EMF to accomplish what I am trying to do. I have been trying to create something very much like the following:

http://subversion.assembla.com/svn/da_sw_tf/trunk/OCL/src/ocl/OCLEvaluator.java

4

2 回答 2

2

缺少某些东西,通常意味着配置错误。如果没有更多信息,我只能向您指出OCL 帮助,它解释了为什么以及如何进行一些手动注册以便在独立模式下执行 OCL 代码。

取自帮助:

“如果您在 Eclipse 中使用 Eclipse OCL,您应该会发现插件注册机制会自动为您提供适当的注册。

但是,如果您在 Eclipse 之外使用 Eclipse OCL,例如在 JUnit 测试中,您必须在代码中提供相应的注册。”

于 2013-10-15T18:37:40.893 回答
0

eclipse 插件位于.eclipse 下的我的个人文件夹中。我完全忘记了插件的个人实例。相反,我重新安装了所有东西,只是意识到这些库不在安装目录插件文件夹中。

从以下链接安装 EMF 和 OCL 插件是正确的。

http://download.eclipse.org/releases/kepler

注意:您可能需要更改上面的 url 以适应您特定的 eclipse 版本。

于 2013-10-15T21:13:41.323 回答