Workflow Engine .NET  2
Public Member Functions | Properties | Events | List of all members
OptimaJet.Workflow.Core.Runtime.TimerManager Class Reference

Default timer manager ITimerManager More...

Inheritance diagram for OptimaJet.Workflow.Core.Runtime.TimerManager:
OptimaJet.Workflow.Core.Runtime.ITimerManager

Public Member Functions

 TimerManager ()
 Timer manager constructor More...
 
void RequestTimerValue (ProcessInstance processInstance, ActivityDefinition activity=null)
 Sends request for timer value for all timer transitions that are outgoing from the CurrentActivity if timer value is equal 0 or -1 More...
 
IEnumerable< TransitionDefinitionGetTransitionsForImmediateExecution (ProcessInstance processInstance, ActivityDefinition activity=null)
 Returns transitions triggered by a timer which value is equal to 0 More...
 
void SetTimerValue (ProcessInstance processInstance, string timerName, DateTime newValue)
 Sets new value of named timer More...
 
Task SetTimerValue (Guid processId, string timerName, DateTime newValue)
 Sets new value of named timer More...
 
void ResetTimerValue (ProcessInstance processInstance, string timerName)
 Resets value of named timer More...
 
Task ResetTimerValue (Guid processId, string timerName)
 Resets value of named timer More...
 
void RegisterTimers (ProcessInstance 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 More...
 
void ClearAndRegisterTimers (ProcessInstance processInstance)
 Clear timers ClearTimers and then register new timers RegisterTimers More...
 
void ClearTimers (ProcessInstance processInstance)
 Clear all registerd timers except present in outgouing timer transitions for current actvity of the specified process and marked as NotOverrideIfExists TimerDefinition More...
 
void Init (WorkflowRuntime runtime)
 
void Start (int? timeout=null)
 Starts the timer More...
 
void Stop (int? timeout=null)
 Stop the timer More...
 
void Refresh ()
 Refresh interval of the timer More...
 
List< TimerToRegisterGetTimersToRegister (ProcessDefinition processDefinition, string activityName)
 
List< TimerToRegisterGetTimersToRegister (ProcessInstance processInstance, string activityName)
 

Properties

string ImmediateTimerValue [get]
 Value of Unspecified Timer which indicates that the timer transition will be executed immediately More...
 
string InfinityTimerValue = "0" [get]
 Value of Unspecified Timer which indicates that the timer transition will be never executed More...
 
int DefaultWaitTimeout [get, set]
 Wait timeout for start/stop operations in milliseconds. Default value is 1000. More...
 
- Properties inherited from OptimaJet.Workflow.Core.Runtime.ITimerManager
string ImmediateTimerValue [get]
 Value of Unspecified Timer which indicates that the timer transition will be executed immediately More...
 
string InfinityTimerValue [get]
 Value of Unspecified Timer which indicates that the timer transition will be never executed More...
 

Events

EventHandler< NeedTimerValueEventArgsNeedTimerValue
 Raises when the timer value must be obtained More...
 
- Events inherited from OptimaJet.Workflow.Core.Runtime.ITimerManager
EventHandler< NeedTimerValueEventArgsNeedTimerValue
 Raises when the timer value must be obtained More...
 

Detailed Description

Default timer manager ITimerManager

Constructor & Destructor Documentation

◆ TimerManager()

OptimaJet.Workflow.Core.Runtime.TimerManager.TimerManager ( )

Timer manager constructor

Member Function Documentation

◆ ClearAndRegisterTimers()

void OptimaJet.Workflow.Core.Runtime.TimerManager.ClearAndRegisterTimers ( ProcessInstance  processInstance)

Clear timers ClearTimers and then register new timers RegisterTimers

Parameters
processInstanceProcess instance whose timers need to be cleared an registered

Implements OptimaJet.Workflow.Core.Runtime.ITimerManager.

◆ ClearTimers()

void OptimaJet.Workflow.Core.Runtime.TimerManager.ClearTimers ( ProcessInstance  processInstance)

Clear all registerd timers except present in outgouing timer transitions for current actvity of the specified process and marked as NotOverrideIfExists TimerDefinition

Parameters
processInstanceProcess instance whose timers need to be cleared

Implements OptimaJet.Workflow.Core.Runtime.ITimerManager.

◆ GetTransitionsForImmediateExecution()

IEnumerable<TransitionDefinition> OptimaJet.Workflow.Core.Runtime.TimerManager.GetTransitionsForImmediateExecution ( ProcessInstance  processInstance,
ActivityDefinition  activity = null 
)

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

Parameters
processInstanceProcess instance
Returns

Implements OptimaJet.Workflow.Core.Runtime.ITimerManager.

◆ Refresh()

void OptimaJet.Workflow.Core.Runtime.TimerManager.Refresh ( )

Refresh interval of the timer

Implements OptimaJet.Workflow.Core.Runtime.ITimerManager.

◆ RegisterTimers()

void OptimaJet.Workflow.Core.Runtime.TimerManager.RegisterTimers ( ProcessInstance  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

Parameters
processInstanceProcess instance whose timers need to be registered

Implements OptimaJet.Workflow.Core.Runtime.ITimerManager.

◆ RequestTimerValue()

void OptimaJet.Workflow.Core.Runtime.TimerManager.RequestTimerValue ( ProcessInstance  processInstance,
ActivityDefinition  activity = null 
)

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

Parameters
processInstanceProcess instance

Implements OptimaJet.Workflow.Core.Runtime.ITimerManager.

◆ ResetTimerValue() [1/2]

void OptimaJet.Workflow.Core.Runtime.TimerManager.ResetTimerValue ( ProcessInstance  processInstance,
string  timerName 
)

Resets value of named timer

Parameters
processInstanceProcess instance
timerNameTimer name in Scheme

Implements OptimaJet.Workflow.Core.Runtime.ITimerManager.

◆ ResetTimerValue() [2/2]

Task OptimaJet.Workflow.Core.Runtime.TimerManager.ResetTimerValue ( Guid  processId,
string  timerName 
)

Resets value of named timer

Parameters
processIdProcess id
timerNameTimer name in Scheme

Implements OptimaJet.Workflow.Core.Runtime.ITimerManager.

◆ SetTimerValue() [1/2]

void OptimaJet.Workflow.Core.Runtime.TimerManager.SetTimerValue ( ProcessInstance  processInstance,
string  timerName,
DateTime  newValue 
)

Sets new value of named timer

Parameters
processInstanceProcess instance
timerNameTimer name in Scheme
newValueNew value of the timer

Implements OptimaJet.Workflow.Core.Runtime.ITimerManager.

◆ SetTimerValue() [2/2]

Task OptimaJet.Workflow.Core.Runtime.TimerManager.SetTimerValue ( Guid  processId,
string  timerName,
DateTime  newValue 
)

Sets new value of named timer

Parameters
processIdProcess id
timerNameTimer name in Scheme
newValueNew value of the timer

Implements OptimaJet.Workflow.Core.Runtime.ITimerManager.

◆ Start()

void OptimaJet.Workflow.Core.Runtime.TimerManager.Start ( int?  timeout = null)

Starts the timer

param name="timeout">Wait timeout in milliseconds

Implements OptimaJet.Workflow.Core.Runtime.ITimerManager.

◆ Stop()

void OptimaJet.Workflow.Core.Runtime.TimerManager.Stop ( int?  timeout = null)

Stop the timer

param name="timeout">Wait timeout in milliseconds

Implements OptimaJet.Workflow.Core.Runtime.ITimerManager.

Property Documentation

◆ DefaultWaitTimeout

int OptimaJet.Workflow.Core.Runtime.TimerManager.DefaultWaitTimeout
getset

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

◆ ImmediateTimerValue

string OptimaJet.Workflow.Core.Runtime.TimerManager.ImmediateTimerValue
get

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

◆ InfinityTimerValue

string OptimaJet.Workflow.Core.Runtime.TimerManager.InfinityTimerValue = "0"
get

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

Event Documentation

◆ NeedTimerValue

EventHandler<NeedTimerValueEventArgs> OptimaJet.Workflow.Core.Runtime.TimerManager.NeedTimerValue

Raises when the timer value must be obtained