Skip to content

Commit 7b9a27e

Browse files
committed
Feature: Activity Execution Call Stack
1 parent dfa94e4 commit 7b9a27e

73 files changed

Lines changed: 4441 additions & 273 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Elsa.sln

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "solution", "solution", "{7D
1919
icon.png = icon.png
2020
NuGet.Config = NuGet.Config
2121
README.md = README.md
22+
plan-activityExecutionCallStack.prompt.md = plan-activityExecutionCallStack.prompt.md
2223
EndProjectSection
2324
EndProject
2425
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{0354F050-3992-4DD4-B0EE-5FBA04AC72B6}"
@@ -323,12 +324,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "issue_templates", "issue_te
323324
EndProject
324325
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dsl", "dsl", "{477C2416-312D-46AE-BCD6-8FA1FAB43624}"
325326
EndProject
326-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Resilience.Core.UnitTests", "test\unit\Elsa.Resilience.Core.UnitTests\Elsa.Resilience.Core.UnitTests.csproj", "{B8006D70-1630-43DB-A043-FA89FAC70F37}"
327-
EndProject
328-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Common.UnitTests", "test\unit\Elsa.Common.UnitTests\Elsa.Common.UnitTests.csproj", "{A3C07D5B-2A30-494E-B9BC-4B1594B31ABC}"
329-
EndProject
330-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Http.IntegrationTests", "test\integration\Elsa.Http.IntegrationTests\Elsa.Http.IntegrationTests.csproj", "{8C4F6A2D-1E9F-4B3C-9D8E-7F5A6B4C3D2E}"
331-
EndProject
332327
Global
333328
GlobalSection(SolutionConfigurationPlatforms) = preSolution
334329
Debug|Any CPU = Debug|Any CPU
@@ -585,18 +580,6 @@ Global
585580
{2B7FB49D-E4B6-4AD5-981B-3D85B94F6F48}.Debug|Any CPU.Build.0 = Debug|Any CPU
586581
{2B7FB49D-E4B6-4AD5-981B-3D85B94F6F48}.Release|Any CPU.ActiveCfg = Release|Any CPU
587582
{2B7FB49D-E4B6-4AD5-981B-3D85B94F6F48}.Release|Any CPU.Build.0 = Release|Any CPU
588-
{B8006D70-1630-43DB-A043-FA89FAC70F37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
589-
{B8006D70-1630-43DB-A043-FA89FAC70F37}.Debug|Any CPU.Build.0 = Debug|Any CPU
590-
{B8006D70-1630-43DB-A043-FA89FAC70F37}.Release|Any CPU.ActiveCfg = Release|Any CPU
591-
{B8006D70-1630-43DB-A043-FA89FAC70F37}.Release|Any CPU.Build.0 = Release|Any CPU
592-
{A3C07D5B-2A30-494E-B9BC-4B1594B31ABC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
593-
{A3C07D5B-2A30-494E-B9BC-4B1594B31ABC}.Debug|Any CPU.Build.0 = Debug|Any CPU
594-
{A3C07D5B-2A30-494E-B9BC-4B1594B31ABC}.Release|Any CPU.ActiveCfg = Release|Any CPU
595-
{A3C07D5B-2A30-494E-B9BC-4B1594B31ABC}.Release|Any CPU.Build.0 = Release|Any CPU
596-
{8C4F6A2D-1E9F-4B3C-9D8E-7F5A6B4C3D2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
597-
{8C4F6A2D-1E9F-4B3C-9D8E-7F5A6B4C3D2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
598-
{8C4F6A2D-1E9F-4B3C-9D8E-7F5A6B4C3D2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
599-
{8C4F6A2D-1E9F-4B3C-9D8E-7F5A6B4C3D2E}.Release|Any CPU.Build.0 = Release|Any CPU
600583
EndGlobalSection
601584
GlobalSection(SolutionProperties) = preSolution
602585
HideSolutionNode = FALSE
@@ -698,9 +681,6 @@ Global
698681
{2B7FB49D-E4B6-4AD5-981B-3D85B94F6F48} = {B08B4E00-C2AB-48F3-8389-449F42AEF179}
699682
{477C2416-312D-46AE-BCD6-8FA1FAB43624} = {5BA4A8FA-F7F4-45B3-AEC8-8886D35AAC79}
700683
{874F5A44-DB06-47AB-A18C-2D13942E0147} = {477C2416-312D-46AE-BCD6-8FA1FAB43624}
701-
{B8006D70-1630-43DB-A043-FA89FAC70F37} = {18453B51-25EB-4317-A4B3-B10518252E92}
702-
{A3C07D5B-2A30-494E-B9BC-4B1594B31ABC} = {18453B51-25EB-4317-A4B3-B10518252E92}
703-
{8C4F6A2D-1E9F-4B3C-9D8E-7F5A6B4C3D2E} = {1B8D5897-902E-4632-8698-E89CAF3DDF54}
704684
EndGlobalSection
705685
GlobalSection(ExtensibilityGlobals) = postSolution
706686
SolutionGuid = {D4B5CEAA-7D70-4FCB-A68E-B03FBE5E0E5E}

src/clients/Elsa.Api.Client/Resources/ActivityExecutions/Contracts/IActivityExecutionsApi.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,16 @@ public interface IActivityExecutionsApi
4545
/// <returns>The activity execution.</returns>
4646
[Get("/activity-executions/{id}")]
4747
Task<ActivityExecutionRecord?> GetAsync(string id, CancellationToken cancellationToken = default);
48-
}
48+
49+
/// <summary>
50+
/// Gets the call stack (execution chain) for a given activity execution.
51+
/// </summary>
52+
/// <param name="id">The ID of the activity execution.</param>
53+
/// <param name="includeCrossWorkflowChain">Whether to include parent workflow activities across workflow boundaries.</param>
54+
/// <param name="skip">The number of items to skip (for pagination).</param>
55+
/// <param name="take">The maximum number of items to return (for pagination).</param>
56+
/// <param name="cancellationToken">An optional cancellation token.</param>
57+
/// <returns>The response containing the call stack.</returns>
58+
[Get("/activity-executions/{id}/call-stack")]
59+
Task<ActivityExecutionCallStack> GetCallStackAsync(string id, bool? includeCrossWorkflowChain = null, int? skip = null, int? take = null, CancellationToken cancellationToken = default);
60+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
namespace Elsa.Api.Client.Resources.ActivityExecutions.Models;
2+
3+
/// <summary>
4+
/// Represents a call stack (execution chain) for a given activity execution.
5+
/// </summary>
6+
public class ActivityExecutionCallStack
7+
{
8+
/// <summary>
9+
/// The ID of the activity execution that was requested.
10+
/// </summary>
11+
public string ActivityExecutionId { get; set; } = null!;
12+
13+
/// <summary>
14+
/// The activity execution records in the call stack (ordered from root to current activity).
15+
/// </summary>
16+
public ICollection<ActivityExecutionRecord> Items { get; set; } = new List<ActivityExecutionRecord>();
17+
18+
/// <summary>
19+
/// The total number of items in the full call stack chain.
20+
/// </summary>
21+
public long TotalCount { get; set; }
22+
}

src/clients/Elsa.Api.Client/Resources/ActivityExecutions/Models/ActivityExecutionRecord.cs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,37 @@ public class ActivityExecutionRecord : Entity
8585
/// Gets or sets the status of the activity.
8686
/// </summary>
8787
public ActivityStatus Status { get; set; }
88+
89+
/// <summary>
90+
/// Gets or sets the aggregated count of faults encountered during the execution of the activity instance and its descendants.
91+
/// </summary>
92+
public int AggregateFaultCount { get; set; }
8893

8994
/// <summary>
9095
/// Gets or sets the time at which the activity execution completed.
9196
/// </summary>
9297
public DateTimeOffset? CompletedAt { get; set; }
93-
}
98+
99+
/// <summary>
100+
/// The ID of the activity execution context that scheduled this activity execution.
101+
/// This represents the temporal/execution predecessor that directly triggered execution of this activity.
102+
/// </summary>
103+
public string? SchedulingActivityExecutionId { get; set; }
104+
105+
/// <summary>
106+
/// The ID of the activity that scheduled this activity execution (denormalized for convenience).
107+
/// </summary>
108+
public string? SchedulingActivityId { get; set; }
109+
110+
/// <summary>
111+
/// The workflow instance ID of the workflow that scheduled this activity execution.
112+
/// This is set when crossing workflow boundaries (e.g., via ExecuteWorkflow or DispatchWorkflow).
113+
/// </summary>
114+
public string? SchedulingWorkflowInstanceId { get; set; }
115+
116+
/// <summary>
117+
/// The depth of this activity in the call stack (0 for root activities).
118+
/// Calculated by traversing the SchedulingActivityExecutionId chain until reaching null.
119+
/// </summary>
120+
public int? CallStackDepth { get; set; }
121+
}

0 commit comments

Comments
 (0)