# Interface ITimerBuilder OptimaJet.Workflow.Core.Model.Builder.ITimerBuilder Provides fluent configuration for a [TimerDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerDefinition/) in a process scheme. Namespace: [OptimaJet.Workflow.Core.Model.Builder](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model.Builder/) ```csharp public interface ITimerBuilder : IProcessDefinitionBuilder ``` ## Type Hierarchy - ITimerBuilder Current type - Base interfaces - [IProcessDefinitionBuilder](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model.Builder/IProcessDefinitionBuilder/) ## Methods `ITimerBuilder Ref(out TimerDefinition timerDefinition)` Provides access to the current [TimerDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerDefinition/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `timerDefinition` | `TimerDefinition` | When this method returns, contains the current [TimerDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerDefinition/). | ### Returns | Type | Description | | --- | --- | | `ITimerBuilder` | The current [ITimerBuilder](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model.Builder/ITimerBuilder/) instance for method chaining. | `ITimerBuilder Name(string name)` Sets the timer name of the current [TimerDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerDefinition/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `name` | `String` | The timer name. | ### Returns | Type | Description | | --- | --- | | `ITimerBuilder` | The current [ITimerBuilder](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model.Builder/ITimerBuilder/) instance for method chaining. | `ITimerBuilder Interval(int interval)` Configures the current [TimerDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerDefinition/) with a [TimerType.Interval](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerType/) delay. ### Parameters | Name | Type | Description | | --- | --- | --- | | `interval` | `Int32` | The delay, in milliseconds. | ### Returns | Type | Description | | --- | --- | | `ITimerBuilder` | The current [ITimerBuilder](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model.Builder/ITimerBuilder/) instance for method chaining. | `ITimerBuilder Interval(TimeSpan interval)` Configures the current [TimerDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerDefinition/) with a [TimerType.Interval](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerType/) delay represented by a [TimeSpan](https://learn.microsoft.com/dotnet/api/system.timespan). ### Parameters | Name | Type | Description | | --- | --- | --- | | `interval` | `TimeSpan` | The delay to convert to the Workflow Engine interval format. | ### Returns | Type | Description | | --- | --- | | `ITimerBuilder` | The current [ITimerBuilder](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model.Builder/ITimerBuilder/) instance for method chaining. | `ITimerBuilder DateTime(DateTime dateTime)` Configures the current [TimerDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerDefinition/) to execute at a specific date and time using [TimerType.DateAndTime](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerType/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `dateTime` | `DateTime` | The date and time at which the timer should execute. | ### Returns | Type | Description | | --- | --- | | `ITimerBuilder` | The current [ITimerBuilder](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model.Builder/ITimerBuilder/) instance for method chaining. | `ITimerBuilder Date(DateTime date)` Configures the current [TimerDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerDefinition/) to execute at midnight on a specific date using [TimerType.Date](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerType/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `date` | `DateTime` | A [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) whose date component specifies when the timer should execute. | ### Returns | Type | Description | | --- | --- | | `ITimerBuilder` | The current [ITimerBuilder](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model.Builder/ITimerBuilder/) instance for method chaining. | `ITimerBuilder Time(DateTime time)` Configures the current [TimerDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerDefinition/) to execute at a specific time of day using [TimerType.Time](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerType/). ### Parameters | Name | Type | Description | | --- | --- | --- | | `time` | `DateTime` | A [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) whose time-of-day component specifies when the timer should execute. | ### Returns | Type | Description | | --- | --- | | `ITimerBuilder` | The current [ITimerBuilder](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model.Builder/ITimerBuilder/) instance for method chaining. | `ITimerBuilder Expression(string expression)` Configures the current [TimerDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerDefinition/) with a [TimerType.Expression](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerType/) schedule. ### Parameters | Name | Type | Description | | --- | --- | --- | | `expression` | `String` | The C# expression whose result determines the timer's execution time. | ### Returns | Type | Description | | --- | --- | | `ITimerBuilder` | The current [ITimerBuilder](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model.Builder/ITimerBuilder/) instance for method chaining. | `ITimerBuilder Overridable()` Sets [TimerDefinition.NotOverrideIfExists](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerDefinition/) to [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) so registration replaces an existing process timer with the same timer name. ### Returns | Type | Description | | --- | --- | | `ITimerBuilder` | The current [ITimerBuilder](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model.Builder/ITimerBuilder/) instance for method chaining. | `ITimerBuilder NotOverridable()` Sets [TimerDefinition.NotOverrideIfExists](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TimerDefinition/) to [true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) so registration preserves an existing process timer with the same timer name. ### Returns | Type | Description | | --- | --- | | `ITimerBuilder` | The current [ITimerBuilder](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model.Builder/ITimerBuilder/) instance for method chaining. | [Previous IProcessDefinitionBuilder](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model.Builder/IProcessDefinitionBuilder/) [Next ITransitionBuilder](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model.Builder/ITransitionBuilder/)