Stateless 5.16.0-dev-9828500365

This is a prerelease version of Stateless.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Stateless --version 5.16.0-dev-9828500365                
NuGet\Install-Package Stateless -Version 5.16.0-dev-9828500365                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Stateless" Version="5.16.0-dev-9828500365" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Stateless --version 5.16.0-dev-9828500365                
#r "nuget: Stateless, 5.16.0-dev-9828500365"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Stateless as a Cake Addin
#addin nuget:?package=Stateless&version=5.16.0-dev-9828500365&prerelease

// Install Stateless as a Cake Tool
#tool nuget:?package=Stateless&version=5.16.0-dev-9828500365&prerelease                

Stateless

Create state machines and lightweight state machine-based workflows directly in .NET code:

var phoneCall = new StateMachine<State, Trigger>(State.OffHook);

phoneCall.Configure(State.OffHook)
    .Permit(Trigger.CallDialled, State.Ringing);

phoneCall.Configure(State.Connected)
    .OnEntry(t => StartCallTimer())
    .OnExit(t => StopCallTimer())
    .InternalTransition(Trigger.MuteMicrophone, t => OnMute())
    .InternalTransition(Trigger.UnmuteMicrophone, t => OnUnmute())
    .InternalTransition<int>(_setVolumeTrigger, (volume, t) => OnSetVolume(volume))
    .Permit(Trigger.LeftMessage, State.OffHook)
    .Permit(Trigger.PlacedOnHold, State.OnHold);

// ...

phoneCall.Fire(Trigger.CallDialled);
Assert.AreEqual(State.Ringing, phoneCall.State);

This project, as well as the example above, was inspired by Simple State Machine (Archived).

Features

Most standard state machine constructs are supported:

  • Generic support for states and triggers of any .NET type (numbers, strings, enums, etc.)
  • Hierarchical states
  • Entry/exit actions for states
  • Guard clauses to support conditional transitions
  • Introspection

Some useful extensions are also provided:

  • Ability to store state externally (for example, in a property tracked by an ORM)
  • Parameterised triggers
  • Reentrant states
  • Export to DOT graph

Documentation

For guidance on how to use Stateles, the project README file contains documentation and code examples. The source repository also includes a few example projects.

Contributing

We welcome contributions to this project. Check CONTRIBUTING.md for more info.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.6.2

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (53)

Showing the top 5 NuGet packages that depend on Stateless:

Package Downloads
LittleForker

A utility to assist with spawing child processes, monitor their lifecycle and co-operative shutdown.

DiegoRangel.DotNet.Framework.CQRS.Domain.Core

A common library for implementing CQRS based Domain layer.

Hyperledger.Aries

.NET Core tools for building agent services

RedoSocial.Platform.ViewModels.Rx

Package Description

RawRabbit.Operations.StateMachine

Integrate RawRabbit with the Stateless StateMachine.

GitHub repositories (11)

Showing the top 5 popular GitHub repositories that depend on Stateless:

Repository Stars
microsoft/ailab
Experience, Learn and Code the latest breakthrough innovations with Microsoft AI
github/VisualStudio
GitHub Extension for Visual Studio
Azure/iotedge
The IoT Edge OSS project
dotnetGame/MineCase
Minecraft server based on Orleans
pardahlman/RawRabbit
A modern .NET framework for communication over RabbitMq
Version Downloads Last updated
5.16.0 629,276 5/24/2024
5.16.0-dev-9828500365 127 7/7/2024
5.16.0-dev-9514287026 104 6/14/2024
5.16.0-dev-9221217254 115 5/24/2024
5.16.0-dev-10048603300 109 7/22/2024
5.15.0 927,514 12/29/2023
5.15.0-dev-9171714096 113 5/21/2024
5.15.0-dev-9058520056 117 5/13/2024
5.15.0-dev-8822304149 115 4/24/2024
5.15.0-dev-8790594175 115 4/22/2024
5.15.0-dev-8759383160 109 4/19/2024
5.15.0-dev-7356157229 424 12/29/2023
5.14.0 305,410 11/14/2023
5.14.0-dev-7355700004 417 12/29/2023
5.14.0-dev-7309801955 393 12/23/2023
5.14.0-dev-7232734414 439 12/16/2023
5.14.0-dev-7232709282 463 12/16/2023
5.14.0-dev-7164312319 477 12/11/2023
5.14.0-dev-7078872236 483 12/3/2023
5.14.0-dev-7078811950 470 12/3/2023
5.14.0-dev-6860395514 474 11/14/2023
5.14.0-dev-6851669594 452 11/13/2023
5.14.0-dev-6851630770 448 11/13/2023
5.14.0-dev-6823242034 948 11/10/2023
5.14.0-dev-6813247520 479 11/9/2023
5.14.0-dev-6811706736 427 11/9/2023
5.14.0-dev-6801352798 458 11/8/2023
5.13.0 1,952,589 12/29/2022
5.13.0-dev-6799430915 458 11/8/2023
5.13.0-dev-6746401636 455 11/7/2023
5.13.0-dev-5455458583 737 7/4/2023
5.13.0-dev-5455401408 634 7/4/2023
5.13.0-dev-5235510771 614 6/11/2023
5.13.0-dev-5157129238 667 6/2/2023
5.13.0-dev-4941000713 670 5/10/2023
5.13.0-dev-4940972813 670 5/10/2023
5.13.0-dev-4838097297 650 4/29/2023
5.13.0-dev-4838091545 666 4/29/2023
5.13.0-dev-4838052982 654 4/29/2023
5.13.0-dev-4832488606 634 4/28/2023
5.13.0-dev-4716514070 658 4/17/2023
5.13.0-dev-4701624597 673 4/14/2023
5.13.0-dev-4701061956 650 4/14/2023
5.13.0-dev-4027208421 671 1/27/2023
5.13.0-dev-4027203589 698 1/27/2023
5.13.0-dev-4027201259 701 1/27/2023
5.13.0-dev-3800477155 664 12/29/2022
5.12.0 694,209 10/17/2022
5.12.0-dev-3553426836 681 11/26/2022
5.12.0-dev-3498786305 683 11/18/2022
5.12.0-dev-3267018252 692 10/17/2022
5.11.0 3,685,984 4/28/2021
5.11.0-dev-3264102134 666 10/17/2022
5.11.0-dev-3191463566 645 10/17/2022
5.10.1 450,347 2/17/2021
5.10.1-dev-791423646 838 4/28/2021
5.10.1-dev-787896296 831 4/27/2021
5.10.1-dev-787889564 830 4/27/2021
5.10.1-dev-574334224 847 2/17/2021
5.10.0 4,413 2/14/2021
5.10.0-dev-560201439 807 2/12/2021
5.10.0-dev-560186344 852 2/12/2021
5.10.0-dev-542672901 973 2/6/2021
5.10.0-dev-542661127 885 2/6/2021
5.2.0 5,050 2/15/2021
5.2.0-dev-568743626 879 2/15/2021
5.1.9-dev-00610 876 2/6/2021
5.1.9-dev-00600 873 1/31/2021
5.1.8 557,115 1/13/2021
5.1.8-dev-00558 861 1/16/2021
5.1.8-dev-00553 901 1/13/2021
5.1.7 25,298 1/10/2021
5.1.7-dev-00548 916 1/10/2021
5.1.6 2,542 1/10/2021
5.1.6-dev-00547 920 1/10/2021
5.1.6-dev-00544 896 1/10/2021
5.1.5 548,676 11/17/2020
5.1.5-dev-00528 894 11/17/2020
5.1.4 89,640 11/7/2020
5.1.4-dev-00522 944 11/7/2020
5.1.4-dev-00521 952 11/7/2020
5.1.3 1,059,693 8/13/2020
5.1.3-dev-00520 1,011 11/7/2020
5.1.3-dev-00513 952 8/12/2020
5.1.2 659,611 4/27/2020
5.1.2-dev-00508 904 8/12/2020
5.1.2-dev-00501 949 4/27/2020
5.1.1 172,346 4/3/2020
5.1.1-dev-00500 993 4/27/2020
5.1.1-dev-00499 942 4/27/2020
5.1.1-dev-00492 996 4/3/2020
5.1.0 52,521 3/28/2020
5.1.0-dev-00489 994 4/3/2020
5.1.0-dev-00486 975 4/3/2020
5.1.0-dev-00485 996 4/3/2020
5.1.0-dev-00481 995 3/26/2020
5.1.0-dev-00480 1,004 3/26/2020
5.1.0-dev-00479 942 3/25/2020
5.1.0-dev-00478 970 3/25/2020
5.1.0-dev-00477 942 3/24/2020
5.0.0 233,065 2/29/2020
5.0.0-dev-00476 965 3/24/2020
5.0.0-dev-00473 974 3/13/2020
5.0.0-dev-00472 955 3/13/2020
5.0.0-dev-00471 988 3/13/2020
5.0.0-dev-00464 1,003 2/27/2020
5.0.0-dev-00463 1,050 2/27/2020
4.4.0 225,919 2/7/2020
4.4.0-dev-00453 1,055 2/6/2020
4.4.0-dev-00451 1,005 2/6/2020
4.4.0-dev-00450 1,004 2/6/2020
4.4.0-dev-00447 1,001 2/6/2020
4.4.0-dev-00445 949 2/6/2020
4.4.0-dev-00443 1,287 2/6/2020
4.3.0 254,731 11/18/2019
4.2.1 3,256,218 6/2/2018
4.2.0 17,382 6/1/2018
4.2.0-dev-00366 1,446 6/2/2018
4.2.0-dev-00364 1,399 6/1/2018
4.2.0-dev-00363 1,494 6/1/2018
4.2.0-dev-00360 1,469 6/1/2018
4.2.0-dev-00355 1,601 5/31/2018
4.2.0-dev-00350 1,527 5/28/2018
4.2.0-dev-00349 1,555 5/28/2018
4.1.0 39,425 5/18/2018
4.1.0-dev-00341 1,489 5/18/2018
4.1.0-dev-00340 1,431 5/18/2018
4.1.0-dev-00337 1,461 5/18/2018
4.1.0-dev-00331 1,628 5/15/2018
4.1.0-dev-00326 1,423 5/14/2018
4.1.0-dev-00319 3,908 5/11/2018
4.1.0-dev-00316 1,419 5/11/2018
4.1.0-dev-00311 1,583 5/7/2018
4.1.0-dev-00307 1,513 5/4/2018
4.1.0-dev-00299 1,491 4/27/2018
4.0.1-dev-00294 1,728 4/24/2018
4.0.1-dev-00275 12,910 3/24/2018
4.0.1-dev-00260 6,072 10/18/2017
4.0.1-dev-00258 1,645 10/16/2017
4.0.1-dev-00256 1,876 10/6/2017
4.0.0 737,989 9/30/2017
4.0.0-dev-00247 3,319 7/27/2017
4.0.0-dev-00244 2,727 6/15/2017
4.0.0-dev-00242 1,836 6/13/2017
4.0.0-dev-00236 1,531 6/1/2017
4.0.0-dev-00223 1,593 5/19/2017
4.0.0-dev-00221 1,492 5/17/2017
4.0.0-dev-00220 1,431 5/17/2017
4.0.0-dev-00217 2,694 5/15/2017
4.0.0-dev-00196 1,989 4/6/2017
4.0.0-dev-00194 1,464 4/6/2017
4.0.0-dev-00187 1,510 4/6/2017
4.0.0-dev-00177 1,652 3/24/2017
4.0.0-dev-00175 1,480 3/24/2017
4.0.0-dev-00173 1,487 3/24/2017
3.2.0-dev-00170 1,710 3/24/2017
3.2.0-dev-00168 1,523 3/20/2017
3.2.0-dev-00166 1,686 2/28/2017
3.1.1-dev-00165 1,588 2/28/2017
3.1.1-dev-00162 1,472 2/28/2017
3.1.1-dev-00155 1,522 2/20/2017
3.1.1-dev-00152 1,646 2/7/2017
3.1.1-dev-00151 1,619 1/22/2017
3.1.1-dev-00143 1,585 1/3/2017
3.1.1-dev-00141 1,590 1/2/2017
3.1.0 732,239 12/15/2016
3.0.2-dev-00132 2,039 12/8/2016
3.0.1 15,451 11/23/2016
3.0.1-dev-00123 1,519 11/22/2016
3.0.1-dev-00113 1,936 11/11/2016
3.0.0 105,415 11/3/2016
3.0.0-dev-00109 1,591 11/2/2016
3.0.0-dev-00108 1,574 11/2/2016
3.0.0-dev-00106 1,572 11/2/2016
3.0.0-dev-00105 1,712 11/1/2016
3.0.0-dev-00099 1,745 10/31/2016
3.0.0-dev-00094 2,512 10/3/2016
3.0.0-dev-00093 1,454 10/3/2016
3.0.0-dev-00092 1,506 10/3/2016
2.5.84 106,788 8/23/2016
2.5.80 47,688 7/25/2016
2.5.79 77,615 7/19/2016
2.5.68 12,957 7/1/2016
2.5.66 2,136 6/30/2016
2.5.62 23,240 3/29/2016
2.5.61 37,632 3/22/2016
2.5.59 3,765 3/7/2016
2.5.56 18,995 2/25/2016
2.5.53 95,548 2/3/2016
2.5.40 7,366 1/25/2016
2.5.36 21,673 12/10/2015
2.5.29 41,865 11/7/2015
2.5.28 2,120 11/7/2015
2.5.23 4,145 10/28/2015
2.5.21 41,883 7/6/2015
2.5.18 9,160 6/9/2015
2.5.15 13,028 4/9/2015
2.5.11 64,955 10/26/2014
2.5.10 2,315 10/23/2014
2.5.8 6,495 10/20/2014
2.4.0 60,645 3/19/2013
2.3.1.1 45,904 1/7/2011