You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rock is using the open source Quartz.NET job scheduling system for handling longer running, recurring tasks (Job). Although Quartz is complex and feature rich, you only need to know a few things to create a Job for Rock.
NOTE: For shorter running, simple tasks, you can use Transactions.
Writing a Rock Job
To create a custom Rock Job you only need to extend the IJob interface and implement the Execute() method. You can also use [BlockProperty] to hold administrator configured settings/values for your job.
usingQuartz;[BlockProperty(0,"My Property","MyProperty","General","This would be the description of this property.",false,"100","Rock","Rock.Field.Types.Integer")]publicclassMyCustomJob:IJob{publicvirtualvoidExecute(IJobExecutionContextcontext){// get the stored configuration propertyJobDataMapdataMap=context.JobDetail.JobDataMap;intsomeNumber=Int32.Parse(dataMap.GetString("MyProperty"));// TODO: your code that does something interesting}}