Class JobTask
- Namespace
- Dynamicweb.DataIntegration.Integration
- Assembly
- Dynamicweb.DataIntegration.dll
A request to execute a batch of data integration jobs on the background worker thread of JobQueue. Create an instance, pass it to AddToQueue(JobTask) to start execution, and poll IsJobTaskFinished(JobTask, ref bool) with the same instance to learn when the batch has finished and whether all jobs succeeded.
public class JobTask
- Inheritance
-
JobTask
- Inherited Members
Remarks
Things to be careful of:
- TimeStamp is the identity of the task in the queue's finished-task bookkeeping —
give each task a unique value (for example
DateTime.UtcNow.Ticks) or result polling will confuse two tasks. - The jobs in Jobs run sequentially in the given order on a single background thread; queuing a task does not block the caller, and a task with an empty Jobs value is skipped.
- When StopOnFailedJob is
false, remaining jobs still run after a failure; the overall task result is only successful when every job in the batch succeeded.
Constructors
JobTask(long, string, string, bool, Dictionary<string, string>)
Initializes a new instance of the JobTask class, ready to be queued with AddToQueue(JobTask).
public JobTask(long timeStamp, string jobs, string logFileName, bool stopOnFailedJob, Dictionary<string, string> destinationParameters)
Parameters
timeStamplongThe unique identifier of the task; see TimeStamp.
jobsstringThe semicolon-separated list of jobs to run; see Jobs.
logFileNamestringThe name of the log file the execution is logged to.
stopOnFailedJobboolIf set to
true, execution stops at the first failed job.destinationParametersDictionary<string, string>Parameters forwarded to each job's parameterized provider; see DestinationParameters.
Properties
DestinationParameters
Gets or sets parameters forwarded to each job's parameterized provider before the job runs (typically request parameters from the endpoint that queued the task). The reserved keys "jobsToRun", "StopOnFailedJob", "token" and "logFile" are not forwarded, and a "taskname" entry marks the task as originating from a scheduled task, which changes how execution is logged.
public Dictionary<string, string> DestinationParameters { get; set; }
Property Value
Jobs
Gets or sets the jobs to run as a semicolon-separated list, executed in order. Each entry is either a job identifier relative to the integration jobs folder without the ".xml" extension (for example "MyGroup/MyActivity") or a full physical path to a job XML file.
public string Jobs { get; set; }
Property Value
LogFileName
Gets or sets the name of the log file the batch execution is logged to. When the task originates from a scheduled task, each job additionally gets its own log file and this log receives the combined output.
public string LogFileName { get; set; }
Property Value
StopOnFailedJob
Gets or sets a value indicating whether execution of the batch stops at the first failed job. When
false, the remaining jobs run regardless of failures.
public bool StopOnFailedJob { get; set; }
Property Value
TimeStamp
Gets or sets the unique identifier of the task, typically a tick count from when the task was created. Used as the key when tracking finished tasks, so it must be unique among concurrently queued tasks (see IsJobTaskFinished(JobTask, ref bool)).
public long TimeStamp { get; set; }