User information
 Loading ...
Show article in Knowledge Base

 Plugins / hooks ‑ general instructions Export knowledge base Export     SubscribeSubscribe      Show article info

Plug-in / hook architecture in VisionFlow

A simple plugin architecture are available for the installed version of VisionFlow. Using that you can execute your own custom business logic when an issue or a user is:

  • Created
  • Updated
  • Deleted

To enable a plugin you should implement one or more of the following interfaces, ProjectIssueListener, SystemUserListener, forumListeners, documentListeners, workLogListeners, CustomerListener or issueHistoryListeners and then register the implementation-classes in a file named that should be placed in the WEB-INF/classes directory.


For example to listen for issue or  user events you should implement one or both of two interfaces, ProjectIssueListener and SystemUserListener.

package se.visionera.VisionFlow.event;

public interface ProjectIssueListener {
    void objectCreated(BaseEvent event) throws VetoException;
    void objectLoaded(BaseEvent event) throws VetoException;
    void objectRemoved(BaseEvent event) throws VetoException;
    void objectStored(BaseEvent event) throws VetoException;
public interface SystemUserListener {
    void objectCreated(BaseEvent event) throws VetoException;
    void objectLoaded(BaseEvent event) throws VetoException;
    void objectRemoved(BaseEvent event) throws VetoException;
    String objectStored(BaseEvent event, String passwordInClearText) throws VetoException;


Sample plugins included in the distribution

The easiest way to learn how you can implement you own plugin is with a sample.


In the distribution we have included one sample plugin for issue changes and one sample plugin for user changes. The plugins are available in the directory: 'WEB-INF/src/se/visionera/visionproject/plugins'. 

The samples will print out information text to the console, like:
The issue 'Testing plugin' is about to be updated
The issue 'Testing plugin' was updated

NOTE! The samples are also included pre-compiled so if you would like to test them you can just create the file and add these lines:

BaseEvent input parameter

The BaseEvent parameter contains core data that you my need including the following:

isPreEvent : If true then the method is called before the actual action has been executed. For example in the case of objectStored then isPreEvent is first true 
before the object has been stored and isPreEvent is false after the object has been stored to the database.

systemUser: The SystemUserVO contains information about the user that made the change or requested a method to be executed.

source: The object being stored or created, it contains all new values.  

originalSource: The original object that is being stored, and it can be used to compare with the new object (source) that is being stored.

Compile the classes

We have included a compile-script for Windows and Linux that will compile all the files that are available in the directory 'WEB-INF/src/se/visionera/visionproject/plugins'. The scripts are named 'compile-plugins.bat' and '' respectively and they are available in the 'WEB-INF/src' directory.

"Register" the plugin

First you should create a file named in the 'WEB-INF/classes' directory.

In this file you "register" your plugin-classes. It should have two  lines like this:



If you want, you can also add listeners / plugins for the following events:






NOTE! To  the right of the equal sign you can have one or more classes that  implements the respective interfaces. If you have more than one class  for each interface you should separate them with a comma like this:




  • You always have to restart Tomcat if you make changes to the plugin-classes or the file!
  • If you are updating a user object using the Web Service API, a change event on will not be triggered!

User comments
 Loading ...