State machine that allows dynamic transitions for business workflows