I need to check the status of a VS workflow a number of times for status and send email if task incomplete. Usually I create a Sharepoint timer Job. As I am required to check numerous times a day 10.30, 16:00, 1800 mon-fri and 10.30,12:00 Saturday. Would it be better to create a Console Application ?
Someone mentioned a timer job would be better. i.e instantiate the timer job for every period. But I dont know how to do this from VS. I created a feature that adds and removes the timer job within VS .
Any guidance appreciated.
UPDATE :
I see your point about registering multiple jobs in the code. Could you possibly have a look at code for me pls, this is the feature as part of tutorial. http://dotnetfinder.wordpress.com/2010/07/24/creatingcustomsharepointtimerjob2010/
namespace DT_CustomTimer.Features.Feature1
{ /// /// This class handles events raised during feature activation, deactivation, installation, uninstallation, and upgrade. /// /// /// The GUID attached to this class may be used during packaging and should not be modified. ///
[Guid("a959005c-5ab7-49fe-934e-5c79b339907f")]
public class Feature1EventReceiver : SPFeatureReceiver
{
const string List_JOB_NAME = "ListLogger";
// Uncomment the method below to handle the event raised after a feature has been activated.
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPSite site = properties.Feature.Parent as SPSite;
// make sure the job isn't already registered
foreach (SPJobDefinition job in site.WebApplication.JobDefinitions)
{
if (job.Name == List_JOB_NAME)
job.Delete();
}
// install the job
DT_TimerJob listLoggerJob = new DT_TimerJob(List_JOB_NAME, site.WebApplication);
SPMinuteSchedule schedule = new SPMinuteSchedule();
schedule.BeginSecond = 0;
schedule.EndSecond = 59;
schedule.Interval = 5;
listLoggerJob.Schedule = schedule;
listLoggerJob.Update();
}
// Uncomment the method below to handle the event raised before a feature is deactivated.
public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
{
SPSite site = properties.Feature.Parent as SPSite;
// delete the job
foreach (SPJobDefinition job in site.WebApplication.JobDefinitions)
{
if (job.Name == List_JOB_NAME)
job.Delete();
}
}
// Uncomment the method below to handle the event raised after a feature has been installed.
//public override void FeatureInstalled(SPFeatureReceiverProperties properties)
//{
//}
// Uncomment the method below to handle the event raised before a feature is uninstalled.
//public override void FeatureUninstalling(SPFeatureReceiverProperties properties)
//{
//}
// Uncomment the method below to handle the event raised when a feature is upgrading.
//public override void FeatureUpgrading(SPFeatureReceiverProperties properties, string upgradeActionName, System.Collections.Generic.IDictionary<string, string> parameters)
//{
//}
}
}