diff --git a/src/modules/Elsa.Workflows.Core/Contexts/WorkflowExecutionContext.cs b/src/modules/Elsa.Workflows.Core/Contexts/WorkflowExecutionContext.cs
index c91f94870..be3520236 100644
--- a/src/modules/Elsa.Workflows.Core/Contexts/WorkflowExecutionContext.cs
+++ b/src/modules/Elsa.Workflows.Core/Contexts/WorkflowExecutionContext.cs
@@ -16,18 +16,14 @@ using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Workflows;
-///
/// A delegate entry that is used by activities to be notified when the activities they scheduled are completed.
-///
/// The activity scheduling the activity.
/// The child being scheduled.
/// The delegate to invoke when the scheduled activity completes.
/// An optional tag.
public record ActivityCompletionCallbackEntry(ActivityExecutionContext Owner, ActivityNode Child, ActivityCompletionCallback? CompletionCallback, object? Tag = default);
-///
/// Provides context to the currently executing workflow.
-///
[PublicAPI]
public partial class WorkflowExecutionContext : IExecutionContext
{
@@ -40,9 +36,7 @@ public partial class WorkflowExecutionContext : IExecutionContext
private readonly IHasher _hasher;
private readonly Action? _statusUpdatedCallback;
- ///
/// Initializes a new instance of .
- ///
private WorkflowExecutionContext(
IServiceProvider serviceProvider,
WorkflowGraph workflowGraph,
@@ -87,9 +81,7 @@ public partial class WorkflowExecutionContext : IExecutionContext
_cancellationRegistrations.Add(sysSource.Token.Register(CancelWorkflow));
}
- ///
/// Creates a new for the specified workflow.
- ///
public static async Task CreateAsync(
IServiceProvider serviceProvider,
WorkflowGraph workflowGraph,
@@ -122,9 +114,7 @@ public partial class WorkflowExecutionContext : IExecutionContext
);
}
- ///
/// Creates a new for the specified workflow.
- ///
public static async Task CreateAsync(
IServiceProvider serviceProvider,
WorkflowGraph workflowGraph,
@@ -159,9 +149,7 @@ public partial class WorkflowExecutionContext : IExecutionContext
return workflowExecutionContext;
}
- ///
/// Creates a new for the specified workflow.
- ///
public static async Task CreateAsync(
IServiceProvider serviceProvider,
WorkflowGraph workflowGraph,
@@ -202,9 +190,7 @@ public partial class WorkflowExecutionContext : IExecutionContext
return workflowExecutionContext;
}
- ///
/// Assigns the specified workflow to this workflow execution context.
- ///
/// The workflow graph to assign.
public async Task SetWorkflowGraphAsync(WorkflowGraph workflowGraph)
{
@@ -220,247 +206,157 @@ public partial class WorkflowExecutionContext : IExecutionContext
activityExecutionContext.Activity = workflowGraph.NodeIdLookup[activityExecutionContext.Activity.NodeId].Activity;
}
- ///
/// Gets the .
- ///
public IServiceProvider ServiceProvider { get; }
- ///
/// Gets the .
- ///
public IActivityRegistry ActivityRegistry { get; }
- ///
/// Gets the .
- ///
public IActivityRegistryLookupService ActivityRegistryLookup { get; }
- ///
/// Gets the workflow graph.
- ///
public WorkflowGraph WorkflowGraph { get; private set; }
- ///
/// The associated with the execution context.
- ///
public Workflow Workflow => WorkflowGraph.Workflow;
- ///
/// A graph of the workflow structure.
- ///
public ActivityNode Graph => WorkflowGraph.Root;
- ///
- /// The current status of the workflow.
- ///
+ /// The current status of the workflow.
public WorkflowStatus Status => GetMainStatus(SubStatus);
- ///
/// The current sub status of the workflow.
- ///
public WorkflowSubStatus SubStatus { get; internal set; }
- ///
/// The root associated with the execution context.
- ///
public MemoryRegister MemoryRegister { get; private set; } = default!;
- ///
/// A unique ID of the execution context.
- ///
public string Id { get; set; }
///
public IActivity Activity => Workflow;
- ///
/// An application-specific identifier associated with the execution context.
- ///
public string? CorrelationId { get; set; }
- ///
/// The ID of the workflow instance that triggered this instance.
- ///
public string? ParentWorkflowInstanceId { get; set; }
- ///
/// The date and time the workflow execution context was created.
- ///
public DateTimeOffset CreatedAt { get; set; }
- ///
/// The date and time the workflow execution context was last updated.
- ///
public DateTimeOffset UpdatedAt { get; set; }
- ///
/// The date and time the workflow execution context has finished.
- ///
public DateTimeOffset? FinishedAt { get; set; }
- ///
/// Gets the clock used to determine the current time.
- ///
public ISystemClock SystemClock { get; }
- ///
/// A flattened list of s from the .
- ///
public IReadOnlyCollection Nodes => WorkflowGraph.Nodes.ToList();
- ///
/// A map between activity IDs and s in the workflow graph.
- ///
public IDictionary NodeIdLookup => WorkflowGraph.NodeIdLookup;
- ///
/// A map between hashed activity node IDs and s in the workflow graph.
- ///
public IDictionary NodeHashLookup => WorkflowGraph.NodeHashLookup;
- ///
/// A map between s and s in the workflow graph.
- ///
public IDictionary NodeActivityLookup => WorkflowGraph.NodeActivityLookup;
- ///
/// The for the execution context.
- ///
public IActivityScheduler Scheduler { get; }
- ///
/// Gets the .
- ///
public IIdentityGenerator IdentityGenerator { get; }
- ///
/// A collection of collected bookmarks during workflow execution.
- ///
public ICollection Bookmarks { get; set; } = new List();
- ///
/// A dictionary of inputs provided at the start of the current workflow execution.
- ///
public IDictionary Input { get; set; }
- ///
/// A dictionary of outputs provided by the current workflow execution.
- ///
public IDictionary Output { get; set; } = new Dictionary();
///
public IDictionary Properties { get; set; }
- ///
/// A dictionary that can be used by application code and middleware to store information and even services. Values do not need to be serializable.
/// All data will be gone once workflow execution completes.
- ///
public IDictionary