Skip to main content

Introducing Formengine - The New Formbuilder, try for FREE formengine.io.

Interface ITimerManager

Interface of a timer manager, which control timers functioning inside a workflow runtime

Namespace: OptimaJet.Workflow.Core.Runtime

Assembly: OptimaJet.Workflow.Core.dll

Syntax
public interface ITimerManager

Methods

RequestTimerValueAsync(ProcessInstance, ActivityDefinition)

Sends request for timer value for all timer transitions that are outgoing from the CurrentActivity if timer value is equal 0 or -1

Declaration
Task RequestTimerValueAsync(ProcessInstance processInstance, ActivityDefinition activity = null)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
ActivityDefinitionactivityActivity to get outbound transition, if null the CurrentActivity will be used
Returns
TypeDescription
Task

GetTransitionsForImmediateExecution(ProcessInstance, ActivityDefinition)

Returns transitions triggered by a timer which value is equal to 0

Declaration
IEnumerable<TransitionDefinition> GetTransitionsForImmediateExecution(ProcessInstance processInstance, ActivityDefinition activity = null)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
ActivityDefinitionactivityActivity to get outbound transition, if null the CurrentActivity will be used
Returns
TypeDescription
IEnumerable<TransitionDefinition>

SetTimerValue(ProcessInstance, string, DateTime)

Sets new value of named timer

Declaration
void SetTimerValue(ProcessInstance processInstance, string timerName, DateTime newValue)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
stringtimerNameTimer name in Scheme
DateTimenewValueNew value of the timer

SetTimerValue(Guid, string, DateTime)

Sets new value of named timer

Declaration
Task SetTimerValue(Guid processId, string timerName, DateTime newValue)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringtimerNameTimer name in Scheme
DateTimenewValueNew value of the timer
Returns
TypeDescription
Task

ResetTimerValue(ProcessInstance, string)

Resets value of named timer

Declaration
void ResetTimerValue(ProcessInstance processInstance, string timerName)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
stringtimerNameTimer name in Scheme

ResetTimerValue(Guid, string)

Resets value of named timer

Declaration
Task ResetTimerValue(Guid processId, string timerName)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringtimerNameTimer name in Scheme
Returns
TypeDescription
Task

RegisterTimersAsync(ProcessInstance)

Register all timers for all outgoing timer transitions for current activity of the specified process. All timers registered before which are present in transitions will be rewritten except timers marked as NotOverrideIfExists TimerDefinition

Declaration
Task RegisterTimersAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance whose timers need to be registered
Returns
TypeDescription
Task

GetTimersToRegister(ProcessDefinition, string)

Declaration
List<TimerToRegister> GetTimersToRegister(ProcessDefinition processDefinition, string activityName)
Parameters
TypeNameDescription
ProcessDefinitionprocessDefinition
stringactivityName
Returns
TypeDescription
List<TimerToRegister>

GetTimersToRegister(ProcessInstance, string)

Declaration
List<TimerToRegister> GetTimersToRegister(ProcessInstance processInstance, string activityName)
Parameters
TypeNameDescription
ProcessInstanceprocessInstance
stringactivityName
Returns
TypeDescription
List<TimerToRegister>

ClearAndRegisterTimersAsync(ProcessInstance)

Clear timers ITimerManager.ClearTimersAsync(ProcessInstance) and then register new timers ITimerManager.RegisterTimersAsync(ProcessInstance)

Declaration
Task ClearAndRegisterTimersAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance whose timers need to be cleared an registered
Returns
TypeDescription
Task

ClearTimersAsync(ProcessInstance)

Clear all registered timers except present in outgoing timer transitions for current activity of the specified process and marked as NotOverrideIfExists TimerDefinition

Declaration
Task ClearTimersAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance whose timers need to be cleared
Returns
TypeDescription
Task

Init(WorkflowRuntime)

Declaration
void Init(WorkflowRuntime runtime)
Parameters
TypeNameDescription
WorkflowRuntimeruntime

StartAsync(int?)

Starts the timer

Declaration
Task StartAsync(int? timeout = null)
Parameters
TypeNameDescription
int?timeoutWait timeout in milliseconds
Returns
TypeDescription
Task

Stop(int?)

Stops the timer

Declaration
void Stop(int? timeout = null)
Parameters
TypeNameDescription
int?timeoutWait timeout in milliseconds

Refresh()

Refresh interval of the timer

Declaration
void Refresh()

Extension Methods