How to use rest api in docker


#1

I tried flowable using the all-in-one docker image, it works well ,now I want to setup rest api to see how I can interact with flowable engine, but I found the rest module is not included in all-in-one image.

My setup is as below:

  1. docker run --rm -p 8080:8080 flowable/all-in-one
  2. docker run -p 8080:8080 flowable/flowable-rest

But 8080 is already in use, how can I integrate rest api with the flowable UI, Thanks!


#2

The flowable-task application has the REST API exposed in the same way as the flowable-rest. Which means that you can invoke the REST API via the flowable-task.

In case you want to run flowable-task and flowable-rest then you would need to run the flowable-rest on another port. For example with docker run -p 8081:8080 flowable/flowable-rest the flowable-rest application will run on port 8081


#3

Thanks, but docker run -p 8081:8080 flowable/flowable-rest cannot connect to existing all-in-one docker container. I run curl 'http://rest-admin:test@localhost:8081/flowable-rest/service/repository/deployments' only returned the default demo app.

Are there any better ways to combine the all-in-one docker image with flowable-rest image? I’ll try flowable-task rest api to see if it works.


#4

I tried flowable-task rest api, but it doesn’t support http basic authenticate, so the problems I’m facing are:

  1. flowable-rest docker cannot directly connect to flowable-task
  2. flowable-task api doesn’t support http basic authenticate so cannot integrate into my app

I think the possible solutions are:

  1. manually write docker file to combine the 2 images.
  2. manually deploy these services to tomcat

But these 2 solutions are too tedious, hope to see a simpler way.


#5

Yes you need to configure the database properties for it to access the same database as the all-in-one docker.

It does support basic authentication. Have a look at the ApiWebSecurityConfigurationAdapter for the task app. You can access the process api under /flowable-task/process-api. Why do you have the impression that it doesn’t work?

The flowable-admin application actually uses the REST API to display its data.

Cheers,
Filip


#6

Thanks for the explainations, I don’t write java so I didn’t read the source code carefully. I don’t want to use flowable-task api, I’m working on my own docker compose file to combine all-in-one and flowable-rest


#7

The public REST API in flowable-task and flowable-rest is identical. Why don’t you want to use that one?


#8

I don’t know how to do http authentication in flowable-task and its usage is not listed in the doc


#9

I got a 302 redirect when using flowable-task


Deploying an app using the rest interface
Flowable docker in production
#10

Instead of doing flowable-task/service do flowable-task/process-api. And you should not be accessing the API that is under flowable-task/app. That API is for the UI app.

The things which are explained in the documentation are valid for the flowable-task as well. With the following differences:

  • The installation is different (already part of the flowable-task UI application
  • Replace all flowable-rest/service with flowable-task/process-api

Cheers,
Filip


#11

Thanks, you are awesome, you saved me a lot of time, now I can interact with flowable-task rest api

curl -i 'http://admin:test@localhost:8080/flowable-task/process-api/repository/deployments'