Add ElsaWorkflowInstanceStore and workflow instance indexing
Introduced `ElsaWorkflowInstanceStore` for managing workflow instances, including querying, saving, updating, and deleting. Added associated index provider and schema changes for indexing workflow instances, enabling efficient data retrieval. Updated startup and manifest files to register these new functionalities.
This commit is contained in:
parent
255bb26dff
commit
78eebe67ee
|
|
@ -15,6 +15,6 @@ public static class WorkflowInstanceStoreExtensions
|
|||
/// </summary>
|
||||
public static async ValueTask<WorkflowInstance?> FindAsync(this IWorkflowInstanceStore store, string id, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return await store.FindAsync(new WorkflowInstanceFilter{ Id = id }, cancellationToken);
|
||||
return await store.FindAsync(new() { Id = id }, cancellationToken);
|
||||
}
|
||||
}
|
||||
|
|
@ -134,7 +134,7 @@ public class WorkflowInstanceFilter
|
|||
|
||||
if (TimestampFilters != null)
|
||||
{
|
||||
foreach (TimestampFilter timestampFilter in TimestampFilters)
|
||||
foreach (var timestampFilter in TimestampFilters)
|
||||
{
|
||||
var column = timestampFilter.Column;
|
||||
var timestamp = timestampFilter.Timestamp;
|
||||
|
|
|
|||
|
|
@ -33,32 +33,31 @@ public class WorkflowInstanceSummary
|
|||
/// <summary>
|
||||
/// Returns a summary view of the specified <see cref="WorkflowInstance"/>.
|
||||
/// </summary>
|
||||
public static Expression<Func<WorkflowInstance, WorkflowInstanceSummary>> FromInstanceExpression()
|
||||
=> workflowInstance => new WorkflowInstanceSummary
|
||||
{
|
||||
Id = workflowInstance.Id,
|
||||
DefinitionId = workflowInstance.DefinitionId,
|
||||
DefinitionVersionId = workflowInstance.DefinitionVersionId,
|
||||
Version = workflowInstance.Version,
|
||||
Status = workflowInstance.Status,
|
||||
SubStatus = workflowInstance.SubStatus,
|
||||
CorrelationId = workflowInstance.CorrelationId,
|
||||
Name = workflowInstance.Name,
|
||||
IncidentCount = workflowInstance.IncidentCount,
|
||||
CreatedAt = workflowInstance.CreatedAt,
|
||||
UpdatedAt = workflowInstance.UpdatedAt,
|
||||
FinishedAt = workflowInstance.FinishedAt
|
||||
};
|
||||
public static Expression<Func<WorkflowInstance, WorkflowInstanceSummary>> FromInstanceExpression() => workflowInstance => new()
|
||||
{
|
||||
Id = workflowInstance.Id,
|
||||
DefinitionId = workflowInstance.DefinitionId,
|
||||
DefinitionVersionId = workflowInstance.DefinitionVersionId,
|
||||
Version = workflowInstance.Version,
|
||||
Status = workflowInstance.Status,
|
||||
SubStatus = workflowInstance.SubStatus,
|
||||
CorrelationId = workflowInstance.CorrelationId,
|
||||
Name = workflowInstance.Name,
|
||||
IncidentCount = workflowInstance.IncidentCount,
|
||||
CreatedAt = workflowInstance.CreatedAt,
|
||||
UpdatedAt = workflowInstance.UpdatedAt,
|
||||
FinishedAt = workflowInstance.FinishedAt
|
||||
};
|
||||
|
||||
|
||||
/// <summary>The ID of the workflow instance.</summary>
|
||||
public string Id { get; set; } = default!;
|
||||
public string Id { get; set; } = null!;
|
||||
|
||||
/// <summary>The ID of the workflow definition.</summary>
|
||||
public string DefinitionId { get; set; } = default!;
|
||||
public string DefinitionId { get; set; } = null!;
|
||||
|
||||
/// <summary>The version ID of the workflow definition.</summary>
|
||||
public string DefinitionVersionId { get; set; } = default!;
|
||||
public string DefinitionVersionId { get; set; } = null!;
|
||||
|
||||
/// <summary>The version of the workflow definition.</summary>
|
||||
public int Version { get; set; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue