Customize Behaviour

 

TASKANA allows to customize and modify it’s behaviour through the use of dedicated Service Provider Interfaces (SPI). Each SPI defines an interface that can be implemented by custom code. This is a common approach for Java developers to extend their applications. You can find out more about the background and the details in the Java documentation: https://docs.oracle.com/javase/tutorial/sound/SPI-intro.html

In order to use an SPI within TASKANA, you must

  • create a class that implements the relevant interface.

  • place that class into the classpath of your application

  • provide a control file with full name of the SPI (e. g. pro.taskana.spi.task.api.CreateTaskPreprocessor) in the subdirectory META-INF/services of the classpath. This control file must contain the fully qualified classname (including the package) of the class that implements the relevant interface. This control file is used by the ServiceLoader to load the custom class at runtime. The control file may contain multiple classes that implement the interface. Each implementation should be declared in a new line.
    All implementations will be used consecutively in the declaration order of the control file.

If you provide one or multiple implementations according to the description above, TASKANA will invoke the implementations at a specific point. The Javadoc of each SPI describes the conditions for the implementation to be executed.

Currently, TASKANA provides the following SPIs: