# Workflow Engine
## introduction
This module is used to implement workflows.
Every workflow executes a list of tasks.
## Installation
```bash
python -m pip install workflow_engine
```
## Implementation
### Processor
A Workflow processor is the main instance which will handle a list of entities
and passes them to the assigned tasks. The handled entities should inherit
from the workflow model type.
Since the workflow processor is an abstract class, the following methods have
to be implemented in the inherited class:
- **get_default_entries** returns a list of unparsed entries
- **get_entry** parses the raw entries retrieved by the previous method to an
object which inherits from the `WorkflowModel`
- **filter** define some preconditions
- **get_tasks** returns a list of instances which inherit from the workflow
task
- **write_entry** handle a processed (successfully or unsuccessfully) entry.
Write it to the cache or to the disk
- **close** handle the finale state of the workflow
### Model
Basic implementation of an entity. Delivers field and methods to check, wether
the task has already been executed, if there is a related error or if the
entry should be executed again.
### Task
Basic implementation of a task which should be executed for a workflow
## Status
The following use cases can be handled:
flow type | **Exception** | **StatusException** | **OnSuccess**
---------------|---------------|---------------------|--------------------
**skip** | - | - | x
**interrupt** | x | x | -
**repeat** | (-) | x | x
- **Exception** in case of an Exception which is not an instance of
`StatusException` the workflow will be interrupted. An operator has the
possibility to set the repeat property
- **StatusException** will interrupt the workflow and set the `Status` object
which can contain any repeat property
- **OnSuccess** can return a `Status` can contain any repeat property. To
*skip* the task it is not necessary to implement a dedicated status. Just
return a `Status` to exit the task
### Exception Handling
In case of unexpected Exceptions the workflow for the handled entry will be
cancelled. The stacktrace will be logged. An unique id is assigned to each
exception. The error id will be persisted into your status file and into the
logs.
Raw data
{
"_id": null,
"home_page": "",
"name": "workflow-engine",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "python,workflow,engine",
"author": "Deutsche Telekom IT GmbH",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/d5/01/7f1dd479dc790e7a7f0bc115a747ab397c89e87d248fa4678f5aaea2eaf8/workflow_engine-0.1.0.tar.gz",
"platform": null,
"description": "# Workflow Engine\n\n## introduction\n\nThis module is used to implement workflows.\nEvery workflow executes a list of tasks.\n\n## Installation\n\n```bash\npython -m pip install workflow_engine\n```\n\n## Implementation \n\n### Processor\nA Workflow processor is the main instance which will handle a list of entities \nand passes them to the assigned tasks. The handled entities should inherit \nfrom the workflow model type.\n\nSince the workflow processor is an abstract class, the following methods have \nto be implemented in the inherited class:\n\n- **get_default_entries** returns a list of unparsed entries\n- **get_entry** parses the raw entries retrieved by the previous method to an \nobject which inherits from the `WorkflowModel`\n- **filter** define some preconditions\n- **get_tasks** returns a list of instances which inherit from the workflow \ntask\n- **write_entry** handle a processed (successfully or unsuccessfully) entry. \nWrite it to the cache or to the disk\n- **close** handle the finale state of the workflow\n\n### Model\nBasic implementation of an entity. Delivers field and methods to check, wether \nthe task has already been executed, if there is a related error or if the \nentry should be executed again.\n\n### Task\nBasic implementation of a task which should be executed for a workflow\n\n## Status\n\nThe following use cases can be handled:\n\n flow type | **Exception** | **StatusException** | **OnSuccess** \n---------------|---------------|---------------------|--------------------\n **skip** | - | - | x \n **interrupt** | x | x | - \n **repeat** | (-) | x | x \n\n- **Exception** in case of an Exception which is not an instance of \n`StatusException` the workflow will be interrupted. An operator has the \npossibility to set the repeat property\n- **StatusException** will interrupt the workflow and set the `Status` object \nwhich can contain any repeat property\n- **OnSuccess** can return a `Status` can contain any repeat property. To \n*skip* the task it is not necessary to implement a dedicated status. Just \nreturn a `Status` to exit the task\n\n### Exception Handling\nIn case of unexpected Exceptions the workflow for the handled entry will be \ncancelled. The stacktrace will be logged. An unique id is assigned to each \nexception. The error id will be persisted into your status file and into the \nlogs.\n\n",
"bugtrack_url": null,
"license": "Apache Software License (Apache 2.0)",
"summary": "a engine to process workflows and tasks",
"version": "0.1.0",
"project_urls": null,
"split_keywords": [
"python",
"workflow",
"engine"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9c7b85b148bc73489f4e8fa446069145506f199b96eda0fa8a62dbc4d63d0d9b",
"md5": "55e5a661c892cbade7806f48fada50a3",
"sha256": "2c78fbc2c355cdb818d6b7dc42205c5e08c62b29b6dc1d3c419353d32a578af5"
},
"downloads": -1,
"filename": "workflow_engine-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "55e5a661c892cbade7806f48fada50a3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 13002,
"upload_time": "2023-11-17T13:23:24",
"upload_time_iso_8601": "2023-11-17T13:23:24.978609Z",
"url": "https://files.pythonhosted.org/packages/9c/7b/85b148bc73489f4e8fa446069145506f199b96eda0fa8a62dbc4d63d0d9b/workflow_engine-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d5017f1dd479dc790e7a7f0bc115a747ab397c89e87d248fa4678f5aaea2eaf8",
"md5": "4e169e7bef2e61fe7e74f3bc1fd8f0f1",
"sha256": "77a7917ba6dc4d181572620e3789b568129ae20d9168b0ac956731e7d5cba036"
},
"downloads": -1,
"filename": "workflow_engine-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "4e169e7bef2e61fe7e74f3bc1fd8f0f1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12255,
"upload_time": "2023-11-17T13:23:26",
"upload_time_iso_8601": "2023-11-17T13:23:26.646955Z",
"url": "https://files.pythonhosted.org/packages/d5/01/7f1dd479dc790e7a7f0bc115a747ab397c89e87d248fa4678f5aaea2eaf8/workflow_engine-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-17 13:23:26",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "workflow-engine"
}