0

i am new to Quartz , i have populated the database with my job details , and triggers .What i want to do is get the currently executing trigger's TRIGGER_NAME value in the Job's execution .How do i do this ? I want to use the trigger name to search my database . THANKS

luxury
  • 53
  • 1
  • 6

2 Answers2

2

This information is available in the context.

public void Execute(IJobExecutionContext context)
{
        Console.WriteLine("Execute method for job {0} in group {1} called at {2}", context.JobDetail.Key.Name, context.JobDetail.Key.Group, DateTime.Now);
        Console.WriteLine("Trigger {0} in group {1} was fired", context.Trigger.Key.Name, context.Trigger.Key.Group);
}
jvilalta
  • 6,679
  • 1
  • 28
  • 36
0

You call

scheduler.GetCurrentlyExecutingJobs()

to get a list of JobExecutionContext objects. These contain references to the jobs and their triggers.

Nick Patsaris
  • 2,118
  • 1
  • 16
  • 18
  • Please can you provide a code sample , thanks . I want to obtain the name of the current TRIGGER . – luxury May 10 '13 at 22:21