Activiti Cloud Example
This example shows how to start the Activiti Cloud Infrastructure and how you can provide your Domain Specific Runtime Bundles. These Runtime Bundles provides us with a way to isolate Process Runtimes. Each Runtime Bundle will be in charge of executing a certain sets of Process Definitions.
This example shows how to start the infrastructure services using Docker Compose and how to create and run your own runtime bundles (as many as you want).
The services started by docker compose are: rabbit-mq
, activiti-cloud-query
, activiti-cloud-audit
, activiti-cloud-sso-idm
, activiti-cloud-registry
, activiti-cloud-gateway
, postgresql
.
Now when you want to create your own Runtime Bundles you will want to build and run your own docker images. Inside the
docker-runtime-bundle a
Dockerfile is provided which extends our base Runtime Bundle Docker Image and it defines which process definitions will
be included. You can also modify the containers by setting any of the variables defined using ${}
in the activiti-cloud projects.
Quickstart
Ensure you have docker installed and increase the memory allocation to at least 3GB.
-
Add this entry to your hosts (
/etc/hosts
) file:127.0.0.1 activiti-cloud-sso-idm
-
cd docker/
- Run >
docker-compose -f infrastructure-docker.yml up -d
(to start all the infrastructure services)
- Run >
-
Load the json Postman collection located in the root directory into Postman (e.g. chrome plugin)
-
Go to the
keycloak
folder and send thegetKeycloakToken
request -
You can find all the routes registered in the system (e.g. the infrastructure query and audit services) by executing the request inside the
gateway
folder calledroutes
-
In order to create and start a new Runtime Bundle (by default there is no Runtime Bundle started) you have two options:
- Docker Option (No Java, No Maven Needed, this is the quickest path)
cd docker-runtime-bundle/
docker build -t "rb-my-app" .
(to build a new docker image calledrb-my-app
using the Dockerfile located in current directory, denoted by'.'
)cd ..
- Maven Option
cd maven-runtime-bundle/
mvn clean install docker:build
(this will compile the java project with maven and generate a docker image calledrb-my-app
- Docker Option (No Java, No Maven Needed, this is the quickest path)
-
With the infrastructure up and running you can start your Runtime Bundle by:
docker-compose -f application-docker-compose.yml up -d
(to start a new runtime bundle using the previously generated image - note if you chose maven above then you need to modify the image name inrb-docker-compose.yml
as per comments in that file)- inside the
application-docker-compose.yml
you will find that you can choose between the image generated by using the Dockerfile or the Maven project. *) look into theapplication-docker-compose.yml
file if you want to start a different runtime bundle. This docker compose is starting postgresql as the data store for the process engine, you can obviously change all these configurations and also choose to share the same database instance for all your runtime bundles.
-
When the runtime-bundle is started, it will be registered with the gateway through
eureka
. Wait for its registration and then you can start instances of its process definitions using postman - best to start by listing gateway routes and then runtime bundle process definitions to see what's available.
To customise runtime-bundles to use different processes, modify the image name (defaulted to rb-my-app
) before building it in step 6. You can start multiple instances of the same runtime bundle by adding them into the compose in step 6 using different host and container name and the same ACT_RB_APP_NAME
.
Question / Issues / Comments
Please feel free to open an issue or get in touch with us if you have problems running these examples. You can join us in Gitter if you want assistance or have questions. We welcome contributions.