Skip to content

AuditingWorkflowDefinitionStore

Namespace AgentPrism · Assembly AgentPrism.Core.dll

Wraps IWorkflowDefinitionStore in a decorator that writes an audit trail.

public sealed class AuditingWorkflowDefinitionStore : IWorkflowDefinitionStore, IAuditDecorated

objectAuditingWorkflowDefinitionStore

IWorkflowDefinitionStore, IAuditDecorated

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

A workflow definition chains catalog agents and can start dozens of model calls from one request. The workflow.save and workflow.delete actions therefore always enter the audit trail.

AuditingWorkflowDefinitionStore(IWorkflowDefinitionStore, IAuditLog, IAuditActorResolver, ILogger<AuditingWorkflowDefinitionStore>)

Section titled “ AuditingWorkflowDefinitionStore(IWorkflowDefinitionStore, IAuditLog, IAuditActorResolver, ILogger<AuditingWorkflowDefinitionStore>)”

Initializes a new audited workflow definition store.

public AuditingWorkflowDefinitionStore(IWorkflowDefinitionStore inner, IAuditLog auditLog, IAuditActorResolver actorResolver, ILogger<AuditingWorkflowDefinitionStore> logger)

inner IWorkflowDefinitionStore

The wrapped store.

auditLog IAuditLog

The audit log.

actorResolver IAuditActorResolver

The actor resolver.

logger ILogger<AuditingWorkflowDefinitionStore>

The logger.

ArgumentNullException

A dependency is null.

Gets the real store instance the decorator wraps.

public object AuditedInner { get; }

object

DeleteAsync(string, string, CancellationToken)

Section titled “ DeleteAsync(string, string, CancellationToken)”

Deletes the definition.

public ValueTask<bool> DeleteAsync(string tenantId, string name, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

name string

The workflow name.

cancellationToken CancellationToken

The cancellation token.

ValueTask<bool>

true if the delete happened.

GetAsync(string, string, CancellationToken)

Section titled “ GetAsync(string, string, CancellationToken)”

Fetches the definition with the given name.

public ValueTask<WorkflowDefinition?> GetAsync(string tenantId, string name, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

name string

The workflow name.

cancellationToken CancellationToken

The cancellation token.

ValueTask<WorkflowDefinition?>

The definition; null if it does not exist.

Lists all of a tenant’s definitions, by name.

public ValueTask<IReadOnlyList<WorkflowDefinition>> ListAsync(string tenantId, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

cancellationToken CancellationToken

The cancellation token.

ValueTask<IReadOnlyList<WorkflowDefinition>>

The definitions.

SaveAsync(string, WorkflowDefinition, CancellationToken)

Section titled “ SaveAsync(string, WorkflowDefinition, CancellationToken)”

Saves the definition. The incoming WorkflowDefinition.Version value is ignored; the store determines the version number.

public ValueTask<WorkflowDefinition> SaveAsync(string tenantId, WorkflowDefinition definition, CancellationToken cancellationToken = default)

tenantId string

The tenant identifier.

definition WorkflowDefinition

The definition to save.

cancellationToken CancellationToken

The cancellation token.

ValueTask<WorkflowDefinition>

The definition with its version number assigned.