Questions tagged [finite-state-machine]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
40 views

Is it OK for Finite State Machine entry actions to trigger events?

We're using some FSM library that allows you to define entry and exit actions. For some reason, somebody needed to do this fsm.Configure(State.A) .Permit(Trigger.A, State.B) ....
user avatar
  • 383
0 votes
3 answers
58 views

UML - State Machine Diagrams: Mapping States which can be transitioned to from anywhere

I am trying to model a case management system in a UML State Machine Diagram. It is an approval style process and the case can enter a withdrawn state at any time if it is no longer required. This ...
user avatar
0 votes
2 answers
132 views

Why are these options correct for this state machine diagram question?

Considering the following state machine diagram, it is CORRECT to state that: Select one or more: a. the Restart event will always be executed in the Halted state. b. After a Halt and Restart event ...
user avatar
0 votes
1 answer
191 views

How can I unit test state machines in C

In an 8bit mcu, I wrote a piece of code of a state machine using a function pointer static void (*state)(void);. Inside the same compilation (let's say sm.c) unit I implement all the available states. ...
user avatar
  • 203
1 vote
1 answer
72 views

Hierarchical State Machines - Ortho Regions

I am rather unclear about how an event gets processed when a state machine has orthogonal regions. I did read that With composite states, that an event should be sent to the innermost state, and if ...
user avatar
1 vote
5 answers
258 views

Do state machine based programs have a processing loop - or even exist?

Short Version If we had an application based on a state machine - transitioning between states to run the application: is repetition, and in fact the entire state machine, based on the presence of an ...
user avatar
  • 23.7k
1 vote
0 answers
81 views

Terse finite state machines in Haskell

I'm writing a parser for a markup language in haskell, and a finite state machine fell out of my ideal API. I have code that looks a bit like this: Token = BoldWord String | Word String | ...
user avatar
  • 281
1 vote
1 answer
101 views

State Pattern when the Behavior in Object of Type A is Dependent on the State of the Object of Type B

I have used the state pattern for my web application where a user can be in one of three states: activated, required_activation and suspended. I have created 3 states classes as given below (source is ...
user avatar
  • 137
1 vote
1 answer
74 views

Do State diagrams Only Represent Individual Objects states?

On website uml-diagrams.org it is mentioned that state machine diagram is a behavior diagram which shows discrete behavior of a part of designed system through finite state transitions. To the best of ...
user avatar
4 votes
1 answer
100 views

Using Choice Node in State Machine Diagrams

In State Machine diagrams, in some online resources, the condition is merely drawn on the arrow (the left figure below) and in others similar to right figure, where a choice node is specifically used. ...
user avatar
1 vote
1 answer
53 views

State Diagram: How to Represent a Parent/Child Object's States Properly?

I made a state diagram for the Purchase object (parent) and for the Item object (child), as you can see below. One of my doubts is how to represent the integration between parent/child objects in the ...
user avatar
-1 votes
3 answers
132 views

How to draw/design a state machine with multiple threading

I'm developing a module, which is very complicated. I'm trying to draw a state machine but I don't know if a state machine can present multiple threading cases. Basically, the module processes the ...
user avatar
  • 211
1 vote
1 answer
409 views

Managing multiple state machines interacting with each others in ES5 Javascript

I have multiple state machines (7) managed by a "main" function. Because of system constraint this will be run on an old qtweb browser with ES5/IE11-like behaviour. So no promises etc. I'm ...
user avatar
0 votes
1 answer
93 views

Confusion in UML 2 state chart design for a CAN bus data logging sensor

I have the following requirement to design behavior of a software component for logging sensor, which writes data to SD card a: Datalogging sensor can write data to a FAT16-formatted SD card that is ...
user avatar
1 vote
1 answer
100 views

State machine - how to handle outside environment values?

I've got a state machine implementation in Unity that I'm working on (C#), the plan being that it will be mostly used for AI related things. I'm not sure how I should deal with various "inputs&...
user avatar
  • 121
0 votes
0 answers
55 views

Converting monolithic application to microservice architecture with sagas

I'm looking for architectural guidance. I've got this monolithic application. It has a payment platform functionality, where payments are made, scheduled or on demand, via some banking API. Payments ...
user avatar
  • 109
3 votes
2 answers
383 views

Is rebooting a server idempotent or not?

In his article RESTful Casuistry, Tim Bray claims that rebooting a server is not idempotent: But I don’t buy it, and here’s why. If I want to update some fields in an existing resource, I’m inclined ...
user avatar
  • 570
-2 votes
1 answer
72 views

Is there a name for this kind of state machine?

I'm thinking of a GUI architecture that works like a finite-state machine where there is a set of possible states and a set of possible inputs--or events. The thing is, some states transition to the ...
user avatar
  • 162
-2 votes
1 answer
111 views

Scaffold design pattern [duplicate]

I'm looking for something that might be described as a "Scaffold design pattern". I'm in the process of resurrecting an old piece of working but very buggy code that implements a Finite ...
user avatar
1 vote
1 answer
153 views

How to avoid repeating same states in a finite state machine implementation?

I have been implementing a finite state machine which basically ensures configuration of the external chip which communicates with my MCU via I2C. The skeleton of the configuration state machine looks ...
user avatar
1 vote
2 answers
147 views

Identifying states when using state machine to validate a form field

Scenario is simple, a password field with few validation rules. The states I came up with are default ( when the form loads or reset button is pressed) filled ( should this even be a state ?) valid ( ...
user avatar
  • 21
-1 votes
1 answer
100 views

oval of FSM diagram represent what?

I am reading a document of Varnish and I get the important VCL state image shown below. We know we often use UML as a standard to draw a state machine. but this image is not, is it follow another ...
user avatar
  • 117
-4 votes
1 answer
157 views

What's the best way to design a state machine with different object inheritance

I have a class A and class B, both derive from the same parent class. Each object has a state machine inside it that defines it's behaviour. The behaviour is different though depending on if the ...
user avatar
  • 1
0 votes
2 answers
133 views

FSM diagrams - Modern device with battery / charger

I'm studying state machines diagrams and was asked to come up with a diagram for a device that turns on and off when a button is pressed... but as with other modern devices nowadays, it can operate ...
user avatar
  • 121
1 vote
4 answers
189 views

Documentation of Finite State Machine / Workflow

In my database, I store task data (id, timestamp, input data), and information about the state of the multi-step processing (e.g. prepare, execute, summarize). The program moves from one state to ...
user avatar
2 votes
1 answer
82 views

State Pattern: duplication in State and Context

Wikipedia gave an example of State Pattern: Define LowerCaseState and MultipleUpperCaseState, both inherite from State. interface State { void writeName(StateContext context, String name); } ...
user avatar
  • 121
4 votes
1 answer
284 views

Repeating a state in a state machine

I have a state machine in which I might have to restart something when needed (Say restart a hardware). But after restarting, I need to run some tests on the thing. If the tests fail, I need to stop ...
user avatar
2 votes
1 answer
221 views

State Machine: what object is responsible for state transfer?

I would like to create a state machine. Each State would have its run method, and, according to some logic would then set a next state. Option 1: If each state is responsible for determining a next ...
user avatar
  • 857
0 votes
1 answer
197 views

Edit and extract the response of a system from its State machine diagram

Consider the following state machine diagram: If we have the following event sequence : Close door --> Start --> Open door --> Reset and we need to know the corresponding response ...
user avatar
4 votes
2 answers
240 views

In an UML 2.5 State Machine, how can I model sending a Signal as an effect on a transition in a convenient way?

In an UML 2.5 State Machine, how can I model sending a Signal as an effect on a transition in a convenient way? In one of the older UML versions you simply prefixed the name of the signal with a send ...
user avatar
  • 149
1 vote
0 answers
60 views

Tiered/grouped/layered FSM for deisning software?

Well in the past during education about integrated systems we've been thought a lot about FSM and how to design those. It was a good tool to "talk" about complicated systems and create a common ...
user avatar
  • 1,021
1 vote
1 answer
567 views

How to plot a state machine diagram of multiple related objects in one diagram?

In an order management system for example, what's the best way to plot the states of different objects that overlap and interconnect at different states? Example: Order object will have states like ...
user avatar
  • 121
0 votes
2 answers
266 views

Using UML State Machine for blockchain smart contract implementation

This is a conceptual question about applying UML State Machine model for smart contracts in blockchain. I want to develop a smart contract framework in a bitcoin-like blockchain which is based on the ...
user avatar
  • 3
9 votes
1 answer
334 views

How to design a good generic tiled image downloader?

Tiled images Tiled images are large images that have been split in smaller square tiles. There are several tiled image formats, with different ways of organizing the tile files. A tiled image on ...
user avatar
  • 199
3 votes
2 answers
219 views

Designing a builder as a compile-time state machine

I'm working on a text GUI library which comes with builders for UI components (Buttons, Panels, etc). I have a base class for these builders which I'd like to redesign so that meaningless component ...
user avatar
  • 1,180
2 votes
1 answer
220 views

What is a good technique to process an event stream to ensure sequential or transactional consistency

I am trying to improve an event-driven processing system, which is having a few problems because the events are not guaranteed to arrive in the correct chronological sequence. This is due to batching ...
user avatar
  • 131
2 votes
2 answers
314 views

Hierarchical State Machine (HSM) superstate and substate sharing event

I am learning HSMs and I can see a problem that I don’t know how to address. The problem is shown in the image bellow. Inside S1, substates S11 and S12 are continuously changing in reaction to ...
user avatar
  • 21
0 votes
0 answers
292 views

Linear "steps" of operations considered a state machine?

I have a set of tasks I perform to complete some larger operation. These tasks must be executed in linear order, and you cannot proceed onto the next task until the previous completes. For the most ...
user avatar
  • 4,757
1 vote
1 answer
492 views

Problem in creating a correct finite-state-machine for a given short text

I like to create a finite-state machine for the given text below. While solving this, I came accross with several problems I listed at the bottom. (This example is in terms of testing (where you later ...
user avatar
  • 113
1 vote
0 answers
50 views

Byzantine Failures - Client Voter and Replica on Same Processor

I need help understanding the following text from section 4.2 on this paper: Implementing Fault-Tolerant Services Using the State Machine Approach: A Tutorial Dependent-Failures Output ...
user avatar
  • 117
0 votes
1 answer
205 views

Will FSM be a good solution?

At work, we are creating an android app. We have a business logic module for talking to an API for CRUD operations. The app I'm working on, the UI module, speaks to the business logic module to create,...
user avatar
3 votes
2 answers
2k views

Can a state machine transition depend on the previous state?

I was wondering what the state machine for a video player would be like. I can think of two states : playing and paused. When the video is playing and the user clicks on a point in the progress ...
user avatar
2 votes
1 answer
3k views

What is the relationship between event driven design and state machines/charts?

I'm trying to understand event driven design better and have not picked up a book on it yet. But just from others explaining it to me it seems to be really similar to state machines/charts. What are ...
user avatar
  • 131
0 votes
2 answers
174 views

How to handle state of an object? And how to enrich the state transition logic?

I am designing a class that has a state. I wonder if I should expose that state in the interface in view of allowing a decorator to enrich the state transition logic. Shall my design expose access to ...
user avatar
  • 119
0 votes
2 answers
656 views

If a business's workflow steps can reside solely in a database, is there a reason to use a workflow engine to accomplish those steps?

I found various libraries in C#, PHP, Python, etc. for workflows. By workflow I mean something like an employee wants personal time and that request starts with the employee and finishes in some ...
user avatar
  • 3,629
4 votes
2 answers
364 views

Why do I need a game loop with states, instead of init the next state in current state directly?

For example, it is common to see games with game loop and states: stateChanged(){ switch(state){ STATE.PLAYER_SELECT_CHARACTER: this.currentController=new PlayerSelectCharacterController()...
user avatar
  • 5,572
0 votes
0 answers
315 views

Hierarchical state machine. Is there a term for the deepest nested state in a state configuration?

A flat state machine has one active state. In a hierarchical state machine (HSM), if the HSM is in a child state, it's also in it's parent state. So, an active state configuration of an HSM consists ...
user avatar
  • 2,414
-1 votes
2 answers
201 views

Can my state machines use state that is derived from model data?

I'm putting together some ideas and personal conventions on how to configure state machines when using a language specific library. Because I'm adding state machines to existing model classes in my ...
user avatar
2 votes
1 answer
83 views

Using state machines when managing remote resources

So I’ve got a service I’m trying to clean up. It responds to requests by starting a stopped server on Amazon EC2, waiting for it to come online, then configures a 3rd party piece of software on the ...
user avatar
-2 votes
1 answer
392 views

Finite State Machine odd number of bc at the end

I had this question in a school test: Design a non-deterministic FSM that receives all words over {a,b,c} that: Start with cc. Contain at least 1 ab or aca. Ends with an odd number of (bc). The FSM ...
user avatar
  • 103