Raising exception if there aren't start tasks in direct workflow

* Now if direct workflow graph doesn't have start tasks (ones with no
  inbound transitions) then an exception gets raised.
* Refactoring workflow specifications: moving specification related method
  from direct workflow controller into workflow specification.
* Implemented the mechanism of polymorphic DSL entities. At this point
  there's a hierarchy of specification classes to represent different types
  of workflow.
* Specification validation logic is now explicitly split into two methods:
  validate_schema() and validate_semantics() where the second one is supposed
  to implement integrity checks and other more high-level rules that are
  impossible to define in JSON schema.
* Other minor refactoring and style changes.

Change-Id: I60937b77e39133e3b254fed574e6aec6aa402eb0
This commit is contained in:
Renat Akhmerov
2015-09-04 15:41:29 +06:00
parent 371ba27dcd
commit 49baf0311e
14 changed files with 406 additions and 208 deletions

View File

@@ -154,14 +154,13 @@ class WorkflowController(object):
if wf_type == wf_ctrl_cls.__workflow_type__:
return wf_ctrl_cls
msg = 'Failed to find a workflow controller [type=%s]' % wf_type
raise exc.NotFoundException(msg)
raise exc.NotFoundException(
'Failed to find a workflow controller [type=%s]' % wf_type
)
@staticmethod
def get_controller(wf_ex, wf_spec=None):
if not wf_spec:
wf_spec = spec_parser.get_workflow_spec(wf_ex['spec'])
ctrl_cls = WorkflowController._get_class(wf_spec.get_type())
return ctrl_cls(wf_ex)
return WorkflowController._get_class(wf_spec.get_type())(wf_ex)