From 3fb4bb18f1cd27e916c921405b9ab74b4f47a82d Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Tue, 11 Feb 2025 15:44:48 +0100 Subject: [PATCH] Rename ActivityInput to WorkflowInput and replace 'default' with 'null'. The record class was renamed to better reflect its purpose as representing workflow input. Additionally, parameters with a default value of 'default' were updated to 'null' for increased clarity and consistency. These changes improve code readability and maintainability. --- .../Extensions/WorkflowExecutionContextExtensions.cs | 12 ++++++------ .../Models/{ActivityInput.cs => WorkflowInput.cs} | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) rename src/modules/Elsa.Workflows.Core/Models/{ActivityInput.cs => WorkflowInput.cs} (70%) diff --git a/src/modules/Elsa.Workflows.Core/Extensions/WorkflowExecutionContextExtensions.cs b/src/modules/Elsa.Workflows.Core/Extensions/WorkflowExecutionContextExtensions.cs index 6745c6004..af3264fef 100644 --- a/src/modules/Elsa.Workflows.Core/Extensions/WorkflowExecutionContextExtensions.cs +++ b/src/modules/Elsa.Workflows.Core/Extensions/WorkflowExecutionContextExtensions.cs @@ -14,7 +14,7 @@ public static class WorkflowExecutionContextExtensions /// /// Schedules the workflow for execution. /// - public static ActivityWorkItem ScheduleWorkflow(this WorkflowExecutionContext workflowExecutionContext, IDictionary? input = default) + public static ActivityWorkItem ScheduleWorkflow(this WorkflowExecutionContext workflowExecutionContext, IDictionary? input = null) { var workflow = workflowExecutionContext.Workflow; var workItem = new ActivityWorkItem(workflow, input: input); @@ -25,7 +25,7 @@ public static class WorkflowExecutionContextExtensions /// /// Schedules the root activity of the workflow. /// - public static ActivityWorkItem ScheduleRoot(this WorkflowExecutionContext workflowExecutionContext, IDictionary? input = default) + public static ActivityWorkItem ScheduleRoot(this WorkflowExecutionContext workflowExecutionContext, IDictionary? input = null) { var workflow = workflowExecutionContext.Workflow; var workItem = new ActivityWorkItem(workflow.Root, input: input); @@ -36,7 +36,7 @@ public static class WorkflowExecutionContextExtensions /// /// Schedules the specified activity of the workflow. /// - public static ActivityWorkItem ScheduleActivity(this WorkflowExecutionContext workflowExecutionContext, IActivity activity, IDictionary? input = default) + public static ActivityWorkItem ScheduleActivity(this WorkflowExecutionContext workflowExecutionContext, IActivity activity, IDictionary? input = null) { var workItem = new ActivityWorkItem(activity, input: input); workflowExecutionContext.Scheduler.Schedule(workItem); @@ -46,7 +46,7 @@ public static class WorkflowExecutionContextExtensions /// /// Schedules the specified activity execution context of the workflow. /// - public static ActivityWorkItem ScheduleActivityExecutionContext(this WorkflowExecutionContext workflowExecutionContext, ActivityExecutionContext activityExecutionContext, IDictionary? input = default) + public static ActivityWorkItem ScheduleActivityExecutionContext(this WorkflowExecutionContext workflowExecutionContext, ActivityExecutionContext activityExecutionContext, IDictionary? input = null) { var workItem = new ActivityWorkItem(activityExecutionContext.Activity, input: input, existingActivityExecutionContext: activityExecutionContext); workflowExecutionContext.Scheduler.Schedule(workItem); @@ -57,7 +57,7 @@ public static class WorkflowExecutionContextExtensions /// Schedules the activity of the specified bookmark. /// /// The created work item, or null if the specified bookmark doesn't exist in the - public static ActivityWorkItem? ScheduleBookmark(this WorkflowExecutionContext workflowExecutionContext, Bookmark bookmark, IDictionary? input = default) + public static ActivityWorkItem? ScheduleBookmark(this WorkflowExecutionContext workflowExecutionContext, Bookmark bookmark, IDictionary? input = null) { // Get the activity execution context that owns the bookmark. var bookmarkedActivityContext = workflowExecutionContext.ActivityExecutionContexts.FirstOrDefault(x => x.Id == bookmark.ActivityInstanceId); @@ -101,7 +101,7 @@ public static class WorkflowExecutionContextExtensions this WorkflowExecutionContext workflowExecutionContext, ActivityNode activityNode, ActivityExecutionContext owner, - ScheduleWorkOptions? options = default) + ScheduleWorkOptions? options = null) { // Validate that the specified activity is part of the workflow. if (!workflowExecutionContext.NodeActivityLookup.ContainsKey(activityNode.Activity)) diff --git a/src/modules/Elsa.Workflows.Core/Models/ActivityInput.cs b/src/modules/Elsa.Workflows.Core/Models/WorkflowInput.cs similarity index 70% rename from src/modules/Elsa.Workflows.Core/Models/ActivityInput.cs rename to src/modules/Elsa.Workflows.Core/Models/WorkflowInput.cs index a1bc13175..bdbb2e014 100644 --- a/src/modules/Elsa.Workflows.Core/Models/ActivityInput.cs +++ b/src/modules/Elsa.Workflows.Core/Models/WorkflowInput.cs @@ -1,6 +1,6 @@ namespace Elsa.Workflows.Models; /// -/// Represents an activity input name and value. +/// Represents a workflow input name and value. /// public record WorkflowInput(string Name, object? Value); \ No newline at end of file