Custom OCL operations in Java

It is also possible to integrate custom OCL operations on UML/ECORE and arbitrary meta models which are implemented in Java. The custom operations are realized as Eclipse extension points and have to be customized through the following extensions (defined in info.squam.ocl.editor.community.core):

Each of the extensions above need to specify a custom Java class (in the custom plugin.xml) implementing specific interfaces in order to be recognized as an extension: Custom OCL operations must follow a naming convention:

Creating a custom OCL operation on UML

  1. create a new Eclipse Plug-in Project (e.g. called custom.ocl.test)
  2. add dependencies to info.squam.ocl.editor.community.core AND org.eclipse.ocl.uml to your MANIFEST.MF
  3. Add dependencies

  4. create a Java class inside the new Plug-in Project (e.g. called UMLOperation_1) implementing the interface info.squam.ocl.editor.community.core.extensions.customocl.ICustomUMLOperation
  5. implement all interface methods according to the JavaDoc explanation like UMLOperation_1.java
  6. add the info.squam.ocl.editor.custom.uml extension in the MANIFEST.MF accordingly:
  7. Add extension

  8. The custom OCL operation is integrated in the code completion processor and is highlighted in tomato-red
  9. Custom OCL operations in the editor