Develop an Apromore Plugin
Skip to end of metadata
Go to start of metadata

The development of an Apromore Plugin against an existing API is kept as simple as possible. Before starting please ensure you setup your development environment as described here. If you are missing an API to develop against, please read the Plugin API How To.

If you encounter any error or issues using this How To, please raise an issue in our Apromore JIRA.

Basics

First you should know (read) about the Interface that you want to implement. Best, have a look at the sources of existing plug-ins and the Plug-in API you want to develop against:

Creating a new Plugin project

Each Plugin API has its own directory under "Apromore-Plugins" and if you want to include your Plugin into the Apromore source code control, then you need to place your Plugin project into the correct directory. (sooner or later)

  1. Make sure Maven binaries are in your path. (Maven Installation)
  2. Make sure you checked out the Apromore source code and you can build it successfully using the command:

  3. Change your directory to your Plugin APIs directory. (Example uses canoniser-api)

  4. You need to create a new Maven module (project) for your plug-in. The easiest way of doing so, is to use a copy of an existing plug-in (here yawl-canoniser) and adjust the pom.xml file to your need. The following block shows you the parts of the pom.xml you (probably) need to change:

    Change canoniser-api to the artifactId of the plug-in API you are using (e.g. deplyment-api for a Deployment plug-in).

  5. Delete the existing sources in /src/main/java/ and /src/test/java/
  6. Create your own plug-in class that implements the API by extending the provided "default" implementation or implementing the interface. For example a Canoniser plug-in should extend DefaultAbstractCanoniser or implement the interface Canoniser. Important: Your plug-in class has to be annotated with the Spring annotation @Component("pluginName") so the plug-in framework can discover it.
  7. If you choose to extend the "default" implementation, then you can take advantage of the built-in configuration mechanism. You need to the configuration file /src/main/resources/org.apromore.canoniser.yawl.YAWL22Canoniser.config as described in DefaultPlugin and change the configuration according to your own needs.
  8. The last step is to make your plug-in visible to the OSGi environment, so it can be picked up by Apromore. Please edit the file src/main/resources/META-INF/spring/osgi-context.xml and adjust the following lines to reflect your plug-in:

    You need to change the base package and adjust yawlCanoniser to the component name you choose in Step 6.

  9. Now build your plugin using Maven:

  10. If you see BUILD SUCCESS everything works and you can start modifiying the generated Java files in /src/main/java/...

Examples

YAWL Canoniser

YAWL Deployment Plugin

  • No labels