Reputation: 504
Is there a way to retrieve the values of variables in a JobDataMap before the job executes?
I am basically trying to display the job's next chained job name in a view. The name is in the Datamap.
Upvotes: 0
Views: 171
Reputation: 1178
You can implement custom ITriggerListener
and/or IJobListener
in which you can use the TriggerFired
and JobToBeExecuted
respectively in order to manipulate the job data map.
I use the TriggerFired
for example for a "generic" database logging (all jobs triggered are input to DB without putting the code in the job itself).
These interfaces are mentioned in the tutorial
http://quartznet.sourceforge.net/tutorial/lesson_7.html
couldn't find it in the 2.0 docs but the code in GitHub (read the XML docs): https://github.com/quartznet/quartznet/blob/master/src/Quartz/ITriggerListener.cs https://github.com/quartznet/quartznet/blob/master/src/Quartz/IJobListener.cs
Also found a short tutorial: http://jvilalta.blogspot.co.il/2010/11/creating-quartznet-joblistener.html
Upvotes: 1
Reputation: 6769
You can access the IJobDetail of a given job. It has a property called JobDataMap that is what you are looking for.
Upvotes: 1