Convert states and transitions to globals.