How To Build Reusable Plugins

Build your own DataMinder plugins and let DataMinder run them for you

Seriously! It's not that hard!

There are just 8 plugin interfaces you need to know!

Or put in another way. There are plugins that are part of process flow and actively modify process data. Those plugins all have some kind of run(...) method.

And then there are plugins (without the run(...) method) . And they are not part of the standard flow. Instead, they are used to start processes or have some common functionality that other plugins may use.

Choose a plugin-interface to implement based on what it should do.

All plugins should preform a single well-defined action. To get an idea check out the plugins provided with DataMinder.

A process contains a table that is sent to each plugin in the process. One by one. Each plugin has full access to the table and can modify it.

You build a process by connecting a number of plugins together. The data table is passed on to one plugin at a time.

Javadoc, code generator page and help files

DataMinder help files can be found at Support.

More information about plugin development can be found in the help files at "Plugin Development".

For Java doc for the plugin interfaces go to JavaDoc.

And you can autogenerate plugin code using our code generation page here.

How it works: A very simple illustration of how plugins make up a process

In case you think this is "to simple", please have a look at all the plugin types listed at How it works and consider what YOU could build using them.

Short plugin description

A more detailed description further down.

Plugin interface type 1-3:
Data plugins. Do something with data, input data to table or output data from table

Implement a DMTask, DMInput or DMOutput.

Plugin interface type 4:
Process flow plugin. End process, switch flow to another process or include a process

Implement a DMDecision. A DMDecision can work with data and when it returns tells DataMinder what to do next: continue with process, end process, redirect flow to another process or include some other process in the flow.

Plugin interface type 5-7:
Start process plugins. Based on an event, scheduled or run manually

Implement a DMService and DMListener combination or create a DMScheduler to start process on specific times.

You can always run a process manually if you like.

Plugin interface type 8:
Share common functionality plugin

Implement a DMCommonObject to allow other plugins to share common functionality like connection to data sources or a cache.

Checkout examples of all plugin interfaces implemented

We have implemented an example library which shows the code for each plugin type.

Download it at our DOWNLOAD page.

To compile the examples you only need to add our public api jar-file. It comes with each DataMinder installation:

{installation folder}/DataMinder/Server/PluginDevelopment/DMPublicAPI.jar

DataMinder help files can be found at Support.

More information about plugin development can be found in the help files at "Plugin Development".

For Java doc for the plugin interfaces go to JavaDoc.

And you can autogenerate plugin code using our code generation page here.

More detailed description of each plugin interface

DMObject: Superinterface with common methods

Each plugin must have: name , description of what it does and how it works, parameters to configure behaviour, author and version.


String getName()

String getDescription()

DMParameter[] getParameters()

float getVersion()

String getAuthor()

  

and the lifecycle methods called when the plugin is first created, deactivated or when its parameters have been updated.


void activate( context,  initParameterValues)

void deActivate()

void initParametersHaveBeenUpdated(initParameterValues)

  

We collect all common methods in superinterface DMObject [javadoc]

The activate and gets value for parameters DMInitParameterValues [javadoc] and the plugin context DMPluginContext [javadoc]

DMTask, DMInput, DMOutput: Work with data

The most common interfaces you will implement. DMTask, DMInput, DMOutput [javadoc] These 3 plugins work with table data. The DMInput and DMOutput are sub-interfaces to DMTask and are just "marker" interfaces to inform users that a plugin retrieves or writes data from/to an external data source.

All you need to do is implement the run-method and work with data, get or output data externally.

You get access to all data using the DMTable [javadoc] object and you get all values for the plugin parameters from DMRunParameterValues [javadoc].


//The run method where you put implementation
DMResult run(DMTable, DMRunParameterValues)
{

}

DMDecision: Decide what to do next

DMDecision [javadoc] is basically a DMTask that may redirect the flow of process depending on what happens during the run.

The run method for a DMDecision returns a DMResultWithDecisionOption [javadoc] with one of the following directives (from the DMWhatNext [javadoc] object ) back to DataMinder.

For more information please see our example implementation available for download Download.

DMScheduler: When to star a process

DMScheduler [javadoc] lets DataMinder know when the process is to be run the next time.


long getNextRunTimeInMilliseconds(nowInMilliseconds)

void setLastStartedTimeInMilliseconds(lastStartedTimeInMilliseconds)

  

DMService and DMListener: Start processes based on external events

DMService and DMListener [javadoc] start a process when something happens. Most common are the Http Services and Http listeners found in the default plugins. Used to create microservices.

In the sample implementation we have a file alternation service that starts processes when files are created, modified or deleted.

The DMService methods that keep track of the listeners listening to this service.


List<String> getRegisteredServiceListenerUids()

void registerServiceListener( listenerUid,  listenerInitParameters,  listenerInitParameterValues)

void unRegisterServiceListener(java.lang.String listenerUid)

  

And the DMListener method. It only lets DataMinder know which DMServices this DMListener can work with.

 String[] getDMServiceInterfaces()
  

DMCommonObject: Shared functionality to reuse among plugins

DMCommonObject [javadoc] contains common functionality to be reused by plugins.

For example a reusable connection to data sources or a server cache for objects.

Other plugins send a data table to DMCommonObject with optional parameters. The DMCommonObject updates the table with data.

 DMResult call( table, nameValues[]): Called by other plugins e.g. connecting to a data source.
  

Back to top

Email:   Address: LucidArt AB Visby Sweden