mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
[skip ci] * Restructure tutorials to remove duplication * Update to work with ADF 4.0 and fix language + grammar * Restructure and add Angular CLI section for prerequisites * Language fixes
102 lines
4.6 KiB
Markdown
102 lines
4.6 KiB
Markdown
---
|
|
Title: Activiti 7 and ADF
|
|
Level: Intermediate
|
|
---
|
|
|
|
# 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](https://www.activiti.org/) is the new generation cloud-native implementation
|
|
of Activiti BPM Engine. Starting with the
|
|
[ADF 3 major release](../release-notes/relnote300.md#activiti-7-support-experimental),
|
|
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]([https://activiti.gitbook.io/activiti-7-developers-guide).
|
|
|
|
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](https://kubernetes.io/docs/concepts/workloads/pods/pod/))
|
|
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](https://github.com/Activiti/activiti-cloud-charts). If you used the
|
|
[quick-start guide](https://activiti.gitbook.io/activiti-7-developers-guide/getting-started/getting-started-activiti-cloud) (deploying the "Activiti Cloud Full Example") you can change the
|
|
[values.yaml](https://github.com/Activiti/activiti-cloud-charts/blob/master/activiti-cloud-full-example/values.yaml)
|
|
file as shown below:
|
|
|
|
```yaml
|
|
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](https://yeoman.io/).
|
|
See our [tutorial](creating-your-first-adf-application.md) 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:
|
|
|
|
```json
|
|
...
|
|
"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.
|