Workflow Engine .NET

Assembly: OptimaJet.Workflow.SQLite

Class WorkflowProcessInstancePersistence

OptimaJet.Workflow.SQLite.WorkflowProcessInstancePersistence

Database object for workflow process instance persistence parameter operations.

public class WorkflowProcessInstancePersistence : DbObject<ProcessInstancePersistenceEntity>

Inheritance

  • Object
  • DbObject<ProcessInstancePersistenceEntity>

Constructors

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

Parameters

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

Methods

public Task<ProcessInstancePersistenceEntity[]> SelectByProcessIdAsync(SqliteConnection connection, Guid processId) #
Selects all persistence parameter entities for the specified process.

Parameters

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

Returns

Type
Description
Task<ProcessInstancePersistenceEntity[]>
An array of persistence parameter entities.
public Task<ProcessInstancePersistenceEntity> SelectByNameAsync(SqliteConnection connection, Guid processId, string parameterName) #
Selects a single persistence parameter entity by process identifier and parameter name.

Parameters

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

Returns

Type
Description
Task<ProcessInstancePersistenceEntity>
The matching entity, or null if not found.
public Task<int> DeleteByProcessIdAsync(SqliteConnection connection, Guid processId, SqliteTransaction transaction = null) #
Deletes all persistence parameters 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> DeleteByNameAsync(SqliteConnection connection, Guid processId, string parameterName, SqliteTransaction transaction = null) #
Deletes a single persistence parameter by process identifier and parameter name.

Parameters

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

Returns

Type
Description
Task<Int32>
The number of rows affected.
public Task UpsertAsync(SqliteConnection connection, ProcessInstancePersistenceEntity entity, bool preferUpdateFirst, SqliteTransaction transaction) #
Inserts or updates a persistence parameter, choosing the operation order based on preferUpdateFirst. When preferUpdateFirst is true, attempts UPDATE first with INSERT fallback. Otherwise, attempts INSERT first with UPDATE fallback on duplicate key.

Parameters

Name
Type
Description
connection
SqliteConnection
The SQLite connection.
entity
ProcessInstancePersistenceEntity
The persistence parameter entity to upsert.
preferUpdateFirst
Boolean
Whether to attempt UPDATE before INSERT.
transaction
SqliteTransaction
The transaction to execute within.

Returns

Type
Description
Task
A task that represents the asynchronous operation.