# Configuration

Case specific configurations can be made that have effect on the behaviour of active cases and the processes that support these cases.

Currently there are two options that can be configured on this page.

* Assigning a case handler
* Automatically assigning user tasks to the case handler

## Configuring cases to be assignable

On the case management page, a setting can be changed to indicate that cases of that type can have an assignee. This can be done by toggling the 'Case handler' checkbox to enable assigning cases.

When the case handler option is selected the following changes are visible in the user interface:

* **The case list screen is divided in to tabs**\\

  <figure><img src="/files/SyIv0VIl2QUKQ218D1Tu" alt=""><figcaption><p>Case overview with case handler option selected<br></p></figcaption></figure>

  * **All cases**\
    \&#xNAN;*This overview is the same as for cases that do not have a case handler configured.*\
    \&#xNAN;*All cases are displayed on this tab.*
  * **My cases**\
    \&#xNAN;*Overview of cases that are assigned to the user that is currently logged in.*
  * **Team cases**\
    \&#xNAN;*Overview of cases that are assigned to a team that the user belongs to.*
  * **Unassigned cases**\
    \&#xNAN;*Overview of cases that are not assigned to a case handler or team*\\
* **An "Assignee" column is automatically added to the case list columns**\
  This column displays the case handler assigned to each case in the overview. This column is fixed and can't be removed via the case list configuration page.\\
* **An option to assign a case handler on the case details page.**\
  When clicked a dropdown menu is displayed with all case handlers that can be assigned to the case. Case handlers can be configured via [Access control](/features/access-control.md) for each case type.\\
* **An additional menu in which a case can be claimed.**\
  In this menu the logged in user has the possibility to immediately "claim" the case. Once a case is claimed, the unassign option removes the case handler that is currently assigned to the case. Who is allowed to claim, assign and unassign is all configured via [Access control](/features/access-control.md).

Case settings can be configured as shown in the [creating a case definition section](/features/case.md#creating-a-case-definition)

## Assigning a case handler

There are different ways of assigning a user to a case.

* Assigning the case via the UI
* Claiming the case via the UI
* Implementing a service task in the process
* Using an endpoint in the backend of the implementation

#### Assigning a case

On the case details page there is an option to assign a user. When clicked, a dropdown menu opens that displays all case handlers that can be assigned.

<figure><img src="/files/ROYg3vRRe20vA544gMls" alt=""><figcaption><p>Assigning a user</p></figcaption></figure>

#### Claiming a case

When a specific case is opened, it can be claimed with the `Claim` button in the menu on the right side of the case details page.

<figure><img src="/files/KrCt8byM4UAoKhVOJtG3" alt=""><figcaption><p>Menu to claim a case or unassign the current assignee</p></figcaption></figure>

Once a case is assigned the `Unassign` button is enabled, making it possible to unassign the case again.

#### User assignment through the process

It is possible to assign a user to the current process by creating a service task and adding the following expression:

```
${documentDelegateService.setAssignee(execution, "email address of user")}
```

When this service task is reached the assignee will be set.

Unassigning the case inside a process can be done by using the following expression:

```spel
${documentDelegate.unassign(execution)}
```

## Automatic task assignment

{% hint style="success" %}
Available since Valtimo `10.7.0`
{% endhint %}

It is possible to have user tasks be automatically assigned to a case assignee making the tasks in a case appear under the case assignee's task list.

### Functionality

* This feature causes user tasks (existing and new) to be assigned to the current case assignee if there is one assigned.
* Upon the (re-)assignment of a case all user tasks from all processes currently using the same business key will have their assignee updated to match the new case assignee.
* Removal of an assignee from the case will also clear the assignee on all assigned user tasks withing all processes using the same business key.

Automatic task assignment can be enabled when the case is configured to have a case handler. Once the case handler option is selected, the second checkbox will appear that configures if all user tasks in the processes that support the case should automatically be assigned to the case handler.

<figure><img src="/files/shgNhjNC4PPNAxC6GNNE" alt=""><figcaption><p>Case specific configuration</p></figcaption></figure>

### Limitations

* Only tasks that the user has access to (user has the required role) are assigned to the case assignee.
* Tasks already loaded on a dossier detail page do not automatically show the new assignment. A component reload (switching tabs or reload the page) is required to see the up-to-date assignee in the task modal.

## Configuring visible case list tabs

When the case handler option is enabled, the case list shows tabs to filter cases by assignee. Which tabs are visible and in what order can be configured via the `visibleCaseListTabs` property in the Angular environment file (`src/environments/environment.ts`).

The available tab values are defined by the `CaseListTab` enum:

| Value  | Tab label        | Description                                         | Since   |
| ------ | ---------------- | --------------------------------------------------- | ------- |
| `ALL`  | All cases        | Shows all cases the user has access to.             |         |
| `MINE` | My cases         | Shows cases assigned to the current user.           |         |
| `TEAM` | Team cases       | Shows cases assigned to a team the user belongs to. | 13.21.0 |
| `OPEN` | Unassigned cases | Shows cases without an assigned handler or team.    |         |

### Example configuration

```typescript
import {CaseListTab} from '@valtimo/shared';

export const environment = {
  // ...
  visibleCaseListTabs: [CaseListTab.ALL, CaseListTab.MINE, CaseListTab.TEAM, CaseListTab.OPEN],
};
```

To hide a tab, remove it from the array. For example, to only show "My cases" and "Team cases":

```typescript
visibleCaseListTabs: [CaseListTab.MINE, CaseListTab.TEAM],
```

The first tab in the array is selected by default when opening a case list.

{% hint style="info" %}
The `TEAM` tab requires the team library to be included in the backend. If the library is not present, selecting the tab will result in an error.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.valtimo.nl/features/case/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
