Added state machine to work order with an audit trail (aka history).