Skip to content

Commit 4c7499b

Browse files
committed
Include WorkflowInstanceId and TaskId in Payload
Signed-off-by: Victor Chang <[email protected]>
1 parent 14da905 commit 4c7499b

File tree

10 files changed

+461
-21
lines changed

10 files changed

+461
-21
lines changed

src/Api/Storage/Payload.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ public enum PayloadState
6464

6565
public string CorrelationId { get; init; }
6666

67+
public string? WorkflowInstanceId { get; init; }
68+
69+
public string? TaskId { get; init; }
70+
6771
public int Count { get => Files.Count; }
6872

6973
public bool HasTimedOut { get => ElapsedTime().TotalSeconds >= Timeout; }
@@ -80,13 +84,20 @@ public TimeSpan Elapsed
8084
public int FilesFailedToUpload { get => Files.Count(p => p.IsUploadFailed); }
8185

8286
public Payload(string key, string correlationId, uint timeout)
87+
: this(key, correlationId, null, null, timeout)
88+
{
89+
}
90+
91+
public Payload(string key, string correlationId, string? workflowInstanceId, string? taskId, uint timeout)
8392
{
8493
Guard.Against.NullOrWhiteSpace(key, nameof(key));
8594

8695
Files = new List<FileStorageMetadata>();
8796
_lastReceived = new Stopwatch();
8897

8998
CorrelationId = correlationId;
99+
WorkflowInstanceId = workflowInstanceId;
100+
TaskId = taskId;
90101
MachineName = Environment.MachineName;
91102
DateTimeCreated = DateTime.UtcNow;
92103
PayloadId = Guid.NewGuid();

0 commit comments

Comments
 (0)