Schedule Based Tasks
For solutions that need to be executed at specific times of day or after a certain amount of time since the last time it was executed a schedule based task should be used. EngageIP has a C# interface, IJob, that allows for integration with a time based scheduler. A custom code solution that has implemented the IJob interface can have a scheduled execution time by inserting a row into the database table JobSchedule for this specific custom code solution. It is common for solutions that are using the scheduler to have repeated scheduled executions at periodic intervals. Each execution invokes the Run method from the implemented IJob interface.
For solutions that are not time based executions
For an example use to archive old usage data records (UDR) read this page:Â Archiving Old Records (UDR System).
Interfaces
The following interfaces are available to be used:
IJob - Represents a job which is called when an entry in the Job table has a matching name. Jobs may be scheduled via the JobSchedule table or some other process that inserts into the Job table
IFileProcessingJob - Represents a file processing job which is called when an entry in the Job table has a matching name. Jobs may be scheduled via the JobSchedule table or some other process that inserts into the Job table
The following section contains the IJob interface and the IFileProcessingJob interface.
public interface IJob {
string Name { get;}
string Description { get;}
/// <summary>
/// Called by the JobAgent to perform the work.
/// </summary>
/// <param name="job"></param>
/// <returns>True if job is finished</returns>
bool Run(DomainModel.Job job);
}
public interface IFileProcessingJob : IJob {}
Â