Developer forum

Forum » Development » RE: scheduled task how to's

RE: scheduled task how to's

Jan Sangill
Reply

Hi,

I am having a hard time finding a guide on how to's on the scheduled task runner.

What I need is the ability to run a method on certain times of the day.

The ideal way, would be a flat .cshtml file where I import data into dynamicweb db.

Any documentaion on how this is achieved. If so - where?

If not, can someone point me in the right direction. What should I for instance enter under :Activation URL and under the next text field under activation?

--------------------------------

To briefly explain the job I ned done:

 I have a folder of xml files. I need to run though these and save some of the data in a table.

If the method I outlined above with the flat cshtml file is wrong or could be done smarter, don't hesiate to tell me neither:)


Replies

 
Alexander Gubenko
Reply

Hi Jan,

Please look at:

1) http://manual.dynamicweb-cms.com/Dynamicweb-On-line-Manual/Management-Center/System/Scheduled-tasks.aspx

2) http://developer.dynamicweb.com/forum/development/scheduled-tasks-on-custom-solution.aspx

3) The simple .cshtml file available in attachement.

 
Jan Sangill
Reply

Hi Alexander,

What if I wanted to avoid making this a custom solution ? (point 2).

And (Point 1), doesnt really explain how to use the Activation URL and what to enter in the fields.

Or for me to use scheduled tasks, is it nesecary to be a custom solution?
 

I hope my questions make sense.




 

 
Alexander Gubenko
Reply
This post has been marked as an answer

Hi Jan,

The scheduler tasks is standard feature DynamicWeb. But your application must have permissions to create and execute mswindows scheduler tasks(read Impersonation section of (1)).

The procedure to create the URL task is simple(imagine we have the www.mydw.com DW site):
1) Put CustomScheduledTask.cshtml from archive above to www.mydw.com/Files/mytasks/ folder
2) Open CustomScheduledTask.cshtml file and replace line:
------
Dynamicweb.Information.Logger.LogGeneral("cst:executed", string.Format("Custom scheduled task executed ~ {0}", DateTime.UtcNow.ToString()));
------ 
with your code(which collect xml files data into table)
3) go to "Management Center"->System->"Scheduled tasks"
4) click "Add" button. In popup window select URL Activation type and fill input bellow with url http://www.mydw.com/Files/mytasks/CustomScheduledTask.cshtml
5) fill other fields
6) Click Ok button to create task

after that CustomScheduledTask.cshtml will executing each 5 minutes

url_st.png
Votes for this answer: 1
 
Jan Sangill
Reply

Hi,

TY. I was blinded by the activation URL textbox.

It works perfectly.

 

 

You must be logged in to post in the forum