You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
AnExternal 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 anexternal 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 Java 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.
Spring Boot Sample
The following dependency needs to be added to start using Flowable workers.
There are two ways that the application can be authenticated with a Flowable installation:
Using HTTP Basic authentication with a provided username and password, as shown in the example above.
Using HTTP Bearer authentication with a provided access token. In that case the.basic properties are replaced by theflowable.external.worker.rest.authentication.bearer.token=myTokenValue property.
Flowable Trial
Connecting an external worker to the Flowable Trial is simpler, since everything is pre-configured.It's required to either use the user credentials or to pre-configure a personal access token, for example:
The following properties are for advanced usage. Only change these if you understand the consequences and the concept of the external worker properly.
flowable.external.worker.workerId : gives the external worker a custom identifier, which is used to identify which external worker has locked an external worker job.
flowable.external.worker.concurrency : The amount of threads available to poll and execute external worker jobs. By default1.
flowable.external.worker.lock-duration : The amount of time an external job will be locked when acquired. If this time limit is reached, other external workers will be able to acquire the same job. By default 5 minutes.
flowable.external.worker.number-of-retries : The number of times to retry acquiring new jobs on the Flowable server-side before giving up. By default, 5.
flowable.external.worker.number-of-tasks : The amount of external worker tasks to acquire and lock in one go. The default is1.
flowable.external.worker.polling-interval : The amount of time between polling for new external worker jobs. By default, 30 seconds.
Plain Java
The following dependency needs to be added to start in a plain Java project without Spring Boot:
There are two ways that the application can be authenticated with a Flowable installation:
Using HTTP Basic authentication with a provided username and password, as shown in the example above.
Using HTTP Bearer authentication with a provided access token. In this case theRestInvoker can be created like this:JavaHttpClientRestInvoker.withAccessToken("http://localhost:8090/external-job-api", "<your-access-token>")