c# - Sitecore Scheduling Parameters -


problem

i'm trying setup sitecore scheduled task in database using schedules , commands.

so far i've followed http://sdn.sitecore.net/faq/administration/scheduled%20tasks.aspx of i've needed. method uses:public void writetologfile(item[] itemarray, commanditem commanditem, scheduleitem scheduleditem). i'm assuming items passed in schedule item, command item itself, , schedule item itself.

i have run function follows same syntax: protected void run(item[] itemarray, commanditem commanditem, scheduleitem scheduleditem). i've recieveing exception runs in logs though. linked exception stack: http://pastie.org/1847345, here nested exception:

exception: system.nullreferenceexception  message: object reference not set instance of object.  source: fhservices @ fhservices.twitterpull.run(item[] itemarray, commanditem commanditem, scheduleitem scheduleditem) 

i've tried few different combinations of parameters accept no luck.

scheduling web.config section:

 <scheduling>   <!-- time between checking scheduled tasks waiting execute -->   <frequency>00:01:00</frequency>   <!-- agent process schedules embedded items in database -->   <agent type="sitecore.tasks.databaseagent" method="run" interval="00:02:00">     <param desc="database">core</param>     <param desc="schedule root">/sitecore/system/tasks/schedules</param>     <logactivity>true</logactivity>   </agent>  ... 

would know parameters sitecore sends methods invoked through method of starting jobs?

according snippet linked on sdn, think create own method, similar writetologfile not run(). step 4 says:

fill in necessary fields:

type: customscheduletasks.task1, customscheduletasks

method: writetologfile

the type indicates namespace , assembly file. method indicates method call on specified class.

your command ready use scheduled task.

so instead of run() method, name else , set in method field of command in sitecore. run() method in databaseagent sitecore runs.


Comments