Codeunit "Job Queue Dispatcher"

ID 448
Namespace: System.Threading

Properties

Name Value
InherentPermissions X
Permissions TableData "Job Queue Entry" = rimd, TableData "Job Queue Category" = rm
TableNo Table System.Threading."Job Queue Entry"

Methods

IsWithinStartEndTime

Checks if the current time is within the start and end time of the job queue entry.

procedure IsWithinStartEndTime(var CurrJobQueueEntry: Record "Job Queue Entry"): Boolean

Parameters

Name Type Description
CurrJobQueueEntry Table System.Threading."Job Queue Entry"

The Job Queue Entry to check.

Returns

Type Description
Boolean

True if the current time is within the start and end time, otherwise false.

WaitForOthersWithSameCategory

procedure WaitForOthersWithSameCategory(var CurrJobQueueEntry: Record "Job Queue Entry"): Boolean

Parameters

Name Type Description
CurrJobQueueEntry Table System.Threading."Job Queue Entry"

Returns

Type Description
Boolean

CalcNextRunTimeForRecurringJob

procedure CalcNextRunTimeForRecurringJob(var JobQueueEntry: Record "Job Queue Entry", StartingDateTime: DateTime): DateTime

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"
StartingDateTime DateTime

Returns

Type Description
DateTime

CalcNextRunTimeHoldDuetoInactivityJob

procedure CalcNextRunTimeHoldDuetoInactivityJob(var JobQueueEntry: Record "Job Queue Entry", StartingDateTime: DateTime): DateTime

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"
StartingDateTime DateTime

Returns

Type Description
DateTime

CalcNextReadyStateMoment

procedure CalcNextReadyStateMoment(JobQueueEntry: Record "Job Queue Entry"): DateTime

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"

Returns

Type Description
DateTime

CalcInitialRunTime

procedure CalcInitialRunTime(var JobQueueEntry: Record "Job Queue Entry", StartingDateTime: DateTime): DateTime

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"
StartingDateTime DateTime

Returns

Type Description
DateTime

Events

OnAfterCalcRunTimeForRecurringJob

[IntegrationEvent(False,False)]
local procedure OnAfterCalcRunTimeForRecurringJob(var JobQueueEntry: Record "Job Queue Entry", Found: Boolean, StartingDateTime: DateTime, var NewRunDateTime: DateTime)

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"
Found Boolean
StartingDateTime DateTime
NewRunDateTime DateTime

OnBeforeCalcNextRunTimeForRecurringJob

[IntegrationEvent(False,False)]
local procedure OnBeforeCalcNextRunTimeForRecurringJob(JobQueueEntry: Record "Job Queue Entry", StartingDateTime: DateTime, var NewRunDateTime: DateTime, var IsHandled: Boolean)

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"
StartingDateTime DateTime
NewRunDateTime DateTime
IsHandled Boolean

OnAfterSuccessHandleRequest

[IntegrationEvent(False,False)]
local procedure OnAfterSuccessHandleRequest(var JobQueueEntry: Record "Job Queue Entry", JobQueueExecutionTime: Integer, PreviousTaskId: Guid)

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"
JobQueueExecutionTime Integer
PreviousTaskId Guid

OnAfterSuccessExecuteJob

[IntegrationEvent(False,False)]
local procedure OnAfterSuccessExecuteJob(var JobQueueEntry: Record "Job Queue Entry")

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"

OnBeforeHandleRequest

[IntegrationEvent(False,False)]
local procedure OnBeforeHandleRequest(var JobQueueEntry: Record "Job Queue Entry")

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"

OnBeforeExecuteJob

[IntegrationEvent(False,False)]
local procedure OnBeforeExecuteJob(var JobQueueEntry: Record "Job Queue Entry")

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"

OnBeforeRun

[IntegrationEvent(False,False)]
local procedure OnBeforeRun(var JobQueueEntry: Record "Job Queue Entry", var Skip: Boolean)

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"
Skip Boolean

OnBeforeWaitForOthersWithSameCategory

[IntegrationEvent(False,False)]
local procedure OnBeforeWaitForOthersWithSameCategory(var CurrJobQueueEntry: Record "Job Queue Entry", var JobQueueEntry: Record "Job Queue Entry", var Result: Boolean, var IsHandled: Boolean)

Parameters

Name Type Description
CurrJobQueueEntry Table System.Threading."Job Queue Entry"
JobQueueEntry Table System.Threading."Job Queue Entry"
Result Boolean
IsHandled Boolean

OnCalcNextRunTimeForRecurringJobOnAfterCalcNewRunDateTime

[IntegrationEvent(False,False)]
local procedure OnCalcNextRunTimeForRecurringJobOnAfterCalcNewRunDateTime(var JobQueueEntry: Record "Job Queue Entry", var NewRunDateTime: DateTime, var IsHandled: Boolean, StartingDateTime: DateTime)

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"
NewRunDateTime DateTime
IsHandled Boolean
StartingDateTime DateTime

OnCalcInitialRunTimeOnAfterCalcEarliestPossibleRunTime

[IntegrationEvent(False,False)]
local procedure OnCalcInitialRunTimeOnAfterCalcEarliestPossibleRunTime(var JobQueueEntry: Record "Job Queue Entry", var EarliestPossibleRunTime: DateTime, var IsHandled: Boolean)

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"
EarliestPossibleRunTime DateTime
IsHandled Boolean

OnRescheduleOnBeforeJobQueueEnqueue

[IntegrationEvent(False,False)]
local procedure OnRescheduleOnBeforeJobQueueEnqueue(var JobQueueEntry: Record "Job Queue Entry")

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"

OnRescheduleOnBeforeJobQueueEnqueueAsWaiting

[IntegrationEvent(False,False)]
local procedure OnRescheduleOnBeforeJobQueueEnqueueAsWaiting(var JobQueueEntry: Record "Job Queue Entry")

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"

OnCalcRunTimeForRecurringJobOnAfterInitDays

[IntegrationEvent(False,False)]
local procedure OnCalcRunTimeForRecurringJobOnAfterInitDays(var JobQueueEntry: Record "Job Queue Entry", var StartingDateTime: DateTime)

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"
StartingDateTime DateTime

OnCalcRunTimeForRecurringJob

[IntegrationEvent(False,False)]
local procedure OnCalcRunTimeForRecurringJob(var JobQueueEntry: Record "Job Queue Entry", var RunOnDate: array[7] of Boolean, var Found: Boolean, var StartingWeekDay: Integer, var NoOfDays: Integer)

Parameters

Name Type Description
JobQueueEntry Table System.Threading."Job Queue Entry"
RunOnDate array[7] of Boolean
Found Boolean
StartingWeekDay Integer
NoOfDays Integer

See also