# Installing the Alerts Service

Transformer’s Alerts Service hosts and manages containers of app notifications. Notifications are queued until their recipients read and dismiss them. You can use the [com.caplin.datasource.notification](https://docs.caplin.com/developer/api/cis/latest/com/caplin/datasource/notification/package-summary.html) API to post notifications to the service, or you can use StreamLink to set an Alerts Service [Trigger,opts="nofollow"](https://docs.caplin.com/developer/api/streamlinkjs/6/#caplin.streamlink.alerts.Trigger.html), which generates a notification when a condition is met.

Caplin’s FX solutions use the Alerts Service to manage order notifications.

## Prerequisites

You must [activate Transformer’s Persistence Service](transformer-activating-the-persistence-service.md) before installing the Alerts Service.

## Installing the Alerts Service

The Alerts Service is packaged as a service blade, `CPB_AlertsService-<version>.zip`.

For instructions on how to deploy a service blade, see [Deploy a Caplin supplied blade](../deployment-framework/cdf-deploy-a-caplin-supplied-blade.md).

## Setting user permissions

To allow users to interact with the Alerts Service, configure Liberator’s Permissioning Service according to the specification below. For more information on permissioning, see [User Authentication and Permissioning](../liberator/liberator-user-authentication-and-permissioning.md).

### Rules

Define rules that trigger when users contribute to the Alerts Service’s control subjects. The strings used for the 'permission namespace' and the 'action' are arbitrary; you are free to customise them to your own naming scheme.

| Message Subject | Rule Type | Permission Namespace | Action | Action Ref | Product Ref |
| --- | --- | --- | --- | --- | --- |
| ^/PRIVATE/NOTIFICATIONS/%u/CONTROL | WRITE | TRANSFORMER_ALERTS_SERVICE | NOTIFICATION_OPERATION | - | ALL_PRODUCTS |
| ^/PRIVATE/ALERTS/%u/TRIGGERCONTROL/.* | WRITE | TRANSFORMER_ALERTS_SERVICE | ALERT_OPERATION | - | ALL_PRODUCTS |

### Permissions

Assign users the following permissions.

| Product Set | Permission Namespace | Action | Authorisation |
| --- | --- | --- | --- |
| .* | TRANSFORMER_ALERTS_SERVICE | NOTIFICATION_OPERATION | ALLOW |
| .* | TRANSFORMER_ALERTS_SERVICE | ALERT_OPERATION | ALLOW |
| ^/PRIVATE/NOTIFICATIONS/%u/.* | - | VIEW | ALLOW |
| ^/FILTER/PRIVATE/NOTIFICATIONS/%u/.* | - | VIEW | ALLOW |
| ^/PRIVATE/ALERTS/%u/.* | - | VIEW | ALLOW |

### Java Permissioning Integration API example

See the code below for an example of how to set rules and permissions using the [Java Permissioning Integration API](https://docs.caplin.com/developer/api/cis/latest/com/caplin/permissioning/package-summary.html).

```java
// Rules
permissioningDataSource.createActionRule("^/PRIVATE/NOTIFICATIONS/%u/CONTROL",
    "TRANSFORMER_ALERTS_SERVICE", "NOTIFICATION_OPERATION", Constants.ALL_PRODUCTS);
permissioningDataSource.createActionRule("^/PRIVATE/ALERTS/%u/TRIGGERCONTROL/.*",
    "TRANSFORMER_ALERTS_SERVICE", "ALERT_OPERATION", Constants.ALL_PRODUCTS);

// WRITE permissions
java.util.HashSet<String> allProducts = new java.util.HashSet<String>();
allProducts.add(".*");
user.permit(allProducts, "TRANSFORMER_ALERTS_SERVICE", "NOTIFICATION_OPERATION");
user.permit(allProducts, "TRANSFORMER_ALERTS_SERVICE", "ALERT_OPERATION");

// VIEW permissions
java.util.HashSet<String> viewProductSets = new java.util.HashSet<String>();
viewProductSets.add("^/PRIVATE/NOTIFICATIONS/%u/.*");
viewProductSets.add("^/FILTER/PRIVATE/NOTIFICATIONS/%u/.*");
viewProductSets.add("^/PRIVATE/ALERTS/%u/.*");
user.permit(viewProductSets, Constants.DEFAULT_PERMISSION_NAMESPACE, "VIEW");
```

---

**See also:**

* [Permissioning](../platform-architecture/permissioning.md)
* [Liberator: User authentication and permissioning](../liberator/liberator-user-authentication-and-permissioning.md)
