# Process links

Process actions can be attached to Camunda activities through process links. Configured actions will be executed when the process reached the desired activity. This makes it possible to extend the functionality of a process beyond what Camunda offers through BPMN.

Currently, the following types of process-links are supported by Valtimo:

* Form
* Form-flow
* Plugin

## Creating process links

There are two ways of creating process links:

* Manually via the UI
* Using autodeployment via the IDE

{% tabs %}
{% tab title="Via UI" %}
To configure process links, admin privileges are required.

* Go to the `Admin` menu
* Go to the `Process links v2 (beta)` menu
* Select the activity of the desired process.
  * Depending on the type of activity, a list of supported process link types might be shown.
* Follow the steps

![Select process link type](https://290147654-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG2PoMeT8OSmMoaW7kF6t%2Fuploads%2Fgit-blob-961a356b3daceefbe0057df57f65849112eb9ccf%2Fselect-process-link-type.png?alt=media)

#### Creating a form process link

A form process link can be added to user-tasks. When the process reaches the user-task, a user will be presented with the configured form when opening it.

More information about forms can be found [here](https://docs.valtimo.nl/v12/features/forms).

#### Creating a form-flow process link

A form-flow process link can be added to user-tasks. When the process reaches the user-task, an instance of the form-flow will be created and be made visible to the user.

More information about form-flows can be found [here](https://docs.valtimo.nl/v12/features/forms/form-flow).

#### Creating a plugin process link

When configuring a plugin process link, a wizard is presented to choose between the available plugin configuration, actions and (optionally) additional settings for that action.

![Creating a plugin process link](https://290147654-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG2PoMeT8OSmMoaW7kF6t%2Fuploads%2Fgit-blob-a5d01c8d0e8b5abf39368b281dcfb1fd9254ff19%2Fcreate-plugin-process-link.png?alt=media)

Any text fields for configuring the process link itself support several ways of providing values through value resolvers:

1. A fixed value. This value will be put directly into the template without alterations. For example `John`
2. A value retrieved from the case-data. This value should start with `doc:` and should end with the path to the case-data property. For example `doc:/firstname`.
3. A value retrieved from a process variable. This value should start with `pv:` and should end with the name of the process variable. For example `pv:firstname`.
   {% endtab %}

{% tab title="Via IDE" %}
{% hint style="success" %}
Available since Valtimo `10.6.0`
{% endhint %}

Process links can also be configured using autodeployment. These process links will be created at application startup. When a conflicting configuration is found on the target activity, creation is skipped and a warning is logged in the application logs.

Autodeployed process links can be added by creating a json file with the following filename structure: `<process-id>.processlink.json`. This file can be placed anywhere in the resource folder of the application.

This is an example of an autodeployment file for two user task for a process:

```json
[
   {
      "activityId": "do-something",
      "activityType": "bpmn:UserTask:create",
      "processLinkType": "form",
      "formDefinitionName": "do-something"
   },
   {
      "activityId": "do-another-thing",
      "activityType": "bpmn:UserTask:create",
      "processLinkType": "form-flow",
      "formFlowDefinitionId": "do-another-thing:latest"
   },
   {
      "activityId": "delete-object-from-objectsapi",
      "activityType": "bpmn:ServiceTask:start",
      "processLinkType": "plugin",
      "pluginConfigurationId": "7d77d894-6458-4213-8bc0-9a65d523845b",
      "pluginActionDefinitionKey": "delete-object",
      "actionProperties": {
         "objectUrl": "pv:myObjectUrl"
      }
   }
]
```

{% endtab %}
{% endtabs %}

## Editing process links

Process links that have been attached to Camunda activities, can also be edited. Admin privileges are required to edit process links.

* Go to the `Admin` menu
* Go to the `Process links v2 (beta)` menu
* Select the activity of the desired process.
* Change the settings using the provided form
* Save the new configuration by clicking on **Complete**

> Note: It is not possible to change the type of existing process links (form, form-flow or plugin), nor is it possible to change the selected plugin configuration. To do that, please [unlink](#unlinking-process-links) the current process link and [create a new one](#creating-process-links).

![Edit a process link](https://290147654-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG2PoMeT8OSmMoaW7kF6t%2Fuploads%2Fgit-blob-5162a9720e9cc70c1b7147721ccf3ff3aa3dd303%2Fedit-process-link.png?alt=media)

## Unlinking process links

Process links that have been attached to Camunda activities, can also be unlinked (deleted). Admin privileges are required to unlink/delete process links.

* Go to the `Admin` menu
* Go to the `Process links v2 (beta)` menu
* Select the activity of the desired process.
* Click on **Unlink**

![Unlink a process link](https://290147654-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FG2PoMeT8OSmMoaW7kF6t%2Fuploads%2Fgit-blob-5162a9720e9cc70c1b7147721ccf3ff3aa3dd303%2Fedit-process-link.png?alt=media)
