biz.dfch.CS.StateMachine 1.2.2

dotnet add package biz.dfch.CS.StateMachine --version 1.2.2
NuGet\Install-Package biz.dfch.CS.StateMachine -Version 1.2.2
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="biz.dfch.CS.StateMachine" Version="1.2.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add biz.dfch.CS.StateMachine --version 1.2.2
#r "nuget: biz.dfch.CS.StateMachine, 1.2.2"
#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 biz.dfch.CS.StateMachine as a Cake Addin
#addin nuget:?package=biz.dfch.CS.StateMachine&version=1.2.2

// Install biz.dfch.CS.StateMachine as a Cake Tool
#tool nuget:?package=biz.dfch.CS.StateMachine&version=1.2.2


A simple C# based State Machine that can be configured via State Transitions based on an idea by [Juliet]( "[Simple state machine example in C#?]("


The project contains an extendable StateMachine that defines a few simple states and two conditions ("Continue", "Cancel") that can be used to advance (transition) through that state machine.

When instatiating the StateMachine with the default constructor the following states, conditions and transitions will be set up per default

## States

* Running
* InternalErrorState
* Completed
* Cancelled
* Disposed

## Conditions

* Continue
* Cancel

## Transitions

Source state | Condition | Target state
Created | Continue | Running
Created | Cancel | InternalErrorState
Running | Continue | Completed
Running | Cancel | Cancelled
Completed | Continue | Disposed
Completed | Cancel | InternalErrorState
Cancelled | Continue | Disposed
Cancelled | Cancel | InternalErrorState
InternalErrorState | Continue | Disposed

## Basic functionalities

1. The [`Continue`](./biz.dfch.CS.StateMachine/StateMachine.cs#L94) condition makes a transition from an arbitrary state to the next state as the "good case"
1. The [`Cancel`](./biz.dfch.CS.StateMachine/StateMachine.cs#L02) condition makes a transition from an arbitrary state to the next state as the "bad case"
1. Furthermore there is the [`GetNext`](./biz.dfch.CS.StateMachine/StateMachine.cs#L306) method to transit to the next state based on a given condition.

There are as well methods for exporting and importing the configuration along with the states:

* [`GetStringRepresentation()`](
* [`SetupStateMachine(String configuration, String currentState = null, String previousState = null)`](

Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on biz.dfch.CS.StateMachine:

Package Downloads

biz.dfch.CS.Entity.LifeCycleManager ============================== Allows managing the lifecycle of entities. Supports pre- and post-callouts/hooks. Internally the LifeCycleManager uses the [biz.dfch.CS.StateMachine]( ## License Information Telerik JustMock has to be licensed separately. Only the code samples (source code files) are licensed under the Apache 2.0 license. The Telerik JustMock software has to be licensed separately. See the NOTICE file for more information about this.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.2.2 1,364 1/4/2016
1.2.1 1,130 12/21/2015
1.2.0 1,168 9/26/2015
1.1.0 1,075 9/23/2015
1.0.3 1,250 8/21/2015
1.0.2 1,110 8/11/2015
1.0.1 1,416 8/3/2015
1.0.0 1,740 7/31/2015

* Changed default value of InitialState property to 'InitialState' (Was 'Created')