Building an ADF application on top of Activiti Cloud 7.0.0 GA Community Edition

This tutorial shows how to configure an ADF app to connect to Activiti Cloud 7.

Activiti Cloud 7 is the new generation cloud-native implementation of Activiti BPM Engine. Starting with the ADF 3 major release, Alfresco began to support the Activiti 7 Engine within the ADF framework. We have nearly finished implementing all the required features, and so in this tutorial we will explain how to build an ADF application on top of Activiti Cloud 7.0.0 GA Community Edition.

Preparing Activiti 7 services

As you can imagine, a prerequisite to create an ADF app like this is to have an instance of Activiti 7 up and running. To learn how to install and setup your own Activiti 7 instance, please follow the official documentation.

Assuming that you already have your own instance of Activiti 7 up and running, a small tweak is required to make it work correctly with an ADF application. This is mainly a matter of how the application is named, as described in detail below.

What ADF requires from Activiti 7 backend services

By default, Activiti 7 starts a known list of services (which are Kubernetes pods) for each application. Specifically, these include the runtime bundle, connectors, audit, and query among others. Our interest here is the runtime bundle service, which is directly used by all ADF applications.

The runtime bundle service pod (generated by the default installation) has the name rb-[appName] (usually rb-my-app) to begin with. An ADF application requires the runtime bundle service to be available with the name [appName]/rb (usually my-app/rb).

How to change the name of the runtime bundle service

You can change the default name of the runtime bundle easily using the helm charts. If you used the quick-start guide (deploying the "Activiti Cloud Full Example") you can change the values.yaml file as shown below:

    application:
      runtime-bundle:
        enabled: true
        service:
          name: rb \ <-- change it here!
    ...

When this is done, clean up your deployment environment (delete the pods and everything needed to create a fresh environment, ready to be deployed again) and deploy Activiti 7 again, using the modified helm chart.

When Activiti 7 is up and running again, you will be then ready to build your own Alfresco ADF application on top of it.

Building the ADF application

You can create an ADF application easily using the Yeoman generator. See our tutorial for a full description of how to do this. Make sure you select "Process Services with Activiti" as the type of project to create.

Once this is created, do not change the proxy.conf.json file, but continue with the configuration as described in the following paragraph. You are now very close to the goal of having your own ADF application working against Activiti 7 Community Edition backend services.

Configuring the ADF application

To configure your existing ADF application, you just need to edit the app.config.json file.

First of all, be sure you set up the bpmHost, identityHost and host properties with the correct URL of the Activiti 7 deployment. Then check (and probably change) the URI of identityHost and host to be /auth/realms/activiti.

After your changes, the app.config.json file should look like the example below:

    ...
    "bpmHost": "<Activiti7BaseUrl>",
    "identityHost": "<Activiti7BaseUrl>/auth/realms/activiti",
    "providers": "BPM",
    "application": {
        "name": "Alfresco ADF Application"
    },
    "authType": "OAUTH",
    "oauth2": {
        "host": "<Activiti7BaseUrl>/auth/realms/activiti",
    ...

Then, set the alfresco-deployed-apps property as shown below.

"alfresco-deployed-apps": [{"name":""}]

When you are done, save the app.config.json file and launch the application by executing the npm start command. You should now be able to use your own ADF application on top of Activiti 7 Community Edition backend services.

© 2023 Alfresco Software, Inc. All Rights Reserved.