Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Dapr.Workflow/WorkflowState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ internal WorkflowState(WorkflowMetadata? metadata)
_metadata = metadata;
}

/// <summary>
/// Gets the name of the requested workflow that the state corresponds to.
/// </summary>
public string? WorkflowName => _metadata?.Name;

/// <summary>
/// Gets a value indicating whether the requested workflow instance exists.
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions test/Dapr.Workflow.Test/WorkflowStateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public void Properties_ShouldReturnDefaults_WhenMetadataIsNull()
Assert.Equal(DateTime.MinValue, state.LastUpdatedAt.DateTime);
Assert.Equal(WorkflowRuntimeStatus.Unknown, state.RuntimeStatus);
Assert.Null(state.FailureDetails);
Assert.Null(state.WorkflowName);

Assert.Equal(default, state.ReadInputAs<int>());
Assert.Equal(default, state.ReadOutputAs<int>());
Expand Down Expand Up @@ -60,6 +61,7 @@ public void Properties_ShouldReflectMetadata_WhenPresent()
Assert.Equal(created, state.CreatedAt.DateTime);
Assert.Equal(updated, state.LastUpdatedAt.DateTime);
Assert.Equal(WorkflowRuntimeStatus.Running, state.RuntimeStatus);
Assert.Equal("wf", state.WorkflowName);
}

[Fact]
Expand Down
Loading