Skip to main content

Class TimerManagerBase

Inheritance

↳ object

    TimerManagerBase

        ↳ MultiServerTimeManager

        ↳ SingleServerTimerManager

Inherited Members

Equals(object)

Equals(object, object)

GetHashCode()

GetType()

MemberwiseClone()

ReferenceEquals(object, object)

ToString()

Namespace: OptimaJet.Workflow.Core.Runtime.Timers

Assembly: OptimaJet.Workflow.Core.dll

Syntax
public abstract class TimerManagerBase

Constructors

TimerManagerBase()

Timer manager constructor

Declaration
public TimerManagerBase()

Properties

ImmediateTimerValue

Value of Unspecified Timer which indicates that the timer transition will be executed immediately

Declaration
public string ImmediateTimerValue { get; }
Property value
TypeDescription
string

InfinityTimerValue

Value of Unspecified Timer which indicates that the timer transition will be never executed

Declaration
public string InfinityTimerValue { get; }
Property value
TypeDescription
string

DefaultWaitTimeout

Wait timeout for start/stop operations in milliseconds. Default value is 1000.

Declaration
public int DefaultWaitTimeout { get; set; }
Property value
TypeDescription
int

Stopped

Declaration
protected abstract bool Stopped { get; }
Property value
TypeDescription
bool

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
public Task RequestTimerValueAsync(ProcessInstance processInstance, ActivityDefinition activity = null)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
ActivityDefinitionactivity
Returns
TypeDescription
Task

GetTransitionsForImmediateExecution(ProcessInstance, ActivityDefinition)

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

Declaration
public IEnumerable<TransitionDefinition> GetTransitionsForImmediateExecution(ProcessInstance processInstance, ActivityDefinition activity = null)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance
ActivityDefinitionactivity
Returns
TypeDescription
IEnumerable<TransitionDefinition>

SetTimerValue(ProcessInstance, string, DateTime)

Sets new value of named timer

Declaration
public 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
public Task SetTimerValue(Guid processId, string timerName, DateTime newValue)
Parameters
TypeNameDescription
GuidprocessIdProcess id
stringtimerNameTimer name in Scheme
DateTimenewValueNew value of the timer
Returns
TypeDescription
Task

StopTimerInternal()

Declaration
protected abstract void StopTimerInternal()

StartTimerInternalAsync()

Declaration
protected abstract Task StartTimerInternalAsync()
Returns
TypeDescription
Task

ResetTimerValue(ProcessInstance, string)

Resets value of named timer

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

ResetTimerValue(Guid, string)

Resets value of named timer

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

RegisterTimersAsync(ProcessInstance)

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

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

ClearAndRegisterTimersAsync(ProcessInstance)

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

Declaration
public 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
public Task ClearTimersAsync(ProcessInstance processInstance)
Parameters
TypeNameDescription
ProcessInstanceprocessInstanceProcess instance whose timers need to be cleared
Returns
TypeDescription
Task

Refresh()

Refresh interval of the timer

Declaration
public abstract void Refresh()

GetTimersToRegister(ProcessDefinition, string)

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

GetTimersToRegister(ProcessInstance, string)

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

Fields

_startStopSemaphore

Declaration
protected readonly SemaphoreSlim _startStopSemaphore
Returns
TypeDescription
SemaphoreSlim

_runtime

Declaration
protected WorkflowRuntime _runtime
Returns
TypeDescription
WorkflowRuntime

Events

OnNeedTimerValue

Raises when the timer value must be obtained

Declaration
public event EventHandler<NeedTimerValueEventArgs> OnNeedTimerValue
Returns
TypeDescription
EventHandler<NeedTimerValueEventArgs>

OnNeedTimerValueAsync

Raises when the timer value must be obtained

Declaration
public event AsyncEventHandler<NeedTimerValueEventArgs> OnNeedTimerValueAsync
Returns
TypeDescription
AsyncEventHandler<NeedTimerValueEventArgs>

Extension Methods