From a1b7afdf4fed9df4bd9461d96f1df2545f3181da Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Tue, 23 Jan 2024 22:01:13 +0100 Subject: [PATCH] Reorder methods in WorkflowStateExtractor service The private methods within the WorkflowStateExtractor service have been reordered for readability and maintainability. The `ApplyInput` and `GetPersistableInput` methods have been moved to a position just before the `ExtractProperties` method. This ensures that similar or related methods are grouped together, improving the logical structure of the code. --- .../Services/WorkflowStateExtractor.cs | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/modules/Elsa.Workflows.Core/Services/WorkflowStateExtractor.cs b/src/modules/Elsa.Workflows.Core/Services/WorkflowStateExtractor.cs index 347f7f703..3a6ce6851 100644 --- a/src/modules/Elsa.Workflows.Core/Services/WorkflowStateExtractor.cs +++ b/src/modules/Elsa.Workflows.Core/Services/WorkflowStateExtractor.cs @@ -35,6 +35,24 @@ public class WorkflowStateExtractor : IWorkflowStateExtractor return state; } + + /// + public WorkflowExecutionContext Apply(WorkflowExecutionContext workflowExecutionContext, WorkflowState state) + { + workflowExecutionContext.Id = state.Id; + workflowExecutionContext.CorrelationId = state.CorrelationId; + workflowExecutionContext.SubStatus = state.SubStatus; + workflowExecutionContext.Bookmarks = state.Bookmarks; + workflowExecutionContext.Output = state.Output; + workflowExecutionContext.ExecutionLogSequence = state.ExecutionLogSequence; + workflowExecutionContext.CreatedAt = state.CreatedAt; + ApplyInput(state, workflowExecutionContext); + ApplyProperties(state, workflowExecutionContext); + ApplyActivityExecutionContexts(state, workflowExecutionContext); + ApplyCompletionCallbacks(state, workflowExecutionContext); + ApplyScheduledActivities(state, workflowExecutionContext); + return workflowExecutionContext; + } private void ApplyInput(WorkflowState state, WorkflowExecutionContext workflowExecutionContext) { @@ -59,24 +77,6 @@ public class WorkflowStateExtractor : IWorkflowStateExtractor return filteredInput; } - /// - public WorkflowExecutionContext Apply(WorkflowExecutionContext workflowExecutionContext, WorkflowState state) - { - workflowExecutionContext.Id = state.Id; - workflowExecutionContext.CorrelationId = state.CorrelationId; - workflowExecutionContext.SubStatus = state.SubStatus; - workflowExecutionContext.Bookmarks = state.Bookmarks; - workflowExecutionContext.Output = state.Output; - workflowExecutionContext.ExecutionLogSequence = state.ExecutionLogSequence; - workflowExecutionContext.CreatedAt = state.CreatedAt; - ApplyInput(state, workflowExecutionContext); - ApplyProperties(state, workflowExecutionContext); - ApplyActivityExecutionContexts(state, workflowExecutionContext); - ApplyCompletionCallbacks(state, workflowExecutionContext); - ApplyScheduledActivities(state, workflowExecutionContext); - return workflowExecutionContext; - } - private void ExtractProperties(WorkflowState state, WorkflowExecutionContext workflowExecutionContext) { state.Properties = workflowExecutionContext.Properties;