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
2
votes
1 answer

Return to the caller state?

I am using C#'s stateless state-machine, but I've had this issue in the past with other state-machine implementation. The question is mostly theoretical, though I can add some dummy code if asked for. I have a situation which I am quite unsure how…
scx
  • 3,221
  • 1
  • 19
  • 37
2
votes
0 answers

Retain Substate when reentering a State in Stateless?

I have a state machine as shown below. I have implemented this in C# using Stateless. The On state can reenter itself in case of the RequestStatus trigger. When this happens, the statemachine can be in any of the following states: On, On > Standby…
Xpleria
  • 5,472
  • 5
  • 52
  • 66
2
votes
1 answer

Stateless with Visual Studio 2015

Is it possible to use Stateless with Visual Studio 2015 without using .NET Core? https://github.com/dotnet-state-machine/stateless When loading the project, I get a number of errors with the sample…
sammy
  • 101
  • 2
  • 8
2
votes
1 answer

Stateless framework work with indepedent Forks?

We are thinking about adopt state machine Stateless Framework in our system but we have a requirement that I didn't understand yet if the Stateless framework can help or if will add complexity to our system. Why change? Because the system is growing…
andre
  • 113
  • 1
  • 10
2
votes
1 answer

Get permitted triggers with guard conditions in Stateless (.NET state machine library)

Background: I have same Trigger with mutually exclusive guard conditions defined with PermitIf that will cause transition to different states depending on those conditions. Guards have Descriptions defined and they show up nicely in brackets in…
Edgars Pivovarenoks
  • 1,526
  • 1
  • 17
  • 31
2
votes
1 answer

State Machine where a state knows what the trigger is

I am wondering if a state machine is a good pattern for this case. Say I have the following Triggers: enum Trigger { None, RSIGt70, RSILt30, TrendUp, TrendDown } And I have the following States enum State { Flat, …
Ivan
  • 7,448
  • 14
  • 69
  • 134
1
vote
0 answers

How to have every state transition to a single state when a trigger occurs using Stateless?

I am using stateless and have the following states: Foo Bar Faulted When the fault trigger happens, I want the state machine to transition to the Faulted state, regardless of the previous state. Is there a way to do that something…
JasonC
  • 139
  • 8
1
vote
0 answers

Best Practices for OnUnhandledTrigger and State Recovery

Note: This question is specifically geared towards the Stateless library for C#, and its implementation of State Machines. Scenario: I have a typical State Machine. However, I need a way to recover to a different state if I get an unexpected bad…
Mercutio
  • 43
  • 3
1
vote
1 answer

Hierarchical state with stateless

am wondering if it will do what I am after. I am thinking about a statemachine for home automation with some logic similar to this: var stateMachine = new StateMachine(State.UnOccupied); …
David Wallis
  • 185
  • 11
1
vote
0 answers

Stateless 3.0 - State Machine Library Best Practice

I'm developing an Asp.Net WebApi Application. Now I'm trying to implement state machine in my application using Stateless 3.0 library. 1. Model Class Model will have a State property, and state change logic in the model class. Once State is changed…
Rahul
  • 2,431
  • 3
  • 35
  • 77
1
vote
1 answer

Statemachine that transitions to target state and fires transitions and states between?

I recently used the Stateless state machine. I can define the rules for transitions etc. like this: stateMachine.Configure(State.Unknown) .Permit(Trigger.StartApplication, State.Initialized) .OnEntry(this.DoBeforeTransition) …
Beachwalker
  • 7,685
  • 6
  • 52
  • 94
0
votes
1 answer

Modify UI element from third party async lib callback

I'm using a third party lib which offer asynchronous methods. The lib can receive callbacks that will be executed during asynchronous operations. I'm using this lib from a Windows Forms app and passing a callback to update UI state. However, it…
Arthur Nunes
  • 6,718
  • 7
  • 33
  • 46
0
votes
1 answer

How to use permitDynamic stateless dotnet

I am tryingg to use stateless dotnet. I need a transition to be condition on a string variable. _machine.Configure(State.CalibSelectDisplay1) .Permit(Trigger.Up, State.CalibSelectDisplay2) .Permit(Trigger.Down,…
0
votes
1 answer

Stateless library - PermitIf usage with SetTriggerParameters

How do I use PermitIf with SetTriggerParameters? In this example I'm modelling a motor, which can go forward, backwards, or off (not moving). Forwards and backwards can be a double speed, so therefore I need SetTriggerParameters. Setting the…
user9993
  • 5,833
  • 11
  • 56
  • 117
0
votes
1 answer

How to use Guard Clauses with Stateless

I'm new to using Stateless and trying to make sure I understand the purpose of a guard clause. I'm able to create a state machine, but I want to essentially put a check on entering the state where the age > 12 && parent permission exists. Am I…
Simpsot
  • 1
  • 2