/activiti-cloud-examples

Activiti Cloud Examples using Docker Images from: https://hub.docker.com/u/activiti/dashboard/

Primary LanguageJavaScriptApache License 2.0Apache-2.0

Activiti Cloud Example

Join the chat at https://gitter.im/Activiti/Activiti7

license CLA assistant

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.

  1. Add this entry to your hosts (/etc/hosts) file:

    127.0.0.1 activiti-cloud-sso-idm

  2. cd docker/

    1. Run > docker-compose -f infrastructure-docker.yml up -d (to start all the infrastructure services)
  3. Load the json Postman collection located in the root directory into Postman (e.g. chrome plugin)

  4. Go to the keycloak folder and send the getKeycloakToken request

  5. 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 called routes

  6. In order to create and start a new Runtime Bundle (by default there is no Runtime Bundle started) you have two options:

    1. Docker Option (No Java, No Maven Needed, this is the quickest path)
      1. cd docker-runtime-bundle/
      2. docker build -t "rb-my-app" . (to build a new docker image called rb-my-app using the Dockerfile located in current directory, denoted by '.')
      3. cd ..
    2. Maven Option
      1. cd maven-runtime-bundle/
      2. mvn clean install docker:build (this will compile the java project with maven and generate a docker image called rb-my-app
  7. With the infrastructure up and running you can start your Runtime Bundle by:

    1. 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 in rb-docker-compose.yml as per comments in that file)
    2. 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 the application-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.
  8. 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.