From dc89caefe8cbe02c65e414c1d15457a297f26c8b Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Wed, 10 Jul 2024 11:38:09 +0200 Subject: [PATCH] Add ActivityNodeIds filter to journal requests (#5741) This commit introduces the ActivityNodeIds filter to the journal request models. This enhancement allows filtering logs based on specific activity node IDs, providing more granular control over workflow instance logs. Additionally, unnecessary summary comments have been removed for clarity. --- .../WorkflowInstances/Requests/JournalFilter.cs | 13 ++++--------- .../Journal/FilteredList/Endpoint.cs | 1 + .../Journal/FilteredList/Models.cs | 17 ++--------------- 3 files changed, 7 insertions(+), 24 deletions(-) diff --git a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Requests/JournalFilter.cs b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Requests/JournalFilter.cs index 537baf49a..55f71e5e6 100644 --- a/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Requests/JournalFilter.cs +++ b/src/clients/Elsa.Api.Client/Resources/WorkflowInstances/Requests/JournalFilter.cs @@ -1,22 +1,17 @@ namespace Elsa.Api.Client.Resources.WorkflowInstances.Requests; -/// /// Represents a request to list journal records. -/// public class JournalFilter { - /// /// Gets or sets the activity IDs to filter by. - /// public ICollection? ActivityIds { get; set; } - - /// + + /// Gets or sets the activity node IDs to filter by. + public ICollection? ActivityNodeIds { get; set; } + /// Gets or sets the activity types to filter out. - /// public ICollection? ExcludedActivityTypes { get; set; } - /// /// Gets or sets the event types to filter by. - /// public ICollection? EventNames { get; set; } } \ No newline at end of file diff --git a/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowInstances/Journal/FilteredList/Endpoint.cs b/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowInstances/Journal/FilteredList/Endpoint.cs index 4787b532e..f7614af09 100644 --- a/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowInstances/Journal/FilteredList/Endpoint.cs +++ b/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowInstances/Journal/FilteredList/Endpoint.cs @@ -39,6 +39,7 @@ internal class Get : ElsaEndpoint { WorkflowInstanceId = request.WorkflowInstanceId, ActivityIds = request.Filter?.ActivityIds, + ActivityNodeIds = request.Filter?.ActivityNodeIds, ExcludeActivityTypes = request.Filter?.ExcludedActivityTypes, EventNames = request.Filter?.EventNames, }; diff --git a/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowInstances/Journal/FilteredList/Models.cs b/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowInstances/Journal/FilteredList/Models.cs index c9e56f52c..a3cbeb52c 100644 --- a/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowInstances/Journal/FilteredList/Models.cs +++ b/src/modules/Elsa.Workflows.Api/Endpoints/WorkflowInstances/Journal/FilteredList/Models.cs @@ -5,45 +5,32 @@ using FastEndpoints; namespace Elsa.Workflows.Api.Endpoints.WorkflowInstances.Journal.FilteredList; -/// /// Represents a request for a page of workflow execution log records. -/// internal class Request { - /// /// The ID of the workflow instance to get the execution log for. - /// [BindFrom("id")] public string WorkflowInstanceId { get; set; } = default!; - /// /// The filter to apply. - /// public JournalFilter? Filter { get; set; } - /// /// The zero-based page number to get. - /// public int? Page { get; set; } - /// /// The size of the page to get. - /// public int? PageSize { get; set; } - - /// + /// The number of records to skip. - /// public int? Skip { get; set; } - /// /// The number of records to take. - /// public int? Take { get; set; } } internal class JournalFilter { public ICollection? ActivityIds { get; set; } + public ICollection? ActivityNodeIds { get; set; } public ICollection? ExcludedActivityTypes { get; set; } public ICollection? EventNames { get; set; } }