Xtext 2.7
Pulled out common logic into statemachine API