State machines
A state machine is a collection of a number of states, where each state refers to a process that is happening and follows a cycle by transitioning from one state to another. Successful completion of the previous state is necessary for the next state to begin.
CloudForms includes some default state machines in the ManageIQ or CloudForms domain, which cannot be changed. ProvisionRequestApproval is one such state machine that we will work with in this chapter and it is relevant for the request approval process.
State machine components
There are six state machine components that you can work with and set values for:
On_Entry
: This component will run a desired method upon entering the stateOn_Exit
: This component lets you run a method when exiting the stateOn_Error
: This can run a method if there is an error during the running stateDefault value
: This runs the desired method after theOn_Entry
methodMax retries
: This will retry the state a certain number of times before exiting...