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
Type | Name | Description |
---|
ProcessInstance | processInstance | Process instance |
ActivityDefinition | activity | Activity to get outbound transition, if null the CurrentActivity will be used |
Returns
Returns transitions triggered by a timer which value is equal to 0
Declaration
IEnumerable<TransitionDefinition> GetTransitionsForImmediateExecution(ProcessInstance processInstance, ActivityDefinition activity = null)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Process instance |
ActivityDefinition | activity | Activity to get outbound transition, if null the CurrentActivity will be used |
Returns
Type | Description |
---|
IEnumerable<TransitionDefinition> | |
SetTimerValue(ProcessInstance, string, DateTime)
Sets new value of named timer
Declaration
void SetTimerValue(ProcessInstance processInstance, string timerName, DateTime newValue)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Process instance |
string | timerName | Timer name in Scheme |
DateTime | newValue | New value of the timer |
SetTimerValue(Guid, string, DateTime)
Sets new value of named timer
Declaration
Task SetTimerValue(Guid processId, string timerName, DateTime newValue)
Parameters
Type | Name | Description |
---|
Guid | processId | Process id |
string | timerName | Timer name in Scheme |
DateTime | newValue | New value of the timer |
Returns
ResetTimerValue(ProcessInstance, string)
Resets value of named timer
Declaration
void ResetTimerValue(ProcessInstance processInstance, string timerName)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Process instance |
string | timerName | Timer name in Scheme |
ResetTimerValue(Guid, string)
Resets value of named timer
Declaration
Task ResetTimerValue(Guid processId, string timerName)
Parameters
Type | Name | Description |
---|
Guid | processId | Process id |
string | timerName | Timer name in Scheme |
Returns
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
Type | Name | Description |
---|
ProcessInstance | processInstance | Process instance whose timers need to be registered |
Returns
GetTimersToRegister(ProcessDefinition, string)
Declaration
List<TimerToRegister> GetTimersToRegister(ProcessDefinition processDefinition, string activityName)
Parameters
Type | Name | Description |
---|
ProcessDefinition | processDefinition | |
string | activityName | |
Returns
Type | Description |
---|
List<TimerToRegister> | |
GetTimersToRegister(ProcessInstance, string)
Declaration
List<TimerToRegister> GetTimersToRegister(ProcessInstance processInstance, string activityName)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | |
string | activityName | |
Returns
Type | Description |
---|
List<TimerToRegister> | |
ClearAndRegisterTimersAsync(ProcessInstance)
Clear timers ITimerManager.ClearTimersAsync(ProcessInstance) and then register new timers ITimerManager.RegisterTimersAsync(ProcessInstance)
Declaration
Task ClearAndRegisterTimersAsync(ProcessInstance processInstance)
Parameters
Type | Name | Description |
---|
ProcessInstance | processInstance | Process instance whose timers need to be cleared an registered |
Returns
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
Type | Name | Description |
---|
ProcessInstance | processInstance | Process instance whose timers need to be cleared |
Returns
Init(WorkflowRuntime)
Declaration
void Init(WorkflowRuntime runtime)
Parameters
Type | Name | Description |
---|
WorkflowRuntime | runtime | |
StartAsync(int?)
Starts the timer
Declaration
Task StartAsync(int? timeout = null)
Parameters
Type | Name | Description |
---|
int? | timeout | Wait timeout in milliseconds |
Returns
Stop(int?)
Stops the timer
Declaration
void Stop(int? timeout = null)
Parameters
Type | Name | Description |
---|
int? | timeout | Wait timeout in milliseconds |
Refresh()
Refresh interval of the timer
Declaration
Extension Methods