An abstract _WorkflowEntity class to serve as the base type for these and other structures that will be exposed to users to allow them to define a workflow which features:
An optional on_error parameter which allows one to specify a _WorkflowEntity to transition to if an error occurs
An optional name to help document identifiers in the XML (otherwise a uid is used)
A Kill_WorkflowEntity which if transitioned to kills a workflow and emits a message
An Action_WorkflowEntity which wraps a ConcreteAction (e.g. execute a shell command, subworkflow, or email) which
Can specify credentials that are to be used by a concrete action
Can specify action retry semantics
This PR also adjusts WorkflowApp to validate that:
All credentials referred to by actions are supplied in the constructor
No duplicate identifiers are present in the actions provided (an Oozie logic error)
🎩 'd by starting a local Oozie 4.1.0 instance using docker-compose up -d and manipulating tests/pyoozie/test_interactive.py to specify different values.
Notes
This PR is one of several that are intended to add an API to define forking/joining workflows with error-handling prototyped in https://github.com/Shopify/pyoozie/pull/26.
This PR adds to the
WorkflowApp
class the ability to serialize to XML action and kill nodes using theoozie-workflow-0.5.xsd
schema.Implementation
This PR implements:
_WorkflowEntity
class to serve as the base type for these and other structures that will be exposed to users to allow them to define a workflow which features:on_error
parameter which allows one to specify a_WorkflowEntity
to transition to if an error occursname
to help document identifiers in the XML (otherwise a uid is used)Kill
_WorkflowEntity
which if transitioned to kills a workflow and emits a messageAction
_WorkflowEntity
which wraps aConcreteAction
(e.g. execute a shell command, subworkflow, or email) whichThis PR also adjusts
WorkflowApp
to validate that:This PR enables the ability to define collections of actions that can be executed serially/in parallel (https://github.com/Shopify/pyoozie/pull/50).
🎩 'd by starting a local Oozie 4.1.0 instance using
docker-compose up -d
and manipulatingtests/pyoozie/test_interactive.py
to specify different values.Notes
This PR is one of several that are intended to add an API to define forking/joining workflows with error-handling prototyped in https://github.com/Shopify/pyoozie/pull/26.