workflows: revamp session handling
- Changes the way the db.session is called in BibWorkflowEngine and BibWorkflowObject models to use a session_manager decorator.
- Adds new classmethods to BibWorkflowObject to create objects and revisions.
- New BibWorkflowObject's are now by default initiated with version set to INITIAL (from RUNNING).
- RUNNING version is only set when a BibWorkflowObject is actually being executed in a BibWorkflowEngine.
- Removes the workflow status FINISHED, as it was too ambiguous compared to COMPLETED. If a workflow contains data objects that have not reached FINAL version, the workflow status is set to HALTED.
- Cleans some of the log messages in the engine.
- Reworks what happens when a workflow is asked to *fully* restart. It will take the INITIAL version of every associated object and run it through the workflow from the start.
Signed-off-by: Jan Aage Lavik <jan.age.lavik@cern.ch>