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 System.ComponentModel;

using Traxion.IM.Library.Logging;

using Traxion.IM.Scheduler.Plugins.Rules;

 

namespace Traxion.IM.Scheduler.Plugins.Custom

{

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

public class CustomConditionExample : 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)

  {

    log.TraceFormat("Always return true");

    return true;

  }

 

  [Browsable(false)]

  public string FailReason

  {

    get { return String.Empty; }

  }

 

  [Category("\tGeneral"), DisplayName("Example setting"), Description("This is the example description"), DefaultValue("test")]

  [RequiredRule]

  public string ExampleSetting { get; set; }

 

  [Category("Credentials"), DisplayName("Username"), PropertyOrder(1), Description("Username for authentication")]

  [RequiredRule]

  public string Username { get; set; }

 

  [Category("Credentials"), DisplayName("Password"), PasswordPropertyText(true), PropertyOrder(2), Description("Password for authentication")]

  [RequiredRule]

  public string Password { 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.

 

Below you can see the interface IM Sequencer generates for this plugin based on the attributes defined above each property

 


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