in my Previous article I have explained how we can create jobs and triggers dynamically.in this article i will show you how we can get all running jobs and triggers in quartz.net 3.x
using Quartz;
using Quartz.Impl;
using Quartz.Impl.Matchers;
class Program
{
var allTriggerKeys = scheduler.GetTriggerKeys(GroupMatcher<TriggerKey>.AnyGroup());
foreach (var triggerKey in allTriggerKeys.Result)
{
var triggerdetails = scheduler.GetTrigger(triggerKey);
var Jobdetails = scheduler.GetJobDetail(triggerdetails.Result.JobKey);
Console.WriteLine("IsCompleted -" + triggerdetails.IsCompleted + " | TriggerKey - " + triggerdetails.Result.Key.Name + " Job key -" + triggerdetails.Result.JobKey.Name);
}
using Quartz;
using Quartz.Impl;
using Quartz.Impl.Matchers;
class Program
{
var allTriggerKeys = scheduler.GetTriggerKeys(GroupMatcher<TriggerKey>.AnyGroup());
foreach (var triggerKey in allTriggerKeys.Result)
{
var triggerdetails = scheduler.GetTrigger(triggerKey);
var Jobdetails = scheduler.GetJobDetail(triggerdetails.Result.JobKey);
Console.WriteLine("IsCompleted -" + triggerdetails.IsCompleted + " | TriggerKey - " + triggerdetails.Result.Key.Name + " Job key -" + triggerdetails.Result.JobKey.Name);
}
}
kindly refere my Previous article for more understanding