Navigation:  IM Sequencer > Custom plugin development >

Custom condition plugin

Previous pageReturn to chapter overviewNext page

This section describes how you need to develop a "condition plugin"

 

To create a condition plugin you will need to reference the file Traxion.IM.Scheduler.dll and implement the following interface:Traxion.IM.Scheduler.Plugins.ICustomConditionPlugin. This interface has one method and one property that needs to be implemented.
 

(Method) IsValid (DateTime) - This method is called to evaluate if the scheduled task is allowed to start. When returning "True" it will start when "False"  is returned the Task is not yet started. Conditions are evaluated numerous times (configurable) until the condition evaluates to "True" or the maximum conditions check time is exceeded.
(Property) FailReason - This property contains information that indicates why a condition evaluates to "False"

 

Below is a example condition plugin implementation:

 

using System;

using Traxion.IM.Library.Logging;

using Traxion.IM.Scheduler.Plugins;

 

namespace Traxion.IM.Scheduler.Conditions.Custom

{

[CustomPluginClass(Name = "Custom condition", Description = "Example custom condition, always validates to 'true'")]

public class CustomCondition1 : ICustomConditionPlugin

{

  // Create a logger for use in this class

  private static readonly ApplicationLog log = ApplicationLogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

 

  public bool IsValid(DateTime now)

  {

    return true;

  }

 

  public string FailReason

  {

    get { return String.Empty; }

  }

 

  [CustomPluginAttribute(Name = "Example setting", Description = "This is an example setting", Required = true, DefaultValue = "example", Secure = false)]

  public string ExampleSetting { get; set; }

}

}

 
 

As you can see this condition has a reference to the logging implementation.
 
When this condition is evaluated it always returns "True", indicating that the condition has passed.

 


Page url: http://www.traxionsolutions.com/imsequencer/help/index.html?customconditiondevelopment.htm