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.
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:
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)
- Make sure Maven binaries are in your path. (Maven Installation)
Make sure you checked out the Apromore source code and you can build it successfully using the command:
Change your directory to your Plugin APIs directory. (Example uses canoniser-api)
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.xmlfile to your need. The following block shows you the parts of the pom.xml you (probably) need to change:
canoniser-apito the artifactId of the plug-in API you are using (e.g.
deplyment-apifor a Deployment plug-in).
- Delete the existing sources in
- 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.
- 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.configas described in DefaultPlugin and change the configuration according to your own needs.
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.xmland adjust the following lines to reflect your plug-in:
You need to change the base package and adjust
yawlCanoniserto the component name you choose in Step 6.
Now build your plugin using Maven:
If you see BUILD SUCCESS everything works and you can start modifiying the generated Java files in