Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


Trax
  •  Trax
  • No customer Topic Starter
2009-06-05T14:23:23Z
Hi,

I'm developing a web control which schedules Execute or ExecuteScript tasks. I was trying to create a new task without using JobClass.AddTask() but it seems that causes problems in the windows client. So now I'm initially adding it as TaskClass.TaskT.Execute (or if the control is in edit mode, it uses the existing task whatever type that may be) but then calling a configure method which changes the type depending on the commandline that is entered.

Is the following way a proper way to change a task type or will the task still retain the settings belonging to the old type (e.g. changing an Execute Task to ExecuteScript Task) and can that somehow cause problems?

task.TaskType = TaskClass.TaskT.ExecuteScript;
if (task.ExecuteScript == null)
task.ExecuteScript = new TaskExecuteScriptClass();
task.ExecuteScript.FilePath = taskSettings.CommandLine;

Thanks,
Patrick
Sponsor
Forum information
Support
2009-06-05T23:50:55Z
There are some functions that you could use for "emptying" and "filling" settings. Please perform these steps:

1. set your new task type
2. call task.CreateTaskTypeObject(); // creates a new object similar to: task.ExecuteScript = new TaskExecuteScriptClass();
3. call SetToNothing(); // removes objects from other tasks. For example, if you had an Archive Task before it is set to null
4. set your specific task settings, like commandline
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top