semvec/pypi-packages huggingface dataset:
flowable.rpaframework-client 1.0.2
Flowable client to be used with rpaframework. This client connects to a Flowable instance via external worker and executes rpaframework robots or robocorp tasks or actions.
License: Apache License, Version 2.0

# Flowable RPA Framework Client

[License:
![license](https://img.shields.io/hexpm/l/plug.svg)](https://github.com/flowable/flowable-external-client-python/blob/main/LICENSE)

![Flowable Actions CI](https://github.com/flowable/flowable-external-client-python/actions/workflows/main.yml/badge.svg?branch=main)

This is a python module to connect a Flowable installation through an external worker with a RPA framework task.
This allows to execute an RPA framework task from a business process with BPMN or a case diagram CMMN.
The application is started with a task definition from RPA framework and connects to an external worker topic.
When using the RPA framework task in Flowable, it is possible to specify a task name.
In the task, the specific task specified will be executed and the result will be sent back to the process.
It is required that the variables in the diagram match exactly the variables inside the RPA framework task.

## Installation

To install the Flowable RPA framework client, execute the following command:

```
pip install flowable.rpaframework-client
```

## Sample

The following [diagram BPMN](docs/rpaframeworkExample.bpmn) illustrates a basic usage of the RPA framework task:

![Simple BPMN diagram with a start event, a RPA Framework task and an end event](docs/rpaframeworkExample.png)

The following example `myTask.robot` can be used as an RPA framework task:
```
*** Settings ***
Library		flowable.rpaframework_client.API

*** Tasks ***
Get weather forecast
    ${city}=		flw input	city
    ${days}=		flw input	days
    ${length}=      Get Length  ${city}
    ${temperature}=     Evaluate    ${days} * ${length}
    flw output		temperature     ${temperature}
```

The RPA Framework worker can be started with the following command:
```sh
python -m flowable.rpaframework_client --flowable-token <your-token> myTopic myTask.robot
```

You can request `<your-token>` at the [Flowable Trial](https://trial.flowable.com/work/) by clicking at the bottom left on your user and go to Settings.
Once in the settings, choose "Access Token" and press the button "New token".
After providing name and the validity, the token is generated and can be set.

Once the module is started and a process instance is created, it will automatically execute the RPA framework action and returns the result to Flowable.
The Python module will keep running until stopped to process potential additional jobs.

## Authentication

Next to the cloud authentication, it's possible to authenticate against other hosts.
The hostname can be specified with `--flowable-host`.

For the authentication there are two possibilities:

1. Providing a bearer token with the `--flowable-token <token>` attribute.
2. Providing basic authentication with `--flowable-username <username>` and `--flowable-password <password>`
flowable.external-worker-client 1.0.2
Flowable External Worker Library to connect Python code to Flowable using an external worker.
License: Apache License, Version 2.0

# Flowable External Worker Library for Python


[License:
![license](https://img.shields.io/hexpm/l/plug.svg)](https://github.com/flowable/flowable-external-client-python/blob/main/LICENSE)

![Flowable Actions CI](https://github.com/flowable/flowable-external-client-python/actions/workflows/main.yml/badge.svg?branch=main)

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](https://requests.readthedocs.io/en/latest/user/authentication/).
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.

```python
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`:

```python
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)
```