Refactoring task output: full redesign of DB models

* Created a Execution hierarcy mapped on a single table:
  - ActionExecution
  - WorkflowExecution
  - TaskExecution
* Created necessary associations within Execution hierarchy
* Created necessary methods for Execution objects on DB API
* Created Definition hierarchy mapped on separate tables:
  - Workbook
  - WorkflowDefinition
  - ActionDefinition
* Renamed attributes
  - 'wf_name' -> 'workflow_name'
  - 'wf_spec' -> 'spec'
* Fixed all unit tests

TODO:
* Complete renaming throughout the code
* Further refactoring of workflow engine

Change-Id: I0032bea573d9200025f9f7dd951e93cb6f1661bb
This commit is contained in:
Renat Akhmerov
2015-02-25 18:36:30 +06:00
parent 7707bd5b27
commit bdefdc6a6f
58 changed files with 1463 additions and 1157 deletions

View File

@@ -45,7 +45,7 @@ class WorkflowHandler(object):
:param exec_db: Execution.
"""
self.exec_db = exec_db
self.wf_spec = spec_parser.get_workflow_spec(exec_db.wf_spec)
self.wf_spec = spec_parser.get_workflow_spec(exec_db.spec)
@abc.abstractmethod
def start_workflow(self, **params):
@@ -286,7 +286,7 @@ class WorkflowHandler(object):
"""
self._set_execution_state(states.RUNNING)
tasks = self.exec_db.tasks
tasks = self.exec_db.task_executions
if not all([t.state == states.RUNNING for t in tasks]):
return self._find_commands_to_resume(tasks)
@@ -309,7 +309,7 @@ class WorkflowHandler(object):
wf_trace.info(
self.exec_db,
"Execution of workflow '%s' [%s -> %s]"
% (self.exec_db.wf_name, cur_state, state)
% (self.exec_db.workflow_name, cur_state, state)
)
self.exec_db.state = state
self.exec_db.state_info = state_info