Class WorkflowProcessTimer
OptimaJet.Workflow.SQLite.WorkflowProcessTimer
Database object for workflow process timer operations.
Namespace: OptimaJet.Workflow.SQLite
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
schemaNameStringThe database schema name.
commandTimeoutInt32The 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
connectionSqliteConnectionThe SQLite connection.
processIdGuidThe process identifier.
transactionSqliteTransactionAn 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
connectionSqliteConnectionThe SQLite connection.
processIdGuidThe process identifier.
timersIgnoreListList<String>Timer names to exclude from deletion, or
null to delete all.transactionSqliteTransactionAn 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
connectionSqliteConnectionThe SQLite connection.
processIdGuidThe process identifier.
nameStringThe 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
connectionSqliteConnectionThe SQLite connection.
processIdGuidThe 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
connectionSqliteConnectionThe SQLite connection.
processIdGuidThe 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
connectionSqliteConnectionThe SQLite connection.
timerIdGuidThe 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
connectionSqliteConnectionThe SQLite connection.
topInt32The maximum number of timers to return.
nowDateTimeThe current time to compare against.
Returns
Type
Description
Task<ProcessTimerEntity[]>An array of timer entities ready for execution.