Class AppScheduler
Вспомогательный класс для интеграции планировщика Quartz.NET с веб-приложением.
Inheritance
Inherited Members
Namespace: Terrasoft.Core.Scheduler
Assembly: Terrasoft.Core.Scheduler.dll
Syntax
public class AppScheduler
Properties
Instance
Instance of scheduler.
Declaration
public static IScheduler Instance { get; }
Property Value
| Type | Description |
|---|---|
| IScheduler |
Methods
AddScheduler(IScheduler)
Adds scheduler inctance to collection.
Declaration
public static void AddScheduler(IScheduler scheduler)
Parameters
| Type | Name | Description |
|---|---|---|
| IScheduler | scheduler | Instance of |
CreateAndScheduleJob<TJobExecutor>(String, String, UserConnection, Dictionary<String, Object>, Boolean, String, Boolean, DateTime, DateTime, String, Int32)
Declaration
public static void CreateAndScheduleJob<TJobExecutor>(string jobName, string jobGroupName, UserConnection userConnection, Dictionary<string, object> parameters, bool isCronTrigger, string timeZoneId, bool isMisFireInstructionFireNow, DateTime startDateTime, DateTime endDateTime, string cronExpression, int priority = 5)
where TJobExecutor : IJobExecutor
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | |
| System.String | jobGroupName | |
| UserConnection | userConnection | |
| System.Collections.Generic.Dictionary<System.String, System.Object> | parameters | |
| System.Boolean | isCronTrigger | |
| System.String | timeZoneId | |
| System.Boolean | isMisFireInstructionFireNow | |
| System.DateTime | startDateTime | |
| System.DateTime | endDateTime | |
| System.String | cronExpression | |
| System.Int32 | priority |
Type Parameters
| Name | Description |
|---|---|
| TJobExecutor |
CreateClassJob(String, String, String, String, IDictionary<String, Object>, Boolean)
Creates the task for class execution.
Declaration
public static IJobDetail CreateClassJob(string className, string jobGroup, string workspaceName, string userName, IDictionary<string, object> parameters = null, bool isSystemUser = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | className | Class name. |
| System.String | jobGroup | The name of the group to which the task belongs. |
| System.String | workspaceName | Workspace in which class must be started. |
| System.String | userName | The user on whose behalf class will be started. |
| System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | The parameters that will be passed to the class. |
| System.Boolean | isSystemUser | Indicates system user. |
Returns
| Type | Description |
|---|---|
| IJobDetail |
CreateClassJob<T>(String, String, String, IDictionary<String, Object>, Boolean)
Creates the task for class execution.
Declaration
public static IJobDetail CreateClassJob<T>(string jobGroup, string workspaceName, string userName, IDictionary<string, object> parameters, bool isSystemUser)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobGroup | The name of the group to which the task belongs. |
| System.String | workspaceName | Workspace in which class must be started. |
| System.String | userName | The user on whose behalf class will be started. |
| System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | The parameters that will be passed to the class. |
| System.Boolean | isSystemUser | Indicates system user. |
Returns
| Type | Description |
|---|---|
| IJobDetail |
Type Parameters
| Name | Description |
|---|---|
| T |
CreateClassJob<TJobExecutor>(String, String, UserConnection, IDictionary<String, Object>, Boolean)
Creates the task for class execution.
Declaration
public static IJobDetail CreateClassJob<TJobExecutor>(string jobName, string jobGroupName, UserConnection userConnection, IDictionary<string, object> parameters = null, bool isSystemUser = true)
where TJobExecutor : IJobExecutor
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | The name of the task. |
| System.String | jobGroupName | The name of the group to which the task belongs. |
| UserConnection | userConnection | |
| System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | The parameters that will be passed to the class. |
| System.Boolean | isSystemUser | Indicates system user. |
Returns
| Type | Description |
|---|---|
| IJobDetail |
Type Parameters
| Name | Description |
|---|---|
| TJobExecutor |
CreateIntermediateTimerJob(String, String, String, String, String, Boolean)
Создание задания для регистрации промежуточного обрабатывающего таймера бизнес-процесса.
Declaration
public static JobDetailImpl CreateIntermediateTimerJob(string jobName, string jobGroup, string processElementUId, string workspaceName, string userName, bool isSystemUser = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | Название задания. |
| System.String | jobGroup | Название группы, к которой относится задание. |
| System.String | processElementUId | Идентификатор элемента "Таймер" процесса. |
| System.String | workspaceName | Рабочее пространство, в котором необходимо запустить процесс. |
| System.String | userName | Пользователь, от имени которого будет запускаться процесс. |
| System.Boolean | isSystemUser | Признак системного пользователя. Если значение |
Returns
| Type | Description |
|---|---|
| JobDetailImpl |
CreateProcessJob(String, String, String, String, String)
Creates the Job for process execution.
Declaration
public static IJobDetail CreateProcessJob(string jobName, string jobGroup, string processName, string workspaceName, string userName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | Job name. |
| System.String | jobGroup | The name of the group to which the Job belongs. |
| System.String | processName | Process name. |
| System.String | workspaceName | Workspace in which process must be started. |
| System.String | userName | The user on whose behalf process will be started. |
Returns
| Type | Description |
|---|---|
| IJobDetail | Job instance for process execution. |
CreateProcessJob(String, String, String, String, String, Boolean)
Creates the Job for process execution.
Declaration
public static IJobDetail CreateProcessJob(string jobName, string jobGroup, string processName, string workspaceName, string userName, bool isSystemUser)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | Job name. |
| System.String | jobGroup | The name of the group to which the Job belongs. |
| System.String | processName | Process name. |
| System.String | workspaceName | Workspace in which process must be started. |
| System.String | userName | The user on whose behalf process will be started. |
| System.Boolean | isSystemUser | System user flag. If |
Returns
| Type | Description |
|---|---|
| IJobDetail | Job instance for process execution. |
CreateProcessJob(String, String, String, String, String, IDictionary<String, Object>)
Creates the Job for process execution.
Declaration
public static IJobDetail CreateProcessJob(string jobName, string jobGroup, string processName, string workspaceName, string userName, IDictionary<string, object> parameters)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | Job name. |
| System.String | jobGroup | The name of the group to which the Job belongs. |
| System.String | processName | Process name. |
| System.String | workspaceName | Workspace in which process must be started. |
| System.String | userName | The user on whose behalf process will be started. |
| System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | The parameters that will be passed to the process. |
Returns
| Type | Description |
|---|---|
| IJobDetail | Job instance for process execution. |
CreateProcessJob(String, String, String, String, String, IDictionary<String, Object>, Boolean)
Creates the Job for process execution.
Declaration
public static IJobDetail CreateProcessJob(string jobName, string jobGroup, string processName, string workspaceName, string userName, IDictionary<string, object> parameters, bool isSystemUser)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | Job name. |
| System.String | jobGroup | The name of the group to which the Job belongs. |
| System.String | processName | Process name. |
| System.String | workspaceName | Workspace in which process must be started. |
| System.String | userName | The user on whose behalf process will be started. |
| System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | The parameters that will be passed to the process. |
| System.Boolean | isSystemUser | System user flag. If |
Returns
| Type | Description |
|---|---|
| IJobDetail | Job instance for process execution. |
CreateProcessJob(String, String, String, String, String, IDictionary<String, Object>, Boolean, JobOptions)
Creates the Job for process execution.
Declaration
public static IJobDetail CreateProcessJob(string jobName, string jobGroup, string processName, string workspaceName, string userName, IDictionary<string, object> parameters, bool isSystemUser, JobOptions jobOptions)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | Job name. |
| System.String | jobGroup | The name of the group to which the Job belongs. |
| System.String | processName | Process name. |
| System.String | workspaceName | Workspace in which process must be started. |
| System.String | userName | The user on whose behalf process will be started. |
| System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | The parameters that will be passed to the process. |
| System.Boolean | isSystemUser | System user flag. If |
| JobOptions | jobOptions | Additional Job options. |
Returns
| Type | Description |
|---|---|
| IJobDetail | Job instance for process execution. |
CreateProcessJob(String, String, String, String, String, JobOptions)
Creates the Job for process execution.
Declaration
public static IJobDetail CreateProcessJob(string jobName, string jobGroup, string processName, string workspaceName, string userName, JobOptions jobOptions)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | Job name. |
| System.String | jobGroup | The name of the group to which the Job belongs. |
| System.String | processName | Process name. |
| System.String | workspaceName | Workspace in which process must be started. |
| System.String | userName | The user on whose behalf process will be started. |
| JobOptions | jobOptions | Additional Job options. |
Returns
| Type | Description |
|---|---|
| IJobDetail | Job instance for process execution. |
DoesJobExist(String, String)
Checks whether Job exists.
Declaration
public static bool DoesJobExist(string jobName, string jobGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | Job name. |
| System.String | jobGroup | Job group name. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
DoesJobExist(String, String, IScheduler)
Checks whether Job exists.
Declaration
public static bool DoesJobExist(string jobName, string jobGroup, IScheduler scheduler)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | Job name. |
| System.String | jobGroup | Job group name. |
| IScheduler | scheduler | Instance of |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | If |
| System.ArgumentException | If |
| System.ArgumentException | If |
DoesJobGroupExist(String)
Checking the existence of jobs in a given group.
Declaration
public static bool DoesJobGroupExist(string jobGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobGroup | Group name. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | If |
DoesJobGroupExist(String, IScheduler)
Checking the existence of jobs in a given group.
Declaration
public static bool DoesJobGroupExist(string jobGroup, IScheduler scheduler)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobGroup | Group name. |
| IScheduler | scheduler | Instance of |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | If |
| System.ArgumentException | If |
FindScheduler(String)
Returns an instance of the scheduler with the specified name.
Declaration
public static IScheduler FindScheduler(string schedulerName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schedulerName | Scheduler name. |
Returns
| Type | Description |
|---|---|
| IScheduler | Instance of |
GetJobKeysForJobGroup(String)
Declaration
public static List<string> GetJobKeysForJobGroup(string jobGroupName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobGroupName |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> |
GetSchedulerOrDefault(String)
Returns an instance of the scheduler with the specified name, or the default instance.
Declaration
public static IScheduler GetSchedulerOrDefault(string schedulerName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schedulerName | Scheduler name. |
Returns
| Type | Description |
|---|---|
| IScheduler | Instance of |
RemoveGroupJobs(String)
Remove all jobs in the specified group.
Declaration
public static void RemoveGroupJobs(string jobGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobGroup | Group name. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | If |
RemoveGroupJobs(String, IScheduler)
Remove all jobs in the specified group.
Declaration
public static void RemoveGroupJobs(string jobGroup, IScheduler scheduler)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobGroup | Group name. |
| IScheduler | scheduler | Instance of |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | If |
| System.ArgumentException | If |
RemoveJob(String, String)
Remove the specified job in the specified group.
Declaration
public static bool RemoveJob(string jobName, string jobGroup)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | Job name. |
| System.String | jobGroup | Job group name. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | If |
| System.ArgumentException | If |
RemoveJob(String, String, IScheduler)
Remove the specified job in the specified group.
Declaration
public static bool RemoveJob(string jobName, string jobGroup, IScheduler scheduler)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | Job name. |
| System.String | jobGroup | Job group name. |
| IScheduler | scheduler | Instance of |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | If |
| System.ArgumentException | If |
| System.ArgumentException | If |
ScheduleImmediateJob<T>(String, String, String, IDictionary<String, Object>, Boolean, IScheduler, Int32)
Plans a task for immediate one-time start of class.
Declaration
public static void ScheduleImmediateJob<T>(string jobGroup, string workspaceName, string userName, IDictionary<string, object> parameters = null, bool isSystemUser = false, IScheduler scheduler = null, int priority = 5)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobGroup | The name of the group to which the task belongs. |
| System.String | workspaceName | Workspace in which class must be started. |
| System.String | userName | The user on whose behalf class will be started. |
| System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | The parameters that will be passed to the class. |
| System.Boolean | isSystemUser | System user flag. If |
| IScheduler | scheduler | Instance of |
| System.Int32 | priority | Triggers priority. Default value = 5. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of a task. |
Remarks
In contrast to TriggerJob<T>(String, String, String, IDictionary<String, Object>, Boolean, IScheduler), the ScheduleImmediateJob<T>(String, String, String, IDictionary<String, Object>, Boolean, IScheduler, Int32) schedules job with next fire time set to now, while TriggerJob<T>(String, String, String, IDictionary<String, Object>, Boolean, IScheduler) triggers job immediately. As a result, delay between ScheduleImmediateJob<T>(String, String, String, IDictionary<String, Object>, Boolean, IScheduler, Int32) call and actual trigger fire time can be greater than one after calling TriggerJob<T>(String, String, String, IDictionary<String, Object>, Boolean, IScheduler).
If job with the same name within the same group already exists it will be recreated.
If trigger can not be fired immediately it will be fired as soon as possible.
ScheduleImmediateProcessJob(String, String, String, String, String, IDictionary<String, Object>, Boolean, IScheduler)
Plans a task for immediate one-time start of process.
Declaration
public static void ScheduleImmediateProcessJob(string jobName, string jobGroup, string processName, string workspaceName, string userName, IDictionary<string, object> parameters = null, bool isSystemUser = false, IScheduler scheduler = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | Job name. |
| System.String | jobGroup | The name of the group to which the task belongs. |
| System.String | processName | Process name. |
| System.String | workspaceName | Workspace in which process must be started. |
| System.String | userName | The user on whose behalf process will be started. |
| System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | The parameters that will be passed to the process. |
| System.Boolean | isSystemUser | System user flag. If |
| IScheduler | scheduler | Instance of |
Remarks
In contrast to TriggerJob(String, String, String, String, String, IDictionary<String, Object>, Boolean, IScheduler), the ScheduleImmediateProcessJob(String, String, String, String, String, IDictionary<String, Object>, Boolean, IScheduler) schedules job with next fire time set to now, while TriggerJob(String, String, String, String, String, IDictionary<String, Object>, Boolean, IScheduler) triggers job immediately. As a result, delay between ScheduleImmediateProcessJob(String, String, String, String, String, IDictionary<String, Object>, Boolean, IScheduler) call and actual trigger fire time can be greater than one after calling TriggerJob(String, String, String, String, String, IDictionary<String, Object>, Boolean, IScheduler).
If job with the same name within the same group already exists it will be recreated.
If trigger can not be fired immediately it will be fired as soon as possible.
ScheduleMinutelyJob(String, String, String, String, String, Int32, IDictionary<String, Object>, Boolean, AppSchedulerMisfireInstruction, IScheduler, Int32)
A schedule that is used to fire a Job and repeat it at a minutely interval.
Declaration
public static void ScheduleMinutelyJob(string jobName, string jobGroup, string processName, string workspaceName, string userName, int periodInMinutes, IDictionary<string, object> parameters = null, bool isSystemUser = false, AppSchedulerMisfireInstruction misfireInstruction = default(AppSchedulerMisfireInstruction), IScheduler scheduler = null, int priority = 5)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | Job name. |
| System.String | jobGroup | The name of the group to which the task belongs. |
| System.String | processName | Process name. |
| System.String | workspaceName | Workspace in which job must be started. |
| System.String | userName | The user on whose behalf process will be started. |
| System.Int32 | periodInMinutes | Specify an interval in the minutes that the produced job will repeat at. |
| System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | The parameters that will be passed to the process. |
| System.Boolean | isSystemUser | System user flag. If |
| AppSchedulerMisfireInstruction | misfireInstruction | If the Job misfires, use the AppSchedulerMisfireInstruction instruction. If not explicitly set, the default value is RescheduleNowWithRemainingRepeatCount. |
| IScheduler | scheduler | Instance of |
| System.Int32 | priority | Triggers priority. Default value is 5. |
Remarks
If misfireInstruction equal to
RescheduleNowWithRemainingRepeatCount is passed to the method,
the scheduler will be updating misfired triggers, as if
RescheduleNowWithExistingRepeatCount value was passed.
This works both ways. Same applies for the
RescheduleNextWithRemainingCount and
RescheduleNextWithExistingCount value pair.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | In case if value of parameter
|
ScheduleMinutelyJob<T>(String, String, String, Int32, IDictionary<String, Object>, Boolean, AppSchedulerMisfireInstruction, IScheduler, Int32)
A schedule that is used to fire a Job and repeat it at a minutely interval.
Declaration
public static void ScheduleMinutelyJob<T>(string jobGroup, string workspaceName, string userName, int periodInMinutes, IDictionary<string, object> parameters = null, bool isSystemUser = false, AppSchedulerMisfireInstruction misfireInstruction = default(AppSchedulerMisfireInstruction), IScheduler scheduler = null, int priority = 5)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobGroup | The name of the group to which the task belongs. |
| System.String | workspaceName | Workspace in which job must be started. |
| System.String | userName | The user on whose behalf class will be started. |
| System.Int32 | periodInMinutes | Specify an interval in the minutes that the produced job will repeat at. |
| System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | The parameters that will be passed to the class. |
| System.Boolean | isSystemUser | System user flag. If |
| AppSchedulerMisfireInstruction | misfireInstruction | If the Job misfires, use the AppSchedulerMisfireInstruction instruction. If not explicitly set, the default value is RescheduleNowWithRemainingRepeatCount. |
| IScheduler | scheduler | Instance of |
| System.Int32 | priority | Triggers priority. Default value = 5. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of a task. |
Remarks
If misfireInstruction equal to
RescheduleNowWithRemainingRepeatCount is passed to the method,
the scheduler will be updating misfired triggers, as if
RescheduleNowWithExistingRepeatCount value was passed.
This works both ways. Same applies for the
RescheduleNextWithRemainingCount and
RescheduleNextWithExistingCount value pair.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | In case if value of parameter
|
ScheduleMinutelyProcessJob(String, String, String, String, String, Int32, IDictionary<String, Object>, Boolean, Boolean, IScheduler)
Планирование задания для запуска процесса с определенным интервалом.
Declaration
public static void ScheduleMinutelyProcessJob(string jobName, string jobGroup, string processName, string workspaceName, string userName, int periodInMinutes, IDictionary<string, object> parameters = null, bool isSystemUser = false, bool useMisfireInstructionFireOnceNow = false, IScheduler scheduler = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | Название задания. |
| System.String | jobGroup | Название группы, к которой относится задание. |
| System.String | processName | Название процесса. |
| System.String | workspaceName | Рабочее пространство, в котором необходимо запустить процесс. |
| System.String | userName | Пользователь, от имени которого будет запускаться процесс. |
| System.Int32 | periodInMinutes | Интервал запуска процесса в минутах. |
| System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | Параметры, которые будут передаваться в процесс. |
| System.Boolean | isSystemUser | Признак системного пользователя. Если значение |
| System.Boolean | useMisfireInstructionFireOnceNow | Если признак |
| IScheduler | scheduler | Instance of |
Remarks
Если задание с именем jobName и триггером типа
CalendarIntervalTriggerImpl уже существует в группе
jobGroup, оно будет обновлено, иначе - оно будет пересоздано заново.
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException | Если в качестве одного из параметров |
SetDefaultScheduler(String)
Finds scheduler by name and set it as default.
Declaration
public static void SetDefaultScheduler(string schedulerName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | schedulerName | Default scheduler name. |
Exceptions
| Type | Condition |
|---|---|
| System.InvalidOperationException | If scheduler with specified name not found. |
ShutdownSchedulers(Boolean)
Halts all Quartz.IScheduler's threads and cleans up all resources associated with the Scheduler.
Declaration
public static void ShutdownSchedulers(bool waitForJobsToComplete)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | waitForJobsToComplete | If true the scheduler will not allow this method to return until all currently executing jobs have complete. |
StartSchedulers()
Starts all Quartz.IScheduler's threads.
Declaration
public static void StartSchedulers()
TriggerJob(String, String, String, String, String, IDictionary<String, Object>, Boolean, IScheduler)
Creates a task for immediate one-time start of process.
Declaration
public static void TriggerJob(string jobName, string jobGroup, string processName, string workspaceName, string userName, IDictionary<string, object> parameters = null, bool isSystemUser = false, IScheduler scheduler = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobName | Job name. |
| System.String | jobGroup | The name of the group to which the task belongs. |
| System.String | processName | Process name. |
| System.String | workspaceName | Workspace in which process must be started. |
| System.String | userName | The user on whose behalf process will be started. |
| System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | The parameters that will be passed to the process. |
| System.Boolean | isSystemUser | System user flag. If |
| IScheduler | scheduler | Instance of |
Remarks
In contrast to ScheduleImmediateProcessJob(String, String, String, String, String, IDictionary<String, Object>, Boolean, IScheduler), the TriggerJob(String, String, String, String, String, IDictionary<String, Object>, Boolean, IScheduler) triggers job immediately, while ScheduleImmediateProcessJob(String, String, String, String, String, IDictionary<String, Object>, Boolean, IScheduler) schedules job with next fire time set to now. As a result, delay between TriggerJob(String, String, String, String, String, IDictionary<String, Object>, Boolean, IScheduler) call and actual trigger fire can be smaller than one after calling ScheduleImmediateProcessJob(String, String, String, String, String, IDictionary<String, Object>, Boolean, IScheduler).
If job with the same name within the same group already exists it will be recreated.
If trigger can not be fired immediately it will be fired as soon as possible.
TriggerJob<T>(String, String, String, IDictionary<String, Object>, Boolean, IScheduler)
Creates a task for immediate one-time start of class.
Declaration
public static void TriggerJob<T>(string jobGroup, string workspaceName, string userName, IDictionary<string, object> parameters = null, bool isSystemUser = false, IScheduler scheduler = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | jobGroup | The name of the group to which the task belongs. |
| System.String | workspaceName | Workspace in which class must be started. |
| System.String | userName | The user on whose behalf class will be started. |
| System.Collections.Generic.IDictionary<System.String, System.Object> | parameters | The parameters that will be passed to the class. |
| System.Boolean | isSystemUser | System user flag. If |
| IScheduler | scheduler | Instance of |
Type Parameters
| Name | Description |
|---|---|
| T | Type of a task. |
Remarks
In contrast to ScheduleImmediateJob<T>(String, String, String, IDictionary<String, Object>, Boolean, IScheduler, Int32), the TriggerJob<T>(String, String, String, IDictionary<String, Object>, Boolean, IScheduler) triggers job immediately, while ScheduleImmediateJob<T>(String, String, String, IDictionary<String, Object>, Boolean, IScheduler, Int32) schedules job with next fire time set to now. As a result, delay between TriggerJob<T>(String, String, String, IDictionary<String, Object>, Boolean, IScheduler) call and actual trigger fire can be smaller than one after calling ScheduleImmediateJob<T>(String, String, String, IDictionary<String, Object>, Boolean, IScheduler, Int32).
If job with the same name within the same group already exists it will be recreated.
If trigger can not be fired immediately it will be fired as soon as possible.