[StateMachineBehavior]
public class Document : IStateMachine
{
public static void Build(IStateMachineBuilder builder) => builder
.AddInitialState<New>(b => b
.AddTransition<Review, ApprovalPending>(b => b
.AddEffect<ReviewEffect>()
)
.AddTransition<AfterOneMinute, ReportAutorejection, Rejected>()
)
.AddState<ApprovalPending>(b => b
.AddTransition<Approve, Approved>()
.AddTransition<Reject, ReportRejection, Rejected>()
)
.AddCompositeState<Approved>(b => b
.AddInitialState<GeneratingInvoice>(b => b
.AddDoActivity<Invoicing>()
.AddTransition<DoActivityFinalized, InvoiceGenerated>()
)
.AddState<InvoiceGenerated>(b => b
.AddTransition<PaymentBooked, VerifyPayment, Paid>()
)
)
.AddState<Paid>()
.AddState<Rejected>()
;
}
Stateflows is a UML-inspired implementation of executable State Machines and Activities, designed to simplify the modeling and execution of complex workflows.
Built on top of actor model and UML State Machine and Activity concepts, Stateflows provides a powerful framework for defining and managing stateful workflows in a clear and intuitive manner.
Designed with business applications in mind, Stateflows provides enterprise-grade capabilities for processes development.
Supports .NET 8.0+.