|
Navigation: IM Sequencer > Custom plugin development |
![]() ![]()
|
From version 4.0 plugins are introduced as a new concept. This allows a developer to develop their own plugins that can handle work or can trigger a scheduled task. This chapter will help explain what these plugins are capable of doing and how they need to be developed.
There are 3 different types of plugins.
A trigger plugin is used to indicate if a scheduled task needs to start. For instance trigger if there is pending data within the FIM portal that needs to be synchronized.
The plugin will connect to the FIM portal and search for changes, if there are changes the trigger will trigger and the task starts.
A step plugin is the actual work that a scheduled task performs. For instance move or copy a file, run a batch file etc.
The condition plugin is used to control if the task is allowed to start, even if the "trigger" indicates that is should.
A condition will be checked before the task will start. The trigger already indicated that the task needs to start. The condition can validate if the task is allowed to start.
For instance only start when file 'x' is available or when management agent 'y' is running.
Implementation steps
When you start developing your own plugin you will need to follow the steps described below:
1. Reference the file Traxion.IM.Scheduler.dll in your development project. This file contains the interfaces that you need to implement.
2. Select the interface that you want to use
- Use Traxion.IM.Scheduler.Plugins.ICustomTriggerPlugin when you want a custom trigger
- Use Traxion.IM.Scheduler.Plugins.ICustomStepPlugin when you want a custom step
- Use Traxion.IM.Scheduler.Plugins.ICustomConditionPlugin when you want a custom condition
3. Write your code for the implementation
4. Decorate (see below) your class with the attribute CustomPluginClass and set the settings "Name" and "Description"
5. Define some plugin settings and decorate (see below) them with the CustomPluginAttribute attribute
6. Compile your code to a dll and copy this dll to the "<IM Sequencer installation root directory>\bin\plugins\"
7. Create a new scheduled tasks and select the appropriate option (Custom Trigger, Custom Step or Custom Condition).
8. When you dll implements the correct interface it will be selectable within the interface (as shown below)

Plugin class
You need to set the attribute CustomPluginClass on your class and define the settings "Name" and "Description". This information is used within the interface and can help the user understand what your plugin does.
Below is an example:
[CustomPluginClassAttribute(Name = "Example", Description = "Example trigger implementation")]
public class TriggerExample : ICustomTriggerPlugin
Plugin settings
When using the plugin you can define the settings that you need. The IM Sequencer will generate the appropriate interface according to the information within the plugin.
To create a setting you can define a "get and set property" and decorate it with the CustomPluginAttribute attribute. This attribute has the following settings:
| • | Name : This is the name of the attribute that is displayed within the IM Sequencer interface. |
| • | Order : The number that indicates the displayed order on the list when configuring via the IM Sequencer interface. |
| • | Description : This is the description. |
| • | Secure : If "True" the setting is stored encrypted. The IM Sequencer will take care for the encryption and decryption for you. |
| • | Required: If "True" this setting needs to have a valid value before you can create the plugin via the IM Sequencer interface. |
| • | DefaultValue: The default value that is displayed when you create a new plugin. |
| • | Multivalued: If set to true a larger editbox is displayed when editing the value. |
Below is an example setting called "Example".
[CustomPluginAttribute(Order = 1, Secure = false, Name = "Example setting", Required = true, Description = "Example Setting", DefaultValue = "localhost", Multivalued = true)]
public string Example { get; set; }
When creating this plugin through the interface the setting is displayed as shown below:

The default value is pre filled and an asterisk will be shown next to the "name" when the "required" field is set to "true"
Plugin state data
Some plugins have "data" that needs to be kept even when the scheduled task is not running. This is called state data. For instance there could be a variable that is holding the last watermark or the last retrieval object id. State data is primarily used within triggers so they can keep track for instance when they last triggered or what the last change date was for synchronization data. If a property has the state data attribute set the IM Sequencer will store the variable when the service is stopped or when the task is finished and it will be set again when the service is started again or the scheduled task is created in memory.
To create a state data attribute you will need to define a property and set the attribute CustomPluginStateDataAttribute. This attribute has no settings, below you will see an example:
[CustomPluginStateDataAttribute]
public String LastWaterMark { get; set; }
Plugin logging
If you want logging within your plugin you can use the logging mechanism that the IM Sequencer is using log4net. You need to reference the files log4net.dll and Traxion.IM.Library.dll and define the following statement within your class:
// Create a logger for use in this class
private static readonly ApplicationLog log = ApplicationLogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
When you want to log something you have 6 levels beginning with the lowest, more information about log4net can be read here:
| • | TRACE |
| • | DEBUG |
| • | INFO |
| • | WARNING |
| • | ERROR |
| • | FATAL |
Example: log.Trace("Start shouldtrigger");
This trace message will be included in the general IM Sequencer logging system and will be send to the "configured" appenders. The configuration for this appenders will tell the logging system what to do with it, for instance write to a file or send to the eventlog.
Read more about specific plugin implementations here:
| • | Step |
Page url: http://www.traxionsolutions.com/imsequencer/help/index.html?customplugindevelopment.htm