Skip to main content

Flowable External Worker Library to connect Python code to Flowable using an external worker.

Project description

Flowable External Worker Library for Python

License: license

Flowable Actions CI

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


Download files

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

Source Distribution

flowable_external_worker_client-1.0.1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

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

flowable.external_worker_client-1.0.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file flowable_external_worker_client-1.0.1.tar.gz.

File metadata

File hashes

Hashes for flowable_external_worker_client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 aa3049f68fdffc297b93ee52f88dd033fc538c6aaaca23d294ecaca96f5b93b7
MD5 15510717924cf5f5523aa3c298cebc4e
BLAKE2b-256 756a783978d4ef95e2872e4e047334f87600b70ab749a11d7583f04899c0ad1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for flowable_external_worker_client-1.0.1.tar.gz:

Publisher: release.yml on flowable/flowable-external-client-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flowable.external_worker_client-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for flowable.external_worker_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f97a2d1b8504edc2f4fc1e235a699ff9c578fd98fb5e0b82c2309bfdd986a33
MD5 4843d53b6d82e2f7c9e25cbffc134906
BLAKE2b-256 b8b0bb349ebb069aaf39491de014a007f2792aa2996da8c857f92756cffc720f

See more details on using hashes here.

Provenance

The following attestation bundles were made for flowable.external_worker_client-1.0.1-py3-none-any.whl:

Publisher: release.yml on flowable/flowable-external-client-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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