Class Task
- Namespace
- Dynamicweb.Scheduling
- Assembly
- Dynamicweb.Core.dll
Represents task
- Inheritance
-
Task
- Inherited Members
Constructors
Task()
Creates new Task instance
Fields
XmlFolder
Xml folder to store scheduled tasks
Field Value
Properties
ActiveImage
Gets active state image
Property Value
- string
Image path
AddInSettings
Gets or sets add-in settings
Property Value
- string
String value
AddInTypeName
Gets or sets add-in type name settings
Property Value
- string
String value
Begin
Gets or sets task begin datetime stamp
Property Value
- Date
Time DateTime stamp
CheckPreviousTask
Run the task only if previous task executed with Success
Property Value
Comment
Gets or sets task comment
Property Value
ConfigFilePath
Gets or sets config xml file
Property Value
Day
Gets or sets day value
Property Value
- int
Integer value
DayOfWeek
Gets or sets week day
Property Value
- int
Integer value
Enabled
Gets or sets enabled state
Property Value
- bool
True or false value
End
Gets or sets task end datetime stamp
Property Value
- Date
Time DateTime stamp
Hour
Gets or sets hour value
Property Value
- int
Integer value
ID
Gets task identifier
Property Value
IdAndName
Gets task Name and Id
Property Value
Identifier
Property Value
LastEventId
Gets or sets task last Event id
Property Value
LastException
Gets or sets task last exception
Property Value
LastResult
Gets or sets task last result
Property Value
- bool?
LastRun
Gets last run date
Property Value
- Date
Time ? String representation of last run date
LastRunState
Gets task last run state
Property Value
LogFileName
Returns Log file name (like 'Import data with custom request add-in20240209-1244344396042_77.log')
Property Value
LogFileTimeStamp
Log file time stamp like 20240209-1031436943489
Property Value
Minute
Gets or sets minute value
Property Value
- int
Integer value
Name
Gets or sets task name
Property Value
NextRun
Gets next run date
Property Value
- string
String representation of next run date
ParentId
Gets the parent task identifier
Property Value
- int?
PreviousRuntime
Gets or sets the date and time of the last task execution.
Property Value
Schedule
Gets task schedule
Property Value
- string
String representation of task schedule data
Sort
Gets or sets task sort order
Property Value
StartFromLastRun
Gets or sets a value to indicate if next run time should be calculated based on the end of the last run time or based on Begin start time.
Property Value
- bool
String value
Remarks
If set to true, a number of minutes will be added to the end of the task run time for the next run time. If set to false, the begin date and time will be used to calculate the next. I.e. always run 24 hours after the last start, i.e. 02.00 every night
Timeout
Returns timeout in seconds
Property Value
Token
Gets or sets task token
Property Value
UpcomingRuntime
Gets or sets the date and time of the next task execution.
Property Value
Methods
AllowedToRun(DateTime)
Parameters
dateTime
DateTime
Returns
ChangeActive()
Change active state of current task
Delete()
Deletes scheduled task
Delete(int)
Deletes scheduled task with specific id
Parameters
id
intID of task to be deleted
GetAbsoluteConfigFilePath(Task)
Gets the config file path
Parameters
task
Task
Returns
GetActivationUrl(Task, string)
Gets the activation URL.
Parameters
Returns
Exceptions
- Argument
Null Exception domain or task
GetActiveTasksCount()
Gets count of active tasks
Returns
- int
Number of active tasks
GetCopy()
Gets the task object copy.
Returns
- Task
Task.
GetLastExistingTaskName(string)
Gets last existing task name
Parameters
name
stringName of task
Returns
- string
Last existing task name
GetParent()
Gets the parent task
Returns
- Task
Parent task
GetTaskById(int)
Gets a task by id
Parameters
id
intIdentifier of the task
Returns
- Task
Task, if found, otherwise null.
GetTaskByName(string)
Gets a task by name
Parameters
name
stringName of the task
Returns
- Task
Task, if found, otherwise null.
GetTasks()
Gets the sub tasks
Returns
- IEnumerable<Task>
Sub tasks
ImportXmlTask(string)
Imports task from xml file to database
Parameters
xmlFilePath
stringTask xml file path
Returns
- bool
True if imported, otherwise false
MakeSafeFileName(string)
Parameters
name
string
Returns
RenderStatusIcon()
Renders task last run status icon
Returns
Save()
Saves task
SaveAsXml()
Save task to xml file
SaveAsXml(string?)
Save task to xml file
Parameters
folderPath
string
SetLastRun()
Sets last run date time stamp
SetNextRun()
Sets task next run date time