Add statemachine for Documents
Merge branch 'feature/statemachine' into develop