Workflow Engine .NET

Assembly: OptimaJet.Workflow.SQLite

Class WorkflowProcessTimer

OptimaJet.Workflow.SQLite.WorkflowProcessTimer

Database object for workflow process timer operations.

public class WorkflowProcessTimer : DbObject<ProcessTimerEntity>

Inheritance

  • Object
  • DbObject<ProcessTimerEntity>

Constructors

public WorkflowProcessTimer(string schemaName, int commandTimeout) #
Initializes a new instance of WorkflowProcessTimer.

Parameters

Name
Type
Description
schemaName
String
The database schema name.
commandTimeout
Int32
The command timeout in seconds.

Methods

public Task<int> DeleteInactiveByProcessIdAsync(SqliteConnection connection, Guid processId, SqliteTransaction transaction = null) #
Deletes all inactive (ignored) timers for the specified process.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
processId
Guid
The process identifier.
transaction
SqliteTransaction
An optional transaction.

Returns

Type
Description
Task<Int32>
The number of rows affected.
public Task<int> DeleteByProcessIdAsync(SqliteConnection connection, Guid processId, List<string> timersIgnoreList = null, SqliteTransaction transaction = null) #
Deletes timers for the specified process, excluding those in the ignore list.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
processId
Guid
The process identifier.
timersIgnoreList
List<String>
Timer names to exclude from deletion, or null to delete all.
transaction
SqliteTransaction
An optional transaction.

Returns

Type
Description
Task<Int32>
The number of rows affected.
public Task<ProcessTimerEntity> SelectByProcessIdAndNameAsync(SqliteConnection connection, Guid processId, string name) #
Selects a timer by process identifier and timer name.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
processId
Guid
The process identifier.
name
String
The timer name.

Returns

Type
Description
Task<ProcessTimerEntity>
The matching timer entity, or null if not found.
public Task<IEnumerable<ProcessTimerEntity>> SelectByProcessIdAsync(SqliteConnection connection, Guid processId) #
Selects all timers for the specified process.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
processId
Guid
The process identifier.

Returns

Type
Description
Task<ProcessTimerEntity>
An enumerable of timer entities.
public Task<IEnumerable<ProcessTimerEntity>> SelectActiveByProcessIdAsync(SqliteConnection connection, Guid processId) #
Selects all active (non-ignored) timers for the specified process.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
processId
Guid
The process identifier.

Returns

Type
Description
Task<ProcessTimerEntity>
An enumerable of active timer entities.
public Task<int> SetTimerIgnoreAsync(SqliteConnection connection, Guid timerId) #
Marks a timer as ignored (inactive) by its identifier.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
timerId
Guid
The timer identifier.

Returns

Type
Description
Task<Int32>
The number of rows affected.
public Task<ProcessTimerEntity[]> GetTopTimersToExecuteAsync(SqliteConnection connection, int top, DateTime now) #
Selects the top timers that are due for execution (next execution time is at or before the specified time).

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
top
Int32
The maximum number of timers to return.
now
DateTime
The current time to compare against.

Returns

Type
Description
Task<ProcessTimerEntity[]>
An array of timer entities ready for execution.