Skip to main content

Jembe Workflow Management

Library with simple Workflow implementation for use in Flask with Sqlalchemy. JembeWF can be used without Jembe Framework it only depends on Flask and Flask-SqlAlchemy.

Workflow is defined in Python by extending and combining Flow, State and Transition classes. Workflow is executed by Process and Step SqlAlchemy persistet instaces that saves information of process instances (defined by Flow), Step instances (defined by State).

Project state

In development

Usage

    from flask_sqlalchemy import SQLAlchemy
    import flask
    import jembewf
    app = flask.Flask(__name__)
    app.config["SQLALCHEMY_DATABASE_URI"] = "postgresql+psycopg2://@/demo"
    db = SQLAlchemy(app=app)

    class Process(jembewf.ProcessMixin, db.Model):
        """Process"""

    class Step(jembewf.StepMixin, db.Model):
        """Step"""

    jwf = JembeWF()

    # Flow definition
    class StateCallback(jembewf.StateCallback):
        def callback(self):
            print(self.step)

    jwf.add(
        Flow("flow1")
        .add(
            State("state1", StateCallback).add(
                Transition("state2"),
            ),
            State("state2", StateCallback).add(
                Transition("state3"),
            ),
            State("state3", StateCallback),
        )
        .start_with("state1")
    )
    jwf.init_app(app, db, Process, Step)

    # starting process
    process = jwf.start("flow1")
    # steping thought process
    while process.is_running:
        process.proceed()

Output:

<Step #1: 'state1' from process #1: 'flow1'>
<Step #2: 'state2' from process #1: 'flow1'>
<Step #3: 'state3' from process #1: 'flow1'>

License

Jembe Workflow Management Copyright (C) 2021 BlokKod info@blokkod.me

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Release files for jembewf 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jembewf 0.0.3
File Size Uploaded
jembewf-0.0.3.tar.gz 23.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jembewf 0.0.3
File Interpreter ABI Platform
jembewf-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 48.7 kB

Release files / jembewf-0.0.3.tar.gz

Download URL jembewf-0.0.3.tar.gz
Size 23.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bf36a9dc0245ee85ad381d33e0f1ccb9a861131c7b7b14cdb0ebb0e3d153b637
BLAKE2b-256 checksum
How to use checksums
fa73bec5682707c584ee4ba026735cd8e94e2799ce2ebc7a231212617c957996
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / jembewf-0.0.3-py3-none-any.whl

Download URL jembewf-0.0.3-py3-none-any.whl
Size 25.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53ea85628467cc022aef4a82550a80d9380f2bf8e21a4db4f152d7ed2ea48501
BLAKE2b-256 checksum
How to use checksums
3c036df8c7439f897489cda2aae4883d343287784bc501381d997d5cd58b7169
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page