Questions tagged [stateless-state-machine]

A C# Hierarchical State Machine. A simple library for creating state machines in C# code. Alias, "dotnet-state-machine"

33 questions
20
votes
1 answer

Basic State Machine setup using Stateless

I have some fairly simple state needs (for now). I think I would like to model these using the Stateless api. (But I don't really know much about state machines, so I could be wrong.) But I am getting caught up in the terminology (Specifically…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
20
votes
5 answers

.NET Workflow Engine Suggestions

I came across stateless, a hierarchical state machine framework based on Simple State Machine for Boo, but configured using C# 3.0 It is easy to configure and use, I will probably use it soon. But I was just wondering if Anyone used stateless for…
Leyu
  • 2,687
  • 2
  • 23
  • 27
19
votes
2 answers

how to get advantage of stateless framework

I would like to use http://code.google.com/p/stateless in my code to separate the functionality from its dependencies. I didn't find any advanced examples of the usage, so this question is about stateless framework best practices. I have following…
Tomas Panik
  • 4,337
  • 2
  • 22
  • 31
13
votes
1 answer

Stateless state machine library - appropriate way to structure?

How do people structure their code when using the c# stateless library? https://github.com/nblumhardt/stateless I'm particularly interested in how this ties in with injected dependencies, and a correct approach of responsibilities and layering…
dandcg
  • 442
  • 4
  • 16
12
votes
1 answer

How to log state transitions in Stateless (.NET state machine library)

I would like to have a log in database of state transitions of my workflow. Where is the best place to trigger logging with Stateless? Should it be set-up for each State configuration : phoneCall.Configure(State.Connected) .OnEntry(() =>…
Edgars Pivovarenoks
  • 1,526
  • 1
  • 17
  • 31
11
votes
2 answers

How to encapsulate .NET Stateless state machine

I have a project where there is a mostly linear workflow. I'm attempting to use the .NET Stateless library to act as workflow engine/state machine. The number of examples out there is limited, but I've put together the following code: private…
mellis481
  • 4,332
  • 12
  • 71
  • 118
10
votes
1 answer

Auto advancing state machine with Stateless

I've been experimenting with Stateless (HSM in C#) (https://code.google.com/p/stateless/) lately and I've come across something that I'm not really sure how to achieve. Let's say I have the following states: Start. Connect Read Finish What I'm…
jpmnteiro
  • 747
  • 1
  • 13
  • 23
6
votes
1 answer

Split state machine in several classes using Stateless library

In a C# solution I'm working at, the core of application logic is implemented as a state-machine by means of (very good) Stateless library. There are other parts of business logic modeled in a number of other classes, for the different areas and…
superjos
  • 12,189
  • 6
  • 89
  • 134
6
votes
3 answers

Stateless : How to define the initial substate of a state?

I am using stateless to implement logic of a state machine in our application.We have an AcceptedFile state that has other inner (sub)states.The problem is I don't know how should I indicate initial inner state in my code so that when a machine…
Beatles1692
  • 5,214
  • 34
  • 65
6
votes
1 answer

Should I fire trigger to change state from the OnEntry() method in finite state machine?

I am using stateless framework (https://code.google.com/p/stateless/) to model finite state machine in my application. There are certain states that should perform some logic and then immediately move to the next state. I am wondering is it good…
matori82
  • 3,669
  • 9
  • 42
  • 64
5
votes
1 answer

State machines: multiple conditions for determining next state?

TL;DR: Where / how should a state machine framework determine what the next state should be? Or, is this in fact out of scope for state machines, which are actually only for tracking the current state and validating whether a requested transition is…
Ryan Jendoubi
  • 192
  • 11
3
votes
1 answer

.NET stateless multiple PermitIf

I need to add multiple guards to a certain state in my .Net Stateless state machine. Consider the following mock scenario. I can only allow to go from Insert to Modify if two conditions are met: _sm.Configure(State.Insert) …
tom33pr
  • 853
  • 2
  • 12
  • 30
3
votes
2 answers

Stateless Statemachine Framework and high CPU usage

I'm using the Stateless Framework to create a StateMachine. My Main Application is a ConsoleApplication which calls the DataManager class, which calls the GetData function which starts a Task which then executes the Receiver function with the state…
user1616332
  • 181
  • 1
  • 1
  • 5
2
votes
0 answers

StateMachine (One Trigger with Two States)

I am using Statless.StateMachine and I am facing a situation where I have one trigger with two states! Let me explain, I have an application where I need to activate some buttons when a user fills out a textbox but at the same time, those buttons…
Abdulkarim Kanaan
  • 1,703
  • 4
  • 20
  • 32
2
votes
1 answer

State-machine - Stateless vs. traditional if-else code, hard to grasp the benefit

I've came across recently with a dirty if-else code, so I've looked for a refactor options and found recommendation on state-machine as an elegant replacement for dirty if-else code. But something is hard me to grasp: It looks that as client I have…
Roni
  • 369
  • 1
  • 7
  • 22
1
2 3