Flowable External Worker Library to connect Python code to Flowable using an external worker.
Project description
Flowable External Worker Library for Python
An External Worker Task in BPMN or CMMN is a task where the custom logic of that task is executed externally to Flowable, i.e. on another server. When the process or case engine arrives at such a task, it will create an external job, which is exposed over the REST API. Through this REST API, the job can be acquired and locked. Once locked, the custom logic is responsible for signalling over REST that the work is done and the process or case can continue.
This project makes implementing such custom logic in Python easy by not having the worry about the low-level details of the REST API and focus on the actual custom business logic. Integrations for other languages are available, too.
Authentication
The different ways to authenticate are explained in the documentation of the underlying requests HTTP library which is used to connect to Flowable.
The ExternalWorkerClient accepts as a parameter auth an implementation of requests.auth.AuthBase.
There are default implementations for example for basic authentication e.g. HTTPBasicAuth("admin", "test").
Flowable offers a bearer token implementation FlowableCloudToken which allows to specify an access token to the Flowable Cloud offering.
Installation
To install the external worker library, execute the following command:
pip install flowable.external-worker-client
Sample
Cloud
The usage with Flowable Cloud is simpler, since everything is pre-configured. However, it's required to either use the user credentials or to pre-configure a personal access token.
from flowable.external_worker_client import ExternalWorkerClient
from flowable.external_worker_client.cloud_token import FlowableCloudToken
client = ExternalWorkerClient(auth=FlowableCloudToken("<personal-access-token>"))
def my_callback(job, worker_result_builder):
print('Executed job: ' + job.id)
return worker_result_builder.success()
subscription = client.subscribe('myTopic', my_callback)
Local
The following is an example how you can connect to a Flowable instance running at http://localhost:8090 and process all messages retrieved on the topic myTopic:
from flowable.external_worker_client import ExternalWorkerClient
from requests.auth import HTTPBasicAuth
client = ExternalWorkerClient('http://localhost:8090/flowable-work', auth=HTTPBasicAuth("admin", "test"))
def my_callback(job, worker_result_builder):
print('Executed job: ' + job.id)
return worker_result_builder.success()
subscription = client.subscribe('myTopic', my_callback)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flowable_external_worker_client-1.0.2.tar.gz.
File metadata
- Download URL: flowable_external_worker_client-1.0.2.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9a18ec99c5e6360f29fcef98c62e46a8011180d328044224e6f53ec4b4e01c5
|
|
| MD5 |
56a6ae13a027b44d6217cfadc8840f43
|
|
| BLAKE2b-256 |
2b14f6624a8d53e79983273a190dadf5afb9fe5542564262f78a552d1c05fc54
|
Provenance
The following attestation bundles were made for flowable_external_worker_client-1.0.2.tar.gz:
Publisher:
release.yml on flowable/flowable-external-client-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flowable_external_worker_client-1.0.2.tar.gz -
Subject digest:
c9a18ec99c5e6360f29fcef98c62e46a8011180d328044224e6f53ec4b4e01c5 - Sigstore transparency entry: 152832955
- Sigstore integration time:
-
Permalink:
flowable/flowable-external-client-python@9adafe36f3c2d237ddc41000d46d1a4adf7eb1ca -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/flowable
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9adafe36f3c2d237ddc41000d46d1a4adf7eb1ca -
Trigger Event:
release
-
Statement type:
File details
Details for the file flowable.external_worker_client-1.0.2-py3-none-any.whl.
File metadata
- Download URL: flowable.external_worker_client-1.0.2-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4c58c5aabdd1f64e179d677ed2acf28ef0a6556ef90ab1d1e2afb043764bd9aa
|
|
| MD5 |
f227f3fd06b570d761c6d384c30693c2
|
|
| BLAKE2b-256 |
dda8518e3412121470bc377de65adf7325597ba94d614a008b58492b592aab24
|
Provenance
The following attestation bundles were made for flowable.external_worker_client-1.0.2-py3-none-any.whl:
Publisher:
release.yml on flowable/flowable-external-client-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
flowable_external_worker_client-1.0.2-py3-none-any.whl -
Subject digest:
4c58c5aabdd1f64e179d677ed2acf28ef0a6556ef90ab1d1e2afb043764bd9aa - Sigstore transparency entry: 152832956
- Sigstore integration time:
-
Permalink:
flowable/flowable-external-client-python@9adafe36f3c2d237ddc41000d46d1a4adf7eb1ca -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/flowable
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9adafe36f3c2d237ddc41000d46d1a4adf7eb1ca -
Trigger Event:
release
-
Statement type: