Skip to main content

a engine to process workflows and tasks

Project description

Workflow Engine

introduction

This module is used to implement workflows. Every workflow executes a list of tasks.

Installation

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

workflow_engine-0.1.0.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

workflow_engine-0.1.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file workflow_engine-0.1.0.tar.gz.

File metadata

  • Download URL: workflow_engine-0.1.0.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for workflow_engine-0.1.0.tar.gz
Algorithm Hash digest
SHA256 77a7917ba6dc4d181572620e3789b568129ae20d9168b0ac956731e7d5cba036
MD5 4e169e7bef2e61fe7e74f3bc1fd8f0f1
BLAKE2b-256 d5017f1dd479dc790e7a7f0bc115a747ab397c89e87d248fa4678f5aaea2eaf8

See more details on using hashes here.

File details

Details for the file workflow_engine-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for workflow_engine-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c78fbc2c355cdb818d6b7dc42205c5e08c62b29b6dc1d3c419353d32a578af5
MD5 55e5a661c892cbade7806f48fada50a3
BLAKE2b-256 9c7b85b148bc73489f4e8fa446069145506f199b96eda0fa8a62dbc4d63d0d9b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page