What are finite state machines?

A state machine can be used to describe the system in terms of a set of states that the system goes through. A state is a description of the status of a system that is waiting to execute a transition. A transition is a set of actions to be executed when a condition is fulfilled or when an event is received.

Can you model complex logic with finite state machines?

Finite state machines (FSM) can only model simple relations, aka transitions from one state to the other, and are mostly used to model business processes. Combining multiple non-binary outcomes and majority voting is not possible with FSM engines. Conditional executions is all they can do (conditions are defined for each transition).

Are finite state machines explainable?

The concept of FSM is easy to grasp by different types of users. The main selling argument of BREs (Business Rules Engines) is that BRE software allows non-programmers to implement business logic in a business process management (BPM) system.

One thing often overlooked with FSM is that states imply transitions, that is to say, the only purpose of having something modeled as a state is to navigate a particular decision flow.

A direct result of that is that FSM lacks readability as rules become more complex, or when a particular corner case needs to be modeled as a state. Since FSM is capable of executing only one transition at a time, when a user tries to introduce events that might happen under certain conditions, she needs to add a new state. When the number of states becomes too large, the readability of the state machine drops significantly.

Are finite state machines adaptable?

Adding third-party API services is quite easy as the API extension requires minimal abstractions (conditional outcomes on any given input that resolves in one of the available set of states). Flexibility is not a forte however, because it is very difficult to change rules once they are implemented.

How easy is it to operate finite state machines?

Applying the same rule across many devices is possible as long as thresholds and all other conditions do not change. Templating and search-ability is quite easy to achieve with such rules but versioning and performing bulk upgrades is harder, as conditions and thresholds are often global variables and hard to change per instance of the running rule.

Are finite state machines scalable?

Similar to flow processing engines, FSM engines can distribute functional computations (state executions). On the other hand, within one rule, all executions are sequential. FSM are not stateless, which means that the rules engine needs to keep track of the current rules executions and apply transitions after every function call to delegate to the next node.

This is an excerpt from our latest Benchmark Report on Rules Engines used in the IoT domain. You can have a look at a summary of the results or download the full report over here.