1. Concepts
  2. States and Actions

Concepts

States and Actions

How things link together in Stubber

Inside the template we have contexts which in turn have a flow. The flow is made up of states and actions.

States

States are periods of time in the stub. They denote when the stub is waiting for something to happen.

Actions

Actions are options available to the user in each state.

Introduction

We know that stubs follow a specific template and context. The stub contains specific information about the specific context and template that it is based on.

stubs contain execution information

The stub keeps track on a high level of where it is in the process. This is done by keeping track of the current state that it is in.

stubs keep track of the current state

Many different stubs all based on the same template can be in different states at the same time.

stubs each have unique states

In order to understand how states and actions work together, it is helpful to think of them in a few different ways.

FSM

One way to think of states and actions is as a finite state machine.
A FSM can have only 1 state at a time, similarly a stub can only be in 1 state at a time.

States

We could visualize states all linking together like this.

states link together

Stubs follow the links between states and transition between them.

stubs follow links between states

If we take this further and name the actions that are taken to move between states then the diagram might look something like this. name the links between states

Actions

This leads us further into our understanding of the actions that are taken to move between states. Actions are the options that are available to the user in each state.

Transitioning actions

Actions are taken to transition between states.
This is how stubs move between states.

actions are how links work

Non transitioning actions

Actions can also be used for anything else that needs to be done on a stub depending on the state it is in.
For example in the diagram below we have a "send quote" action that does not trigger a transition of states.

actions dont always have to link

Shared actions

Some actions can be taken in multiple states.
For example in the diagram below we have a "flag enquiry" action that can be taken in multiple states.
This action is "available" in multiple states.

actions can be shared

Summary

When we put all of this together we can see how states and actions work together.
We can chain these 2 concepts together to create any process ( template) that we want.
This is done on the Stubber Platform using the Editor.

putting it together

Defining States and Actions

States and Actions are defined within the flow of the context. The flow is made up of states and actions. states defined inside a flow

The states define the periods of time in the stub. The actions define options that are available in each state.

Linking States and Actions

There are 2 ways that states and actions can be linked together.

If we link an action onto a state then the action is available in that state.
These links are dotted lines in the Stubber Editor.

If we link an action to a state that indicates that the action will transition the stub to that state.
These links are solid lines in the Stubber Editor.