Skip to content

Commit b3e4b37

Browse files
author
vp
committed
fix(spec): add comment to clarify custom activity in OrderApprovalOrchestration
1 parent 63a0a72 commit b3e4b37

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

docs/specs/spec-application-orchestration.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
status: draft
33
---
44

5-
# Design Specification: Orchestration Feature (Application.Orchestration)
5+
# Design Specification: Stateful Orchestration Feature (Application.Orchestration)
66

77
> This design document outlines the architecture and behavior of the new orchestration feature within the application. It defines the core concepts, execution model, control flow capabilities, triggers, reliability mechanisms, observability features, identity management, versioning considerations, testing strategies, and typical use cases for orchestrations.
88
@@ -12,6 +12,10 @@ The orchestration feature provides a code-first framework for defining, executin
1212

1313
Orchestrations are persistent, stateful, and designed to support complex coordination scenarios, including human interaction, event-driven transitions, and fault-tolerant execution.
1414

15+
The orchestration model is state-machine-oriented. States represent stable phases of a long-running process, while activities perform work within a state. Transitions move an orchestration instance between states based on outcomes, conditions, signals, or time-based triggers.
16+
17+
The feature intentionally combines state-machine semantics with selected workflow capabilities such as activity execution, waiting, retries, human interaction, and compensation.
18+
1519
Disclaimer: this feature is not a full blown workflow engine or a business process modeling tool. It is a code-centric framework for structuring long-running processes in a maintainable and testable way. Please evaluate carefully if this feature is a good fit for your specific use case, as it can be opinionated in its execution model and may not be suitable for all scenarios. Alternatives: Elsa, Camunda, Dapr Workflows, MassTransit Courier, Temporal, Durable Functions, etc.
1620

1721
---
@@ -527,7 +531,7 @@ public sealed class OrderApprovalOrchestration
527531
builder
528532
.State("Created", state => state // sequential activities example
529533
.Activity<ValidateOrderActivity>() // custom activity example
530-
.Activity<DetermineApprovalRequirementActivity>()
534+
.Activity<DetermineApprovalRequirementActivity>() // custom activity that sets RequiresApproval in context
531535
.TransitionTo("AwaitingApproval", ctx => ctx.Data.RequiresApproval)
532536
.TransitionTo("PaymentReservation", ctx => !ctx.Data.RequiresApproval))
533537

@@ -544,7 +548,7 @@ public sealed class OrderApprovalOrchestration
544548

545549
context.Properties["ApprovalTaskId"] = taskId;
546550

547-
return OrchestrationOutcome.Continue();
551+
return OrchestrationOutcome.Continue(); // execution continues to wait for signals after this activity
548552
})
549553

550554
.WaitForSignal("OrderApproved", signal => signal // signal-driven transition example
@@ -556,7 +560,7 @@ public sealed class OrderApprovalOrchestration
556560
.WaitForSignal("OrderRejected", signal => signal
557561
.MapToContext((ctx, payload) =>
558562
{
559-
ctx.Data.RejectionReason = payload.Reason;
563+
ctx.Data.RejectionReason = payload.Reason; // mapping of signal data to context
560564
})
561565
.TransitionTo("Rejected"))
562566
.TimeoutAfter(TimeSpan.FromDays(3)) // time-based transition example

0 commit comments

Comments
 (0)