# Notification Engine (Engine `abn`)

The Notification Engine contains functions for setting up subscriptions and revisits.
Subscriptions inform the user about changes to DMS objects.
Revisits enable time-based reminders for specific objects.

> **Note:** In multi-server systems, a server can only notify clients that are connected to that server.

## Subscriptions

* [abn.Add](abn.md#abn.Add)
* [abn.Remove](abn.md#abn.Remove)
* [abn.RemoveAboIdent](abn.md#abn.RemoveAboIdent)
* [abn.GetAboGrpList](abn.md#abn.GetAboGrpList)
* [abn.GetDocList](abn.md#abn.GetDocList)
* [abn.GetGroupList](abn.md#abn.GetGroupList)
* [abn.GetRequestList](abn.md#abn.GetRequestList)
* [abn.GetUserList](abn.md#abn.GetUserList)
* [abn.GetSubscriptions](abn.md#abn.GetSubscriptions)
* [abn.UpdateReqAboGrp](abn.md#abn.UpdateReqAboGrp)
* [abn.NotifyAbonnement](abn.md#abn.NotifyAbonnement)
* [abn.NotifyRequestAbo](abn.md#abn.NotifyRequestAbo)
* [abn.RemoveAllObjAboNotifyFromUser](abn.md#abn.RemoveAllObjAboNotifyFromUser)
* [abn.RemoveObjAboNotifyFromUser](abn.md#abn.RemoveObjAboNotifyFromUser)
* [abn.SetOsInformed](abn.md#abn.SetOsInformed)
* [abn.ResetOsInformed](abn.md#abn.ResetOsInformed)
* [abn.SetOsRead](abn.md#abn.SetOsRead)
* [abn.ResetOsRead](abn.md#abn.ResetOsRead)
* [abn.ConfirmAboRead](abn.md#abn.ConfirmAboRead)
* [abn.GetUnreadAboCount](abn.md#abn.GetUnreadAboCount)

## Revisits

* [abn.AddRevisit](abn.md#abn.AddRevisit)
* [abn.UpdateRevisit](abn.md#abn.UpdateRevisit)
* [abn.GetRevisits](abn.md#abn.GetRevisits)
* [abn.GetRecentObjects](abn.md#abn.GetRecentObjects)
* [abn.CheckOsrevisit](abn.md#abn.CheckOsrevisit)
* [abn.ChangeRevisitUser](abn.md#abn.ChangeRevisitUser)
* [abn.SetObjRevisitClosed](abn.md#abn.SetObjRevisitClosed)
* [abn.SetObjRevisitOpen](abn.md#abn.SetObjRevisitOpen)
* [abn.RemoveObjRevisitNotifyFromUser](abn.md#abn.RemoveObjRevisitNotifyFromUser)
* [abn.GetUnreadRevisitCount](abn.md#abn.GetUnreadRevisitCount)

## Undocumented Endpoints

The following jobs are offered by the enaio® server but are not currently described in this documentation:

* `abn.CheckObjAboList`
* `abn.CheckRevisitDocs`

<a id="abn.Add"></a>

## abn.Add

This job creates a subscription for the specified object.

> **Note:** The request for request subscriptions (`AboRequest`) must consist of lowercase letters and begin with `select count(distinct d.id)` or `select distinct d.id`, otherwise it will be rejected.
Depending on the main type of the requested object, `o.id` must be used for folders, `r.id` for registers or `d.id` for documents as identifier.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `ObjectID` | INT | Yes | ID of the object to be notified about |
| `ObjectType` | INT | Yes | Type of the object |
| `ActionFlags` | INT | Yes | Action performed on the document that triggers notification: +<br>`2` = Notification when a document is created (for subscribed requests only) +<br>`3` = Notification when index data is changed (for subscribed documents only) +<br>`4` = Notification when the document is changed +<br>`27` = Notification when the document is deleted +<br>`39` = Notification when a location is added |
| `Channel` | INT | Yes | Notification channel (type of notification): +<br>`0` = Notification via internal channel (oxmljsc) +<br>`1` = Notification via email |
| `AboGrpID` | STRING | Yes | This ID combines all actions of a subscription. |
| `[User]` | STRING | No | Name of the user to be notified |
| `[Alias]` | STRING | No | Info text for the subscription (max. 255 characters) |
| `[Product]` | STRING | No | String describing the program instance, e.g. `ax.exe` |
| `[Confirm]` | INT | No | `1` = user/group was notified, must be marked as read before deleting the message +<br>`2` = system password of the user is queried before marking as read +<br>`0` = no confirmation required (default) |
| `[Station]` | STRING | No | Name of the station that should exclusively receive the notification |
| `[Mail]` | STRING | No | Email address for notification (max. 255 characters); multiple addresses separated by semicolon |
| `[AboType]` | INT | No | `0` = Document subscription (default); `1` = Request subscription |
| `[RequestFormat]` | STRING | No | Format of the request. Default `ABN` (native SQL format; request is evaluated in parameter `AboRequest`).<br>`XML` = DMSQuery request expected in parameter `XmlRequest`. |
| `[AboRequest]` | STRING | No | SQL statement for request subscriptions |
| `[XmlRequest]` | STRING/BASE64 | No | Subscription request in DMSQuery XML format |
| `[GroupID]` | STRING | No | GUID of the group to be notified |
| `[UserID]` | STRING | No | User GUID of the Abo admin when creating system subscriptions |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

See also: [abn.Remove](abn.md#abn.Remove)

<a id="abn.AddRevisit"></a>

## abn.AddRevisit

This job sets an object for a specific user to _follow-up_.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `ObjectID` | INT | Yes | ID of the object |
| `ObjectType` | INT | Yes | Type of the object |
| `UserID` | INT | Yes | ID of the user who should receive the notification |
| `RevisitTime` | BIGINT | Yes | Time when the user should receive the notification (seconds since 01.01.1970 01:00:00 MEZ) |
| `InfoText` | STRING | Yes | Info text (max. 225 characters) |
| `RevisitGUID` | STRING | Yes | GUID for identifying related follow-ups (32 characters) |
| `[Email]` | STRING | No | Email addresses, separated by semicolon (max. 255 characters) |
| `[Confirm]` | INT | No | Requirement for password-protected confirmation.<br>If `Confirm` is not specified or set to `0`, no password query occurs. |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.ChangeRevisitUser"></a>

## abn.ChangeRevisitUser

This job assigns all revisit notifications of a user to a different user.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `NewUserID` | INT | Yes | ID of the new user |
| `OldUserID` | INT | Yes | ID of the current user |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.CheckOsrevisit"></a>

## abn.CheckOsrevisit

This job performs a check of the revisit table (`osrevisit`) and sends a notification to users for whom revisits are defined if the corresponding timestamps require this.
For notifying affected users, this job uses the job `abn.Osrevisit`.

> **Note:** This job is called periodically internally. A batch must be set up in the registry for this.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.ConfirmAboRead"></a>

## abn.ConfirmAboRead

This job sets an Abo notification, for which confirmation was requested, to _confirmed_.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `ObjectID` | INT | Yes | ID of the object |
| `ObjectType` | INT | Yes | Type of the object |
| `UserID` | INT | Yes | ID of the user who received the notification |
| `AboSetTime` | BIGINT | Yes | Time when the user received the notification |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.GetAboGrpList"></a>

## abn.GetAboGrpList

This job returns information about a subscription via the AboGrpID.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `AboGrpID` | STRING | Yes | ID that groups all defined actions of the subscription |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Abo[1..n]` | STRING | — | Semicolon-separated information about the subscription, each record in the following order:<br>Document ID;<br>Document type;<br>Info text;<br>Subscription ID;<br>Confirm (`1` = mark as read before deletion; `0` = not required);<br>UserID (User GUID of the subscription admin for system subscriptions);<br>GroupID (ID of the group to be notified);<br>Subscription type (`0` = document subscription; `1` = request subscription);<br>Action (`2`/`3`/`4`/`27`/`39`);<br>Notification type (`0` = internal/oxmljsc; `1` = email + address);<br>Name of the user to be notified;<br>SQL statement for request subscription |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.GetDocList"></a>

## abn.GetDocList

This job determines all objects that the specified user has subscribed to.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | `0` = Documents for the specified username are determined +<br>`1` = Additionally, documents are determined that were created for user groups in which the specified user is currently located |
| `User` | STRING | Yes | Name of the user |
| `[Product]` | STRING | No | Search is limited to the specified program instance. |
| `[Station]` | STRING | No | Search is limited to the specified user station. |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Document[1..n]` | STRING | — | Semicolon-separated information about the subscribed document, each record in the following order:<br>Document ID;<br>Document type;<br>Info text;<br>Subscription ID;<br>Confirm (`1` = mark as read before deletion; `0` = not required);<br>UserID (User GUID of the subscription admin for system subscriptions);<br>GroupID (ID of the group to be notified);<br>Subscription type (`0` = document subscription; `1` = request subscription);<br>Action (`2`/`3`/`4`/`27`/`39`);<br>Notification type (`0` = internal/oxmljsc; `1` = email + address);<br>AboGrp (groups all records of the different actions of a subscription) |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.GetGroupList"></a>

## abn.GetGroupList

This job determines the user groups that have subscribed to the specified object.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `ObjectID` | INT | Yes | ID of the object to be checked |
| `ObjectType` | INT | Yes | Type of the object |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Group[1..n]` | STRING | — | Semicolon-separated information about the group and subscription, each record in the following order:<br>Group ID;<br>Group name;<br>Group GUID;<br>Group description;<br>Info text for the subscription;<br>User GUID of the subscription admin (for system subscriptions);<br>AboGrp (groups all records of the different actions of a subscription);<br>Action (`2`/`3`/`4`/`27`/`39`);<br>Notification type (`0` = internal/oxmljsc; `1` = email + address);<br>Subscription ID |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.GetRecentObjects"></a>

## abn.GetRecentObjects

This job determines the DMS objects most recently edited by the logged-in user.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `Count` | DWORD | Yes | Number of recently edited DMS objects to determine.<br>Valid values: 5 – 99. Values outside this range are set to the nearest boundary<br>(e.g. `Count=0` → `5`; `Count=1000` → `99`). |
| `[HistActIDList]` | STRING | No | Comma-separated list of `osHistAct` actions used to determine the most recently edited DMS objects. +<br>Default (without parameter): Actions `2,3,4`: +<br>`2` = object created +<br>`3` = index data changed +<br>`4` = document changed |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Recent` | STRING | — | Comma and semicolon separated list of determined DMS objects |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.GetRequestList"></a>

## abn.GetRequestList

This job determines all request subscriptions that the specified user has subscribed to.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `OutputUnicode` | INT | Yes | Must be passed with `1`. |
| `User` | STRING | Yes | Name of the user |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `sRequest[1..n]` | STRING | — | Semicolon-separated information about the request, each record in the following order:<br>Info text for the subscription;<br>Object type;<br>Subscription ID;<br>Confirm (`1` = request confirmation of awareness; `0` = not required);<br>User GUID of the subscription admin (for system subscriptions);<br>GUID of the group to be notified;<br>Subscription type (`0` = document subscription; `1` = request subscription);<br>Action (`2`/`3`/`4`/`27`/`39`);<br>Notification type (`0` = internal/oxmljsc; `1` = email + address);<br>AboGrp (groups all records of the different actions of a subscription);<br>SQL string for request subscription |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.GetRevisits"></a>

## abn.GetRevisits

This job returns the revisit entries for the logged-in user in DMS Content format.

> **Note:** Folders are currently not considered.

Additionally, the following parameters can be set to format the returned XML document:
`RequestType`, `OutputFormat`, `Baseparams`, `Offset`, `Pagesize`, `MaxHits`, `Rights`, `DateFormat`, `Variants`, `FileInfo`.
The description of these parameters can be found in [dms.GetResultList](dms.md#dms.GetResultList).

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | `4096` = XML document is UTF-8 encoded; without this flag: UTF-16 |
| `[StartTime]` | STRING | No | Timestamp for the point in time until which the revisits should be returned.<br>Format: `DD.MM.YYYY HH:MM:SS` (time specification can be omitted). +<br>Special value `0` (default): all currently existing, not checked-off revisits. |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `[Count]` | INT | Optional | Number of revisits |
| `[XML]` | BASE64 | Optional | Revisits in DMSContent XML format.<br>The following fields are returned: |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

**Example: returned XML**

```xml
<Rowset>
  <Columns>
    <Column object="Grayscale image" type="DOCUMENT" name="links" system="1"
            datatype="INTEGER" dbname="links" ostype="9" size="10">OBJECT_LINKS</Column>
    <Column object="Grayscale image" type="DOCUMENT" name="count" system="1"
            datatype="INTEGER" dbname="anzahl" ostype="9" size="10">OBJECT_COUNT</Column>
    <Column object="Grayscale image" type="DOCUMENT" name="flags" system="1"
            datatype="INTEGER" dbname="flags" ostype="9" size="10">OBJECT_FLAGS</Column>
    <Column object="Grayscale image" type="DOCUMENT" name="lockuser" system="1"
            datatype="INTEGER" dbname="lockuser" ostype="9" size="10">OBJECT_LOCKUSER</Column>
    <Column object="Grayscale image" type="DOCUMENT" name="main_type" system="1"
            datatype="INTEGER" dbname="haupttyp" ostype="9" size="10">OBJECT_MAIN</Column>
    <Column object="Revisit" type="REVISIT" name="set_time" system="1"
            datatype="DATETIME" dbname="set_time" ostype="9" size="10">REV_SET_TIME</Column>
    <Column object="Revisit" type="REVISIT" name="lastvisit" system="1"
            datatype="DATETIME" dbname="lastvisit" ostype="9" size="10">REV_LASTVISIT</Column>
    <Column object="Revisit" type="REVISIT" name="firstvisit" system="1"
            datatype="DATETIME" dbname="firstvisit" ostype="9" size="10">REV_FIRSTVISIT</Column>
    <Column object="Revisit" type="REVISIT" name="osconfirm" system="1"
            datatype="INTEGER" dbname="osconfirm" ostype="9" size="10">REV_OSCONFIRM</Column>
    <Column object="Revisit" type="REVISIT" name="set_user_id" system="1"
            datatype="INTEGER" dbname="set_user_id" ostype="9" size="10">REV_SET_USER_ID</Column>
    <Column object="Revisit" type="REVISIT" name="infotext" system="1"
            datatype="TEXT" dbname="infotext" ostype="X" size="225">REV_INFOTEXT</Column>
    <Column object="Grayscale image" type="DOCUMENT" name="Document type"
            datatype="TEXT" dbname="feld1" ostype="X" size="30">Document type</Column>
    <Column object="Grayscale image" type="DOCUMENT" name="Date"
            datatype="DATE" dbname="datum1" ostype="D" size="10">Date</Column>
    <Column object="Grayscale image" type="DOCUMENT" name="Author"
            datatype="TEXT" dbname="feld2" ostype="X" size="50">Author</Column>
    <Column object="Grayscale image" type="DOCUMENT" name="Source"
            datatype="TEXT" dbname="feld3" ostype="X" size="150">Source</Column>
    <Column object="Grayscale image" type="DOCUMENT" name="Content"
            datatype="TEXT" dbname="feld4" ostype="X" size="150">Content</Column>
  </Columns>
  <Rows>
    <Row id="415">
      <Value>0</Value>
      <Value>1</Value>
      <Value value="2">NOT_ARCHIVABLE</Value>
      <Value value="">UNLOCKED</Value>
      <Value value="1">GRAYSCALE</Value>
      <Value value="1089723507">13.07.2004 14:58:27</Value>
      <Value value="0"/>
      <Value value="1089723600">13.07.2004 15:00:00</Value>
      <Value/>
      <Value value="53">LIEBE</Value>
      <Value>Please review</Value>
      <Value>Drawing</Value>
      <Value>04.09.2002</Value>
      <Value>Liebe</Value>
      <Value>Cave</Value>
      <Value>Bull</Value>
    </Row>
    <Row id="416">
      <Value>0</Value>
      <Value>0</Value>
      <Value value="8">NO_PAGES</Value>
      <Value value="">UNLOCKED</Value>
      <Value value="1">GRAYSCALE</Value>
      <Value value="1089727995">13.07.2004 16:13:15</Value>
      <Value value="0"/>
      <Value value="1089728100">13.07.2004 16:15:00</Value>
      <Value/>
      <Value value="53">LIEBE</Value>
      <Value>Send picture</Value>
      <Value>Anger</Value>
      <Value>05.09.2002</Value>
      <Value>Admin</Value>
      <Value>unknown</Value>
      <Value>Bat</Value>
    </Row>
  </Rows>
</Rowset>
```

<a id="abn.GetSubscriptions"></a>

## abn.GetSubscriptions

This job returns the subscriptions for the logged-in user in DMS Content format.

Additionally, the following parameters can be set to format the returned XML document:
`RequestType`, `OutputFormat`, `OutputLanguage`, `Baseparams`, `Offset`, `Pagesize`, `MaxHits`, `Rights`, `DateFormat`, `Variants`, `FileInfo`.
The description of these parameters can be found in [dms.GetResultList](dms.md#dms.GetResultList).

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | No options currently available — pass `0`. |
| `[XML]` | BASE64 | No | Request in XML format.<br>This can be used to select within the subscribed objects.<br>The query possibilities are limited to linear queries. |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `[Count]` | INT | Optional | Number of subscriptions |
| `[XML]` | BASE64 | Optional | Subscriptions in DMSContent XML format.<br>The following fields are returned: |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

**Example: returned XML**

```xml
<Rowset>
  <Columns>
    <Column object="Photos" type="DOCUMENT" name="links" system="1"
            datatype="INTEGER" dbname="links" ostype="9" size="10">OBJECT_LINKS</Column>
    <Column object="Photos" type="DOCUMENT" name="count" system="1"
            datatype="INTEGER" dbname="anzahl" ostype="9" size="10">OBJECT_COUNT</Column>
    <Column object="Photos" type="DOCUMENT" name="flags" system="1"
            datatype="INTEGER" dbname="flags" ostype="9" size="10">OBJECT_FLAGS</Column>
    <Column object="Photos" type="DOCUMENT" name="lockuser" system="1"
            datatype="INTEGER" dbname="lockuser" ostype="9" size="10">OBJECT_LOCKUSER</Column>
    <Column object="Photos" type="DOCUMENT" name="main_type" system="1"
            datatype="INTEGER" dbname="haupttyp" ostype="9" size="10">OBJECT_MAIN</Column>
    <Column object="Revisit" type="REVISIT" name="firstvisit" system="1"
            datatype="DATETIME" dbname="firstvisit" ostype="9" size="10">REV_FIRSTVISIT</Column>
    <Column object="Revisit" type="REVISIT" name="osabotype" system="1"
            datatype="INTEGER" dbname="osabotype" ostype="9" size="10">REV_OSABOTYPE</Column>
    <Column object="Revisit" type="REVISIT" name="osconfirm" system="1"
            datatype="INTEGER" dbname="osconfirm" ostype="9" size="10">REV_OSCONFIRM</Column>
    <Column object="Revisit" type="REVISIT" name="set_user_id" system="1"
            datatype="INTEGER" dbname="set_user_id" ostype="9" size="10">REV_SET_USER_ID</Column>
    <Column object="Revisit" type="REVISIT" name="osuserid" system="1"
            datatype="TEXT" dbname="osuserid" ostype="X" size="32">REV_OSUSERID</Column>
    <Column object="Revisit" type="REVISIT" name="infotext" system="1"
            datatype="TEXT" dbname="infotext" ostype="X" size="225">REV_INFOTEXT</Column>
    <Column object="Photos" type="DOCUMENT" name="Notes"
            datatype="TEXT" dbname="feld1" ostype="X" size="248">Notes</Column>
  </Columns>
  <Rows>
    <Row id="73543">
      <Value>0</Value>
      <Value>1</Value>
      <Value value="2">NOT_ARCHIVABLE</Value>
      <Value value="0">UNLOCKED</Value>
      <Value value="3">COLOR</Value>
      <Value value="1089804789">14.07.2004 13:33:09</Value>
      <Value value="2">OBJECT_CREATED</Value>
      <Value>1</Value>
      <Value value="53">LIEBE</Value>
      <Value value=""/>
      <Value>New photos</Value>
      <Value>Front view</Value>
    </Row>
  </Rows>
</Rowset>
```

<a id="abn.GetUnreadAboCount"></a>

## abn.GetUnreadAboCount

This job determines the number of read and unread Abo notifications for a user.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `UserID` | INT | Yes | User ID of the user whose Abo notifications should be determined |
| `[Mode]` | INT | No | `0` = all Abo notifications are determined (default) +<br>`1` = notifications from subscriptions created by the user himself are not considered +<br>`2` = for each subscription, only the last Abo notification is determined +<br>`3` = combination of `1` and `2` |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Read` | INT | — | Number of read Abo notifications |
| `Unread` | INT | — | Number of unread Abo notifications |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.GetUnreadRevisitCount"></a>

## abn.GetUnreadRevisitCount

This job determines the number of read and unread revisits for a user.

> **Note:** When specifying a time (`StartTime > 0`), always 86,399 seconds (almost 24 hours) are added to simplify the specification.
Example: For revisits until 01.01.2018, calculate the seconds to the time 01.01.2018 00:00:00 — all revisits until 01.01.2018 23:59:59 are returned.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `UserID` | INT | Yes | User ID of the user whose revisits should be determined |
| `[StartTime]` | BIGINT | No | `0` = all revisits until the current time (default) +<br>`>0` = time in seconds since 01.01.1970 01:00:00 MEZ, until which revisits should be determined |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Read` | INT | — | Number of read revisits |
| `Unread` | INT | — | Number of unread revisits |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.GetUserList"></a>

## abn.GetUserList

This job returns a list of all subscription owners (requests/documents) for the specified object.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `ObjectID` | INT | Yes | ID of the subscribed document, or `0` for subscribed requests |
| `ObjectType` | INT | Yes | Type of the object |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `User[1..n]` | STRING | — | List of subscription users, each record in the following order:<br>Name of the user to be notified;<br>Info text for the subscription;<br>User GUID of the subscription admin (for system subscriptions);<br>AboGrp (groups all records of the different actions of a subscription);<br>Action (`2`/`3`/`4`/`27`/`39`);<br>Notification type (`0` = internal/oxmljsc; `1` = email + address);<br>Subscription ID |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.NotifyAbonnement"></a>

## abn.NotifyAbonnement

This job sends a notification to a user according to the specified parameters.

> **Note:** If `Action=1` (document deleted), the subscription for this document is also deleted from the database along with the notification.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `ObjectID` | INT | Yes | ID of the document that was changed or deleted |
| `ObjectType` | INT | Yes | Type of the object |
| `Action` | INT | Yes | `1` = document was deleted; `0` = document was changed |
| `User` | STRING | Yes | Name of the user who changed or deleted the document |
| `UserID` | INT | Yes | ID of the user who changed or deleted the document |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.NotifyRequestAbo"></a>

## abn.NotifyRequestAbo

This job is called by the server kernel and checks whether users need to be notified about new subscriptions.

> **Note:** For the kernel to call this job, a batch `RegAbo` must be set up.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.Remove"></a>

## abn.Remove

This job removes subscriptions to objects from the database.
Various combinations of parameters can be used — for example, if the `Station` parameter is specified, only entries for that station are deleted.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `ObjectID` | INT | Yes | ID of the document whose subscription should be removed |
| `ObjectType` | INT | Yes | Type of the object |
| `[User]` | STRING | No | Name of the user to be notified |
| `[UserID]` | STRING | No | User GUID of the subscription admin when removing system subscriptions |
| `[GroupID]` | STRING | No | ID of the group for which the subscription was defined |
| `[Product]` | STRING | No | String describing the program instance of the subscription to be removed (for refining the search) |
| `[Station]` | STRING | No | String describing the user station of the subscription to be removed (for refining the search) |
| `[Alias]` | STRING | No | Alias of the document whose subscription should be removed (max. 255 characters) |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

See also: [abn.Add](abn.md#abn.Add)

<a id="abn.RemoveAboIdent"></a>

## abn.RemoveAboIdent

This job deletes a subscription entry from the `osabonnement` table by specifying the AboID or the AboGrpID.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `[AboID]` | INT | No | ID of the subscription |
| `[AboGrpID]` | STRING | No | ID of the subscription group |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.RemoveAllObjAboNotifyFromUser"></a>

## abn.RemoveAllObjAboNotifyFromUser

This job removes all subscription notifications assigned to the user.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `ObjectID` | INT | Yes | ID of the object |
| `ObjectType` | INT | Yes | Type of the object |
| `UserID` | INT | Yes | ID of the user |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.RemoveObjAboNotifyFromUser"></a>

## abn.RemoveObjAboNotifyFromUser

This job removes a specific subscription notification assigned to the user.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `ObjectID` | INT | Yes | ID of the object |
| `ObjectType` | INT | Yes | Type of the object |
| `UserID` | INT | Yes | ID of the user |
| `AboSetTime` | BIGINT | Yes | Time of the notification |
| `SetUserID` | INT | Yes | ID of the user who triggered the notification |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.RemoveObjRevisitNotifyFromUser"></a>

## abn.RemoveObjRevisitNotifyFromUser

This job removes a specific revisit notification assigned to a user.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `ObjectID` | INT | Yes | ID of the object |
| `ObjectType` | INT | Yes | Type of the object |
| `UserID` | INT | Yes | ID of the user |
| `RevisitTime` | BIGINT | Yes | Time of the notification |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.ResetOsInformed"></a>

## abn.ResetOsInformed

This job sets an object in the subscription list as _unread_.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `ObjectID` | INT | Yes | ID of the object |
| `ObjectType` | INT | Yes | Type of the object |
| `UserID` | INT | Yes | ID of the user who receives the existing notification |
| `AboSetTime` | BIGINT | Yes | Timestamp when the subscription was created |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.ResetOsRead"></a>

## abn.ResetOsRead

This job removes the read marker of an object for a user (counterpart to [abn.SetOsRead](abn.md#abn.SetOsRead)).
Analogous to [abn.ResetOsInformed](abn.md#abn.ResetOsInformed) for subscription notifications.

====
This job is not listed in the official enaio® abn engine overview. This description was reconstructed from the call code of the `enaio-jobs-custom` template.
====

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Reserved; always pass `0`. |
| `FirstVisit` | INT \\| INT64 | Yes | Timestamp of the read marker to reset, as Unix epoch seconds. Transmitted as 32-bit or 64-bit integer depending on the value range. |
| `ObjectID` | INT | Yes | Numeric ID of the object. |
| `ObjectType` | INT | Yes | Numeric ID of the object type. |
| `UserID` | INT | Yes | Numeric ID of the user. |
| `UserIdent` | INT | Yes | User identifier (populated identically to `UserID` in the call code). |

### Return Value

`(INT)`: `0` = job successful, otherwise error code.

### See Also

* [abn.SetOsRead](abn.md#abn.SetOsRead) — sets the read marker
* [abn.ResetOsInformed](abn.md#abn.ResetOsInformed) — removes the informed marker for subscription notifications

<a id="abn.SetObjRevisitClosed"></a>

## abn.SetObjRevisitClosed

This job sets a specific revisit notification assigned to a user as _processed_.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `ObjectID` | INT | Yes | ID of the object |
| `ObjectType` | INT | Yes | Type of the object |
| `UserID` | INT | Yes | ID of the user |
| `RevisitTime` | BIGINT | Yes | Time of creation of the notification |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.SetObjRevisitOpen"></a>

## abn.SetObjRevisitOpen

This job removes the _processed_ status for a specific revisit notification assigned to a user.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `ObjectID` | INT | Yes | ID of the object |
| `ObjectType` | INT | Yes | Type of the object |
| `UserID` | INT | Yes | ID of the user |
| `RevisitTime` | BIGINT | Yes | Time of creation of the notification |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.SetOsInformed"></a>

## abn.SetOsInformed

This job sets an object in the subscription list as _read_.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `ObjectID` | INT | Yes | ID of the object |
| `ObjectType` | INT | Yes | Type of the object |
| `UserID` | INT | Yes | ID of the user who receives the existing notification |
| `AboSetTime` | BIGINT | Yes | Timestamp when the subscription was created |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.SetOsRead"></a>

## abn.SetOsRead

This job marks an object as read for a user — analogous to [abn.SetOsInformed](abn.md#abn.SetOsInformed) for subscription notifications, but for the read marker meaning "user has seen / opened the object".

====
This job is not listed in the official enaio® abn engine overview. This description was reconstructed from the call code of the `enaio-jobs-custom` template.
====

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Reserved; always pass `0`. |
| `FirstVisit` | INT \\| INT64 | Yes | Timestamp of the first visit as Unix epoch seconds. Transmitted as 32-bit or 64-bit integer depending on the value range. |
| `ObjectID` | INT | Yes | Numeric ID of the object being marked as read. |
| `ObjectType` | INT | Yes | Numeric ID of the object type. |
| `UserID` | INT | Yes | Numeric ID of the user for whom the marker is set. |
| `UserIdent` | INT | Yes | User identifier (populated identically to `UserID` in the call code). |

### Return Value

`(INT)`: `0` = job successful, otherwise error code.

### See Also

* [abn.ResetOsRead](abn.md#abn.ResetOsRead) — removes the read marker
* [abn.SetOsInformed](abn.md#abn.SetOsInformed) — sets the informed marker for subscription notifications
* [abn.ResetOsInformed](abn.md#abn.ResetOsInformed) — removes the informed marker

<a id="abn.UpdateReqAboGrp"></a>

## abn.UpdateReqAboGrp

This job changes the SQL statement and object type for request subscriptions for an Abo group.

> **Note:** The request must consist of lowercase letters and begin with `select count(distinct d.id)` or `select distinct d.id`, otherwise it will be rejected.
Depending on the main type of the requested object, `o.id` must be used for folders, `r.id` for registers, or `d.id` for documents as identifier.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `AboGrpID` | STRING | Yes | Subscription group |
| `AboRequest` | STRING | Yes | SQL statement for request subscriptions |
| `ObjectType` | INT | Yes | Type of the object |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.

<a id="abn.UpdateRevisit"></a>

## abn.UpdateRevisit

This job sets a new info text and a new revisit time for an existing revisit.
An email address can optionally be specified.

> **Note:** If `Confirm` is not specified, this setting does not change.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `ObjectID` | INT | Yes | ID of the object |
| `ObjectType` | INT | Yes | Type of the object |
| `UserID` | INT | Yes | ID of the user who receives the existing notification |
| `SetUserID` | INT | Yes | ID of the user who created the existing notification |
| `OldRevisitTime` | BIGINT | Yes | Time when the user should receive the notification (old value) |
| `SetRevisitTime` | BIGINT | Yes | Time when the existing notification was created |
| `NewRevisitTime` | BIGINT | Yes | New time when the user should receive the notification |
| `NewInfoText` | STRING | Yes | New info text (max. 225 characters) |
| `[Email]` | STRING | No | Email addresses separated by semicolon (max. 255 characters) |
| `[Confirm]` | INT | No | Request for password-protected confirmation |

### Return Value

`(INT)`: `0` = Job successful, otherwise error code.
