public bool DeleteTrigger(IIntegrationJobTrigger triggerDefinition) { var jobType = GetRegisteredJobTypeByName(triggerDefinition.JobType); var triggerKey = TriggerKeyFactory(triggerDefinition.Id, jobType); return(Scheduler.UnscheduleJob(triggerKey)); }
public IJobDetail JobDetailFactory(Type jobType, IDictionary <string, string> parameters, IIntegrationJobTrigger triggerDefinition) { try { var integrationJob = Activator.CreateInstance(jobType) as IIntegrationJob; var jobDetailsDataMap = new JobDataMap(); jobDetailsDataMap.Put("Dispatcher", Dispatcher); jobDetailsDataMap.Put("IntegrationJob", integrationJob); jobDetailsDataMap.Put("Parameters", parameters); return(JobBuilder.Create <IntegrationJobDispatcherJob>() .SetJobData(jobDetailsDataMap) .StoreDurably(true) .WithIdentity(triggerDefinition.Id, jobType.FullName) .Build()); } catch (Exception exception) { var message = string.Format("Error creating job detail for type: {0}", jobType.FullName); Log.Error(x => x(message), exception); throw new Exception(message, exception); } }