# Standard Engine (Engine `std`)

In the Standard Engine, functions for file-oriented document management are implemented.
These are particularly functions for storing and loading documents, archiving and realizing document exchange between multiple servers.

The Standard Engine is subject to the management of the Work, Cache and Archive areas of the application server.

## Work, Cache and Archive Management

* [std.CleanUpCache](std.md#std.CleanUpCache)
* [std.ClearFromCache](std.md#std.ClearFromCache)
* [std.DoArchive](std.md#std.DoArchive)
* [std.DoPrefetch](std.md#std.DoPrefetch)
* [std.MoveToCache](std.md#std.MoveToCache)
* [std.StoreInCache](std.md#std.StoreInCache)
* [std.StoreInCacheByID](std.md#std.StoreInCacheByID)
* [std.StoreInCacheDirect](std.md#std.StoreInCacheDirect)
* [std.StoreInWork](std.md#std.StoreInWork)
* [std.UndoArchive](std.md#std.UndoArchive)

## File Management

* [std.DeleteDocumentVersion](std.md#std.DeleteDocumentVersion)
* [std.DeleteObject](std.md#std.DeleteObject)
* [std.DeleteDocument](std.md#std.DeleteDocument)
* [std.DeleteRemark](std.md#std.DeleteRemark)
* [std.FindDocumentDigest](std.md#std.FindDocumentDigest)
* [std.GetDocStatistics](std.md#std.GetDocStatistics)
* [std.GetDocStream](std.md#std.GetDocStream)
* [std.GetDocumentDigest](std.md#std.GetDocumentDigest)
* [std.GetDocumentPage](std.md#std.GetDocumentPage)
* [std.GetDocumentStream](std.md#std.GetDocumentStream)
* [std.GetDocVariant](std.md#std.GetDocVariant)
* [std.SetActiveVariant](std.md#std.SetActiveVariant)
* [std.GetDocVersion](std.md#std.GetDocVersion)
* [std.GetObjectInfo](std.md#std.GetObjectInfo)
* [std.GetRemark](std.md#std.GetRemark)
* [std.GetSignedDocument](std.md#std.GetSignedDocument)
* [std.MergeDocuments](std.md#std.MergeDocuments)
* [std.MergeFolder](std.md#std.MergeFolder)
* [std.RestoreDocVersion](std.md#std.RestoreDocVersion)
* [std.RestoreObject](std.md#std.RestoreObject)
* [std.SetHistory](std.md#std.SetHistory)
* [std.StoreRemark](std.md#std.StoreRemark)
* [std.StoreSignedDocument](std.md#std.StoreSignedDocument)
* [std.Unknown2Known](std.md#std.Unknown2Known)
* [std.SetPlannedRetention](std.md#std.SetPlannedRetention)

## Internal Jobs

The internal jobs are generally only used by the Standard DMS engine itself.

* [std.ObjectTransfer](std.md#std.ObjectTransfer)

## Other Jobs

* [std.CheckSource](std.md#std.CheckSource)
* [std.ConfigVarc](std.md#std.ConfigVarc)
* [std.DiskSpace](std.md#std.DiskSpace)
* [std.FileTransfer](std.md#std.FileTransfer)
* [std.GetTemplates](std.md#std.GetTemplates)
* [std.IndexDataChanged](std.md#std.IndexDataChanged)
* [std.PackDirectory](std.md#std.PackDirectory)
* [std.TransformIndexData](std.md#std.TransformIndexData)
* [std.ZipDocument](std.md#std.ZipDocument)

## Other Jobs

* [std.AdjustRetentions](std.md#std.AdjustRetentions)
* [std.CalcDocumentDigest](std.md#std.CalcDocumentDigest)
* [std.GetDocumentSlide](std.md#std.GetDocumentSlide)

## Capture and Processing Messages (CP)

### Jobs

* [std.CPRenditionChanged](std.md#std.CPRenditionChanged)
* [std.CreateCPMessages](std.md#std.CreateCPMessages)
* [std.DispatchCPMessage](std.md#std.DispatchCPMessage)
* [std.GetCPObjectIdxFulltext](std.md#std.GetCPObjectIdxFulltext)
* [std.GetCPObjectInfo](std.md#std.GetCPObjectInfo)
* [std.GetNextCPMessage](std.md#std.GetNextCPMessage)
* [std.ProcessSlideCPMessages](std.md#std.ProcessSlideCPMessages)
* [std.ResetServiceCPMessages](std.md#std.ResetServiceCPMessages)

## Undocumented Endpoints

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

Capture and processing messages (CP)::
`std.GetCPMessageStatistics`, `std.GetCPObjectFulltext`, `std.ProcessPageCountCPMessages`, `std.ResetCPMessage`, `std.ResetSelectiveCPMessages`

Work directory::
`std.CopyInWork`, `std.DeleteInWork`

Archiving and status::
`std.SetArchivableFlag`, `std.StoreInArchive`

Full text::
`std.DeleteFulltext`

Other file and document management::
`std.CalcDocumentMimeType`, `std.ConfigMedienExt`, `std.CopyRemark`, `std.DirectTransformObject`, `std.GetDocSize`, `std.GetDocumentRetentions`, `std.GetDocumentsForAxachash`, `std.GetMediumSizes`, `std.GetMigrationObjectInfo`, `std.GetNextInteger`, `std.GetVarcInformation`

<a id="std.AdjustRetentions"></a>

## std.AdjustRetentions

This job adjusts the retention date of an archived document to the planned retention date.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `[dwObjectID]` | INT | No | ID of the object. If not specified, all documents of the specified type will be adjusted. |
| `dwObjectType` | INT | Yes | Object type. If `dwObjectID` is missing, all documents of this type will be adjusted. |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `[sRetentionDate]` | STRING | Optional | Set retention time in `DD.MM.YYYY` format; only returned if `dwObjectID` is specified. |

### Return Value

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

<a id="std.CPRenditionChanged"></a>

## std.CPRenditionChanged

This job signals to the server that a property of a DMS object's rendition has changed.
Typically called by the rendition service whenever it has freshly produced, updated or
discarded a rendition or one of its aspects.

The job returns no data; instead — depending on the supplied `Reason` — it triggers
server-side follow-up actions:

* Update of the indexing status in [`osftslog`](database/full_text_search.md#database.osftslog) (column `flag2`,
see [value range `flag2`](database/full_text_search.md#database.osftslog)).
* Creation of a follow-up message in [`oscpmqueue`](database/server_cluster_and_configuration.md#database.oscpmqueue) —
typically a message in the `FULLTEXTDOC` queue so the full-text indexer reprocesses the
object with the updated content.
* Update of the page count in the object metadata (when `Reason = PAGECOUNT`).

The complete CP lifecycle is described under
[Capture and Processing Messages (CP)](std.md).

====
This job is not listed in the official enaio® standard engine overview (`std`).
====

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ObjectID` | INT | Yes | Numeric ID of the DMS object whose rendition has changed. |
| `ObjectType` | INT | Yes | Object type ID of the DMS object. |
| `Reason` | STRING | Yes | Kind of rendition change. Known values: see <<reason-values>>. |
| `ServiceName` | STRING | Yes | Identifier of the reporting service instance (typically: `os-rendition-cache`). Used for<br>tracking and identification in follow-up messages — the server does not validate the value<br>against the calling connection context. |
| `Flags` | INT | Yes | Reserved; always pass `0`. |
| `[OutputUnicode]` | INT | No | `1` — string fields in the output as UTF-16. No practical effect for this job since it<br>produces no string output. |

#### Values for `Reason`

| Value | Meaning |
|---|---|
| `TEXT` | The extractable full-text content of the object has changed (new OCR extraction or text<br>layer from a PDF/Office document). Triggers a re-indexing via a new `FULLTEXTDOC` message. |
| `PAGECOUNT` | The page count of the rendition has been (re-)determined — either because the document<br>was converted for the first time or because the conversion yielded a different page count.<br>Primarily updates the stored page count; a re-indexing is only triggered if indexing depends<br>on the page count. |
| `SLIDE` | A slide representation (preview image / per-page images for quick display) has been<br>produced or changed. Affects mainly the display cache and typically does not trigger a<br>re-indexing. |

### Return Value

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

### Notes

* Asynchronous in effect: the call returns immediately after the status changes and
messages have been queued. The actual re-indexing happens later when the full-text indexer
picks up the new message.
* No caller-side deduplication: multiple calls with the same `(ObjectID, Reason)` insert a
new message in `oscpmqueue` each time. The implicit collapse happens only on pickup — see
[Coalescing of redundant messages](std.md).
* The job is intended for internal service contexts (technical user) and performs no
content-level permission check.

### Related Jobs

* [std.GetNextCPMessage](std.md#std.GetNextCPMessage) — picks up the follow-up
messages created by this job (e.g. from the `FULLTEXTDOC` queue)
* [std.GetCPObjectIdxFulltext](std.md#std.GetCPObjectIdxFulltext) — called by the
full-text indexer after the pickup to read the updated full-text content
* [std.DispatchCPMessage](std.md#std.DispatchCPMessage) — acknowledges the follow-up
message after processing
* [std.CreateCPMessages](std.md#std.CreateCPMessages) — more generic variant for
creating CP messages without `osftslog` status update
* [cnv.GetRendition](cnv.md#cnv.GetRendition) — produces a rendition for a document

<a id="std.CalcDocumentDigest"></a>

## std.CalcDocumentDigest

This job stores the hash value and optionally the signature for a given document.
The assurance of the hash value and signature is subject to the server — for using this job please contact Optimal Systems GmbH support.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the selected object |
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `Pwd` | STRING | Yes | Password — if incorrect, no action will be performed. |
| `Sign` | BOOL | Yes | `1` = document will also be signed |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Digest` | STRING | — | Hash value of the files |

### Return Value

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

<a id="std.CheckSource"></a>

## std.CheckSource

This job checks the existence of files in specific directories.
The directory path can be replaced by a path variable.
Example: `%SERVERROOT%\test.txt`

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Must be `0`. |
| `Source` | STRING | Yes | Path and filename of the file to be checked. Selected enaio® standard paths can be replaced by path variables (see below). |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `State` | INT | — | `0` = file does not exist; `1` = file exists |

### Supported Path Variables

| Variable | Description |
|---|---|
| `%SERVERROOT%` | Installation directory of the server (default: `<enaioinstall>/server`) |
| `%ETCPATH%` | ETC directory of the server (default: `<enaioinstall>/server/etc`) |
| `%WORKPATH%` | Parent directory of the WORK directory (default: `<enaioinstall>/server`) |
| `%LOGPATH%` | Directory of server logs (default: `<enaioinstall>/server/log`) |
| `%CLIENTETC%` | Identical to `%ETCPATH%` |

### Return Value

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

<a id="std.CleanUpCache"></a>

## std.CleanUpCache

This job cleans the content of the CACHE.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `[Flags]` | INT | No | Priority (default value `2`): +<br>`0` = files are deleted until minimal cache size is reached +<br>`1` = files are deleted that have been in the cache longer than the maximum days +<br>`2` = combination of `0` and `1`: files are only deleted if they have been in the cache longer than the maximum days, until the minimum cache size is reached +<br>`8` = files are deleted until the minimum document count is reached (see `Low`) |
| `High` | INT | Yes | Maximum cache size in MB; if this value is exceeded, the CACHE is cleaned. |
| `Low` | INT | Yes | Minimum cache size in MB; for `Flags = 8`: minimum document count in thousands. |
| `Days` | INT | Yes | Number of days that documents should be stored in the cache at most. |
| `[ExtendDiagnostic]` | INT | No | `0` = only non-deletable files are logged (default) +<br>`1` = all deleted files are logged |

### Return Value

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

<a id="std.ClearFromCache"></a>

## std.ClearFromCache

This job deletes the specified object from the CACHE.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the object |

### Return Value

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

<a id="std.ConfigVarc"></a>

## std.ConfigVarc

This job configures the parameters of the Virtual Archives.

> **Note:** This job can only be called from the Enterprise Manager.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `SAction` | STRING | Yes | `Get` = deliver VARC parameters +<br>`Set` = set VARC parameters |

### Return Value

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

<a id="std.CreateCPMessages"></a>

## std.CreateCPMessages

This job creates up to three new content/processing messages in the server-side
[`oscpmqueue`](database/server_cluster_and_configuration.md#database.oscpmqueue) for a DMS object: one each for full-text
indexing, filter pre-processing and rendition creation. Which messages are created is
controlled by boolean flags in the call.

Several flags may be set in a single call; for every `true` flag one separate message is
created — same object reference, different `queuename`. If all flags are `false`, the call
has no effect.

The complete lifecycle of a CP message is described under
[Capture and Processing Messages (CP)](std.md).

====
This job is not listed in the official enaio® standard engine overview (`std`).
====

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ObjectID` | INT | Yes | Numeric ID of the DMS object the created messages refer to. Stored as `osid` on each<br>created message. |
| `ObjectType` | INT | Yes | Object type ID of the DMS object. Stored as `ostype` on each created message. |
| `CreateFulltextIdxMessages` | BOOL | Yes | `true` — create a message in the `FULLTEXTIDX` queue (indexing registration). |
| `CreateFulltextFilterMessages` | BOOL | Yes | `true` — create a message in the `FULLTEXTFILTER` queue (filter / pre-processing step). |
| `CreateRenditionMessages` | BOOL | Yes | `true` — create a message in the `RENDITION` queue (creation of the searchable PDF/text<br>rendition). |
| `Flags` | INT | Yes | Reserved; always pass `0`. |

### Return Value

`(INT)`: `0` = job successful, otherwise error code. The `MessageGUID` values of the created
messages are not returned — they only become visible on later pickup through
[std.GetNextCPMessage](std.md#std.GetNextCPMessage).

### Notes

* No caller-side deduplication takes place: every requested message is created, even if an
unreserved message for the same object already exists in the same queue. The implicit
collapse happens only on pickup — see
[Coalescing of redundant messages](std.md).
* The call returns immediately after the messages have been inserted; the actual processing
happens asynchronously through the respective worker services.
* Only the queues `FULLTEXTIDX`, `FULLTEXTFILTER` and `RENDITION` can be addressed directly
through this job. The remaining known queues (`FULLTEXTDOC`, `FULLTEXTLOCATION`,
`FULLTEXTDELETE`, `RENRESET`, `PAGECOUNT`) are filled by other server-internal paths.

### Related Jobs

* [std.GetNextCPMessage](std.md#std.GetNextCPMessage) — worker services pick up the
messages created here
* [std.DispatchCPMessage](std.md#std.DispatchCPMessage) — acknowledges the processing
of a picked-up message
* [std.CPRenditionChanged](std.md#std.CPRenditionChanged) — called by the rendition
service after processing; may itself trigger follow-up messages
* [std.IndexDataChanged](std.md#std.IndexDataChanged) — server-internal trigger after
index data changes with the same effect

<a id="std.DeleteDocument"></a>

## std.DeleteDocument

This job deletes the document files for a document.
The document remains as a document without pages.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the object to be deleted |

### Return Value

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

<a id="std.DeleteDocumentVersion"></a>

## std.DeleteDocumentVersion

This job deletes a specific version of a document and possibly the associated digital signature.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | `0` = deletes only the document version +<br>`1` = deletes the digital signature |
| `OSOBJID` | INT | Yes | ID of the document |
| `OSOBJTYP` | INT | Yes | Type of the document |
| `OSID` | STRING | Yes | Version ID of the document |

### Return Value

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

<a id="std.DeleteObject"></a>

## std.DeleteObject

This job identifies an object (document, register, folder) via the specified parameters and
deletes it — either into the recycle bin (reversible) or permanently (not recoverable). The
job is the central deletion path for DMS objects.

The parameters `dwParentID` and `dwParentType` are only considered for documents. If a
document has multiple entries in the `sdrel` table (multi-location storage) and both
`dwParentID = 0` and `dwParentType = 0`, all locations are removed; with a parent set, only
that one location is removed.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `sDeleteMethod` | STRING | Yes | Deletion method: +<br>`Delete` = object is permanently deleted (without recycle bin), or objects already in the<br>recycle bin are removed permanently +<br>`DeleteWithDocs` = valid for cabinet/register; all contained registers/documents are deleted<br>along with it +<br>`Recycle` = object is moved to the recycle bin (reversible through the restore function) |
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the object to be deleted |
| `dwParentID` | INT | Yes | ID of the parent object. `0` if the object is directly in the root archive, or if all<br>storage locations of a multi-location document are to be affected. |
| `dwParentType` | INT | Yes | Type of the parent object. `0` if `dwParentID = 0`. |
| `[sSpecific]` | STRING | No | `Children` = subobjects are deleted; otherwise empty. |
| `[$$$SwitchContextUserName$$$]` | STRING | No | Generic enaio® mechanism to switch the effective user context for the operation. The<br>supplied user name is used for the permission check and the history entry, even when the<br>connection runs under a technical service user. |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `[sInfo]` | STRING | Optional | Only returned if a register/cabinet to be deleted contains subobjects. |
| `[Clause]` | INT | Optional | Always `1`. |

### Return Value

`(INT)`: `0` = job successful, otherwise error code (e.g. object does not exist, missing
delete permission, foreign-key constraint, object is locked).

### Notes

* **Recoverable with `Recycle`** — an object in the recycle bin can be brought back through
the restore function as long as it has not been permanently deleted (`Delete`).
* **History entry** — every deletion creates an audit entry in
[`osobjhist`](database/audit_and_history.md#database.osobjhist); the `osuser` value there corresponds to the user
switched in via `$$$SwitchContextUserName$$$` (otherwise the connection user). The history
entry survives the permanent deletion of the object.
* **Asynchronous index cleanup** — after a successful deletion, a message is enqueued into
the `FULLTEXTDELETE` queue ([`oscpmqueue`](database/server_cluster_and_configuration.md#database.oscpmqueue)) so the full-text
indexer removes the index entry. Right after this job returns, the object may therefore
still appear briefly in the full-text index until the indexer has processed the message —
see [Capture and Processing Messages (CP)](std.md).
* **Multi-location storage** — `Recycle` with a non-zero `dwParentID`/`dwParentType` removes
only that addressed location; with `dwParentID = 0`, all storage locations of the object
are removed.

### Related Jobs

* [std.RestoreObject](std.md#std.RestoreObject) — restores an object previously
deleted via `Recycle` from the recycle bin
* [std.DeleteDocument](std.md#std.DeleteDocument) — specific variant for plain
document objects; `std.DeleteObject` is the generic path for arbitrary object types
* [std.DeleteDocumentVersion](std.md#std.DeleteDocumentVersion) — deletes a single
document version rather than the whole object
* [dms.XMLDelete](dms.md#dms.XMLDelete) — XML-based delete variant through the generic
XML interface of the DMS engine
* [std.CreateCPMessages](std.md#std.CreateCPMessages) — produces CP messages
(analogous to this job's implicit `FULLTEXTDELETE` enqueue)

<a id="std.DeleteRemark"></a>

## std.DeleteRemark

This job deletes a note attached to a document.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `RemIdent` | INT | Yes | ID of the note |
| `dwObjectType` | INT | Yes | Type of the object |

### Return Value

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

<a id="std.DiskSpace"></a>

## std.DiskSpace

This job determines the free disk space on the drive where the work directory is located, and sends this information by email to the system administrator (defined in the registry).

### Return Value

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

<a id="std.DispatchCPMessage"></a>

## std.DispatchCPMessage

This job reports to the server that a content/processing message previously fetched via [std.GetNextCPMessage](std.md#std.GetNextCPMessage) has been processed (or deliberately rejected) by the service instance.
Depending on `Reason`, the server removes the message from the queue or keeps it available for retry.

The complete lifecycle of a CP message is described under
[Capture and Processing Messages (CP)](std.md).

====
This job is not listed in the official enaio® standard engine overview (`std`).
====

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Reserved; always pass `0`. |
| `MessageGUID` | STRING | Yes | GUID of the previously received message (from [std.GetNextCPMessage](std.md#std.GetNextCPMessage)). |
| `Reason` | STRING | Yes | Processing status / reason, e.g. `OK`, `RETRY` or a specific failure cause. |
| `ServiceName` | STRING | Yes | Name (instance ID) of the reporting content provider instance. |

### Return Value

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

### Related Jobs

* [std.GetNextCPMessage](std.md#std.GetNextCPMessage) — returns the next pending message
* [std.CPRenditionChanged](std.md#std.CPRenditionChanged) — reports that the rendition for an object has been updated
* [std.ResetServiceCPMessages](std.md#std.ResetServiceCPMessages) — discards the processing assignment of a service instance

<a id="std.DoArchive"></a>

## std.DoArchive

This job archives all objects of a specified type that are set to archiveable.
Prerequisite is a correctly configured archiving (media, sets, etc.).

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `dwObjectType` | INT | Yes | Type of objects to be archived |

### Return Value

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

<a id="std.DoPrefetch"></a>

## std.DoPrefetch

This job loads the specified object from a storage medium (e.g., Jukebox) into the cache to reduce access times.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Options for the transfer: +<br>`0` = dia file and object are transferred +<br>`1` = only the object files are transferred +<br>`2` = only the dia file of the object is transferred |
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the object |
| `DocState` | INT | Yes | LOWORD = document state; HIWORD = Read-Write flag. +<br>The job processes only archived documents. |
| `FileCount` | INT | Yes | Number of files (not evaluated) |

### Return Value

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

<a id="std.FileTransfer"></a>

## std.FileTransfer

This job transfers one or more files from a source path to a destination path (`Flags = 0` or `2`), deletes specified files (`Flags = 4`), or returns the digest value of a file (`Flags = 5`).

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Operating mode (see table below) |
| `FileCount` | INT | Yes | Number of passed `File_` parameters |
| `File_[0..n]` | STRING | Yes | Filenames (meaning depends on `Flags`, see table below) |

### Flags Modes

| Flags | Description | File_[0..n] | Input File List |
|---|---|---|---|
| `0` | Files are copied with `CopyFile` | Without input files: alternating destination path+name / source path+name +<br>With input files: only destination path+name | Path and name of source file(s) |
| `2` | Files are copied with `CreateFile`/`ReadFile`/`WriteFile` | Without input files: alternating destination path+name / source path+name +<br>With input files: only destination path+name | Path and name of source file(s) |
| `4` | Files are deleted | `File_0`, `File_1`, … = path+filename of files to be deleted | — |
| `5` | Digest value is calculated | `File_0`, `File_1`, … = path+filename of files | — |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Count` | INT | — | Always `0` (no longer used) |
| `[Digest]` | STRING | Optional | Calculated digest value (only for `Flags = 5`) |

### Return Value

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

<a id="std.FindDocumentDigest"></a>

## std.FindDocumentDigest

This job searches for a document with the same hash value.
Search is performed in the `osdochash` table; only entries without `osguid` (NULL or empty) are considered — versions are not considered.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `Digest` | STRING | Yes | The hash value to search for |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Result` | STRING | — | Document IDs and types of found documents in the format `ID=Typ;ID=Typ;…` (e.g., `11=131072;22=131072`) |

### Return Value

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

<a id="std.GetCPObjectIdxFulltext"></a>

## std.GetCPObjectIdxFulltext

This job returns the indexable content of a DMS object to the full-text indexer. The content
is not returned as a data field but written into a temporary file on the server; the caller
receives the path and transfers the file itself for reading.

The file contains the extracted full text together with the metadata required by the indexer
(object IDs, path information, index field values, mime type) in a format understood by the
full-text backend. The source of the full-text content is the
[`osftcontent`](database/full_text_search.md#database.osftcontent) table.

The typical call context is the follow-up job after
[std.GetNextCPMessage](std.md#std.GetNextCPMessage) and
[std.GetCPObjectInfo](std.md#std.GetCPObjectInfo) in the
[CP lifecycle](std.md).

====
This job is not listed in the official enaio® standard engine overview (`std`).
====

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ObjectID` | INT | Yes | Numeric ID of the DMS object the indexing input shall be produced for. |
| `ObjectType` | INT | Yes | Numeric object type ID. Used to embed the correct index field definitions and path<br>information. Should match the actual object type — if unknown, it can be determined<br>beforehand via [std.GetCPObjectInfo](std.md#std.GetCPObjectInfo). |
| `Flags` | INT | Yes | Reserved; always pass `0`. |

### Output Files

| Name | Description |
|---|---|
| `File list` | Path and name of the temporary indexing file (one file per call, under a per-call freshly<br>generated GUID). The caller is responsible for fetching the file through the regular file<br>transfer layer and releasing it afterwards so the server can clean it up. |

### Return Value

`(INT)`: `0` = job successful, otherwise error code. Even if no full-text content is
currently available for the object in [`osftcontent`](database/full_text_search.md#database.osftcontent), the
call completes successfully — the resulting file then contains only the metadata without a
full-text block. The caller detects this and reacts on the application level (typically:
requests a rendition via [std.CreateCPMessages](std.md#std.CreateCPMessages) with
`CreateRenditionMessages=true` and sets `osftslog.flag2 = 404`, see
[value range `flag2`](database/full_text_search.md#database.osftslog)).

### Notes

* Read-only on the database side — no DB writes. However, a temporary file is created on the
server; a result that is never fetched leaves dead files behind.
* A new file with its own GUID is produced for every call — two successive calls for the
same `ObjectID` return different paths with potentially identical content.
* The job is intended for the full-text indexer service. Other worker services (e.g. the
rendition cache) do not read full-text content through this path.

### Related Jobs

* [std.GetNextCPMessage](std.md#std.GetNextCPMessage) — returns the `ObjectID` that
typically feeds directly into this job (queues `FULLTEXTIDX` and `FULLTEXTDOC`)
* [std.GetCPObjectInfo](std.md#std.GetCPObjectInfo) — usually called immediately
before, to decide via `HasVolltextFile` whether full-text content is available and which
pipeline branch is responsible
* [std.CreateCPMessages](std.md#std.CreateCPMessages) — called by the indexer when the
returned file contains no full-text block, to request a rendition
* [std.DispatchCPMessage](std.md#std.DispatchCPMessage) — acknowledges the underlying
CP message after the indexing is complete
* [std.CPRenditionChanged](std.md#std.CPRenditionChanged) — triggers a re-indexing;
this job is then called again, this time with a populated `osftcontent`

<a id="std.GetCPObjectInfo"></a>

## std.GetCPObjectInfo

This job returns the compact metadata for a DMS object that a worker service of the
content/processing pipeline (full-text indexer, rendition cache, ...) needs in order to
process the object — in particular processing status, mime type, hash, hierarchical path
and whether a full-text content is already available.

The typical call context is the direct follow-up job after a successful
[std.GetNextCPMessage](std.md#std.GetNextCPMessage) pickup; see
[Lifecycle of a message](std.md).

====
This job is not listed in the official enaio® standard engine overview (`std`).
====

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ObjectID` | INT | Yes | Numeric ID of the DMS object whose metadata is requested. |
| `[ObjectType]` | INT | No | Numeric object type ID. If not given, the server resolves the type itself. Passing it when<br>known saves a database lookup. |
| `Flags` | INT | Yes | Controls the level of detail in the output. Typical value: `2` (full metadata including<br>`Hash`, `MimeTypeGroup` and `Pathes`). |
| `[Rights]` | STRING | No | Access rights to check, as a letter combination (e.g. `RWXDU`). Only if this parameter is<br>set does the server perform a permission check against the object and return the effectively<br>granted rights in the output parameter of the same name. Without `Rights`, no check is<br>performed — the call is intended for internal service contexts without a user check. |
| `[OutputUnicode]` | INT | No | `1` — string fields in the output are returned as UTF-16. Default: ANSI. |

### Output Parameters

The server returns only those fields that apply to the given object. For container objects
(portfolios, folders, registers), document-related fields such as `MimeType`, `PageCount`,
`Hash` and `HasVolltextFile` are empty or `0`/`false`.

| Name | Type | Dependency | Description |
|---|---|---|---|
| `[ObjectType]` | INT | Optional | Numeric object type ID. May differ from the input `ObjectType` if, for example, a variant<br>was addressed. |
| `[OriginalObjectType]` | INT | Optional | Original object type ID before any resolution (e.g. variant → main object). |
| `[PageCount]` | INT | Optional | Number of document pages. `0` for non-document objects. |
| `[Rights]` | STRING | When `Rights` was set in the input | Effectively granted rights as a letter combination (same format as input). |
| `[Hash]` | STRING | Optional | SHA-256 hex hash of the document content (64 characters). Suitable for change detection<br>against the last indexed state. |
| `[ForeignID]` | INT | Optional | External reference ID of the object (for third-party-system integrations). `0` if none. |
| `[SystemID]` | INT | Optional | enaio® system ID of the object (relevant in multi-system setups). |
| `[MimeType]` | STRING | Optional | MIME type of the document content (e.g. `application/pdf`, `message/rfc822`,<br>`image/jpeg`). |
| `[MimeTypeID]` | INT | Optional | Numeric MIME type ID. |
| `[MimeTypeGroup]` | STRING | Optional | Coarse classification of the mime type, selecting the responsible converter/rendition<br>pipeline. Known values: `PDF`, `MAIL`, `WORD`, `POWERPOINT`, `IMAGE`. |
| `[Extension]` | STRING | Optional | File extension (e.g. `pdf`). |
| `[Pathes]` | STRING | Optional | Hierarchical path of the object through the folder/register structure as a `/`-separated<br>chain of object IDs with a trailing `;`. Multiple paths (multi-location storage) are<br>separated by `;`. Example: `2408495/2660649/2678228;`. |
| `[ObjectTypePathes]` | STRING | Optional | Same as `Pathes`, but with object type IDs instead of object IDs. Position-wise<br>correspondence with `Pathes`. Example: `33/6488103/262248;`. |
| `[Deleted]` | BOOL | Optional | `true` if the object is marked as deleted. Workers abort processing in this case. |
| `[Recycled]` | BOOL | Optional | `true` if the object was deleted again after a previous restore. |
| `[InactiveVariant]` | BOOL | Optional | `true` if the object is an inactive document variant (not the currently active version). |
| `[HasAnnotations]` | BOOL | Optional | `true` if annotations (notes, markings, stamps) exist on the object. Relevant for<br>rendition: whether annotations need to be burned into the rendition output. |
| `[HasVolltextFile]` | BOOL | Optional | `true` if an extracted full-text content is already available for the object — the indexer<br>can then read it directly from the cache instead of requesting a new rendition. |
| `[ClientCrypted]` | BOOL | Optional | `true` if the object is client-side encrypted. |

### Return Value

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

### Notes

* Pure read operation — repeated calls are idempotent.
* `HasVolltextFile` drives the next step: if `true`, the full-text content can be read
directly via [std.GetCPObjectIdxFulltext](std.md#std.GetCPObjectIdxFulltext); if
`false`, a rendition has to be requested first, e.g. through
[std.CreateCPMessages](std.md#std.CreateCPMessages) with `CreateRenditionMessages=true`.
* `Hash` can be compared against the last processed value to decide whether re-indexing is
actually needed.
* `Pathes` and `ObjectTypePathes` correspond position-wise: every component in `Pathes` has
its matching object type ID at the same position in `ObjectTypePathes`.

### Related Jobs

* [std.GetNextCPMessage](std.md#std.GetNextCPMessage) — returns the `ObjectID` this job
is typically called with right after
* [std.GetCPObjectIdxFulltext](std.md#std.GetCPObjectIdxFulltext) — returns the
extracted full-text content of the object (useful when `HasVolltextFile=true`)
* [std.CreateCPMessages](std.md#std.CreateCPMessages) — requests a missing rendition
(useful when `HasVolltextFile=false`)
* [std.CPRenditionChanged](std.md#std.CPRenditionChanged) — reports that the rendition
for an object has been updated
* [std.GetDocumentDigest](std.md#std.GetDocumentDigest) — returns only the hash;
suitable when only change detection is needed
* [dms.GetObjectDetails](dms.md#dms.GetObjectDetails) — full object query including all
index fields; much more expensive than this job

<a id="std.GetDocStatistics"></a>

## std.GetDocStatistics

This job delivers document information for the specified object.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `dwObjectType` | INT | Yes | Type of the object |
| `dwObjectID` | INT | Yes | ID of the object |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Statistics` | STRING | — | Document information separated by `@` in the following order: +<br>Document timestamp; +<br>Server group number where the document is located; +<br>Medium name (`WORK` is a valid medium name); +<br>Number of documents of the object; +<br>File size in bytes (only when count = 1, DIA not included); +<br>Filename (including path); +<br>Module type number; +<br>Note information (`NOTE` if note exists); +<br>current document state (DocState); +<br>Object type |

### Return Value

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

<a id="std.GetDocStream"></a>

## std.GetDocStream

> **Note:** This job has been replaced by [std.GetDocumentStream](std.md#std.GetDocumentStream).

### Return Value

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

<a id="std.GetDocVariant"></a>

## std.GetDocVariant

This job creates a new variant of the selected document.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `sDocVer` | STRING | Yes | Number of the new variant |
| `bTransferPlannedRetention` | BOOL | Yes | `1` = planned retention time is transferred |
| `dwParentID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the selected object |
| `dwMainType` | INT | Yes | Main type of the new variant |
| `bAddFiles` | INT | Yes | `1` = new files (if sent) are added instead of replacing the old ones |
| `bAddFront` | INT | Yes | `1` = new files are added at the front |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `dwVariantID` | INT | — | ID of the newly created variant |

### Return Value

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

<a id="std.GetDocVersion"></a>

## std.GetDocVersion

This job determines the version of the selected document.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `GUID` | STRING | Yes | GUID of the version. This value corresponds to the `osguid` attribute of a `<Modification>` element from [dms.GetObjectHistory](dms.md#dms.GetObjectHistory). Relevant actions are `VERSION_CREATED` (ID `17`) and `RESTORED_FROM_VERSION` (ID `19`). |
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the selected object |

### Output Files

| Name | Description |
|---|---|
| File list | Path and name of the returned file |

### Return Value

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

<a id="std.GetDocumentDigest"></a>

## std.GetDocumentDigest

This job delivers the digest value of the document files.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the document |
| `[dwFlags]` | INT | No | `0` = digest value is read from DB +<br>`1` = digest value is calculated |
| `[CheckSignature]` | BOOL | No | `1` = signature is also checked; returns `Signature` |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `TableDigest` | STRING | — | Digest value from the DB (for `dwFlags = 0` or `1`) |
| `[LocalDigest]` | STRING | Optional | Calculated digest value (only for `dwFlags = 1`) |
| `[Signature]` | INT | Optional | `0` = signature present and verified +<br>`1` = signature not present +<br>`2` = signature could not be verified due to technical error +<br>`3` = signature present but incorrect |

### Return Value

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

<a id="std.GetDocumentPage"></a>

## std.GetDocumentPage

This job delivers a specified page of a specified document.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `dwObjectID` | INT | Yes | ID of the object |
| `Page` | INT | Yes | Page number of the document |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `nModul` | INT | — | Main type of the document |

### Output Files

| Name | Description |
|---|---|
| File list | Path and name of the transferred file |

### Return Value

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

<a id="std.GetDocumentSlide"></a>

## std.GetDocumentSlide

This job creates a slide for a document and returns it.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ObjectID` | INT | Yes | ID of the object |
| `Flags` | INT | Yes | `0` (`GETDOCSLIDE_FLAG_NEEDEDONLY`) = requested size is returned; if not available, error +<br>`1` (`GETDOCSLIDE_FLAG_DEFAULTALLOWED`) = requested size is returned; if not available, 96×96 is delivered (including `Width`/`Height` output) +<br>`2` (`GETDOCSLIDE_FLAG_BOTH`) = requested size is returned if available, plus always 96×96 +<br>`3` (`GETDOCSLIDE_FLAG_ALL`) = all slides are returned |

### Output Files

| Name | Description |
|---|---|
| File list | Path and name of the transferred file |

### Return Value

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

> **Note:** With `GETDOCSLIDE_FLAG_ALL` and `GETDOCSLIDE_FLAG_BOTH`, multiple files are delivered, with extensions `DIA001`, `DIA002`, etc. +
Related output parameters `DIA001`, `DIA002`, etc. contain the respective size (e.g., `DIA001 = 10x10`, `DIA002 = 96x96`).

<a id="std.GetDocumentStream"></a>

## std.GetDocumentStream

This job reads a file range, creates a new file from it, and returns it.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the object |
| `PageNum` | INT | Yes | Page number to read from |
| `dwOffset` | INT | Yes | Offset in bytes from which to read |
| `dwLength` | INT | Yes | Number of bytes to read |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Count` | INT | — | Number of created files |

### Output Files

| Name | Description |
|---|---|
| File list | Path and name of the created file |
> **Note:** Possible error codes: +
`ERR_WRONGPARAM` = Offset is greater than the file +
`ERR_GETOBJECTDEFPARAM` = Object type unknown +
`ERR_GETPARAMETER` = too few (valid) parameters passed +
`ERR_SQLSELECT` = error in DB queries +
`ERR_NOTDEFINED_YET` = object is on a remote server +
`ERR_INSOURCE` = file cannot be found or opened +
`ERR_INDESTINATION` = destination file cannot be created

### Return Value

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

<a id="std.GetNextCPMessage"></a>

## std.GetNextCPMessage

This job returns the next pending content/processing message from the given queues and
reserves it for the calling service instance. It is called in a polling loop by full-text
indexers, the rendition cache and comparable workers to pull jobs from the server-side
[`oscpmqueue`](database/server_cluster_and_configuration.md#database.oscpmqueue) table.

Selection, locking and coalescing behaviour as well as the complete lifecycle of a CP message
are described under [Capture and Processing Messages (CP)](std.md).

====
This job is not listed in the official enaio® standard engine overview (`std`).
====

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `QueueNames` | STRING | Yes | Name of the queue from which to fetch the next message. A comma-separated list of multiple<br>queue names is permitted; in that case the most recent free message across the listed queues<br>is returned. |
| `ServiceName` | STRING | Yes | Identifier (instance ID) of the calling service instance. On a successful pickup it is<br>stored as `lock_service` on the message and identifies the instance for follow-up operations<br>such as [std.DispatchCPMessage](std.md#std.DispatchCPMessage) and<br>[std.ResetServiceCPMessages](std.md#std.ResetServiceCPMessages). Must be unique per<br>worker instance. |
| `Flags` | INT | Yes | Reserved; always pass `0`. |
| `[OutputUnicode]` | INT | No | `1` — string fields in the output are returned as UTF-16. Default: ANSI. |

### Output Parameters

The fields below are only returned if a message could be reserved. If no free message is
currently available in the requested queues, the job returns just an empty `MessageGUID`;
the remaining fields are then absent.

| Name | Type | Dependency | Description |
|---|---|---|---|
| `MessageGUID` | STRING | — | GUID of the reserved message (hex, 32 characters, no separators). Identifies the message<br>for subsequent calls — in particular the acknowledgement via<br>[std.DispatchCPMessage](std.md#std.DispatchCPMessage). Empty string if no message was<br>available. |
| `[ObjectID]` | INT | Only on a successful pickup | Numeric ID of the DMS object the message refers to. |
| `[ObjectType]` | INT | Only on a successful pickup | Object type ID of the DMS object. |
| `[QueueName]` | STRING | Only on a successful pickup | Actual queue name the message came from — relevant when `QueueNames` was passed as a<br>comma-separated list. |

### Return Value

`(INT)`: `0` = job successful, otherwise error code. An empty `MessageGUID` is also a success
case — it just means there is currently no pending message.

### Related Jobs

* [std.DispatchCPMessage](std.md#std.DispatchCPMessage) — reports the processing of a
picked-up message back to the server (mandatory follow-up after a successful pickup)
* [std.ResetServiceCPMessages](std.md#std.ResetServiceCPMessages) — releases all
reservations held by the own service instance
* [std.GetCPObjectInfo](std.md#std.GetCPObjectInfo) — typical follow-up: returns
metadata for the picked-up object
* [std.GetCPObjectIdxFulltext](std.md#std.GetCPObjectIdxFulltext) — typical follow-up:
returns the extracted full text for the picked-up object
* [std.CPRenditionChanged](std.md#std.CPRenditionChanged) — called by the rendition
service, signals a changed rendition

<a id="std.GetObjectInfo"></a>

## std.GetObjectInfo

This job determines the requested information (status or size) of the selected object.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `dwInfoFlag` | INT | Yes | `0` = object status is determined +<br>`1` = object size is determined |
| `dwObjectType` | INT | Yes | Type of the object |
| `dwObjectID` | INT | Yes | ID of the object |
| `Rights` | STRING | Yes | Permission string (e.g., `RWDXU`) |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `ServerInfo` | STRING | — | Contains the requested information: +<br>For `dwInfoFlag = 0` (Status): `0` = document has no pages; `1` = document is archived; `2` = document is not archived/archivable; `3` = status cannot be determined +<br>For `dwInfoFlag = 1` (Size): `0` = document has no pages; `[N]` = size of document files including DIA in bytes |

### Return Value

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

<a id="std.GetRemark"></a>

## std.GetRemark

This job delivers a note identified by the object type and `RemIdent` (note ID).

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Must be `0`. |
| `RemIdent` | INT | Yes | ID of the note |
| `dwObjectType` | INT | Yes | Type of the object |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `FileCount` | INT | — | Always `1` |

### Output Files

| Name | Description |
|---|---|
| File list | Path and filename of the sought note |

### Return Value

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

<a id="std.GetSignedDocument"></a>

## std.GetSignedDocument

This job delivers a digitally signed document from the server to the client.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OSOBJID` | INT | Yes | ID of the selected object |
| `OSID` | STRING | Yes | ID of the version |
| `OSOBJTYP` | INT | Yes | Type of the selected object |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `nFileCount` | INT | — | Number of files |
| `dwUserID` | INT | — | ID of the user |
| `dwTimeStamp` | INT | — | Creation timestamp |
| `sTrust` | STRING | — | Trust level |
| `sFirstName` | STRING | — | First name of the user |
| `sStation` | STRING | — | Computer name |
| `sName` | STRING | — | Name of the user |
| `sClass` | STRING | — | Object class |

### Return Value

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

<a id="std.GetTemplates"></a>

## std.GetTemplates

This job delivers a list of all templates for the specified object type.
If `dwObjectType` is not passed or passed with the value `-1`, templates for all object types are returned.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `[dwObjectType]` | INT | No | Type of object for which templates should be returned; `-1` = all object types |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `nCount` | INT | — | Number of templates |
| `ObjectType[1…nCount]` | INT | — | Type of the selected object |
| `TemplateId[1…nCount]` | INT | — | Template ID |
| `Aliase[1…nCount]` | STRING | — | Alias name |
| `Editor[1…nCount]` | STRING | — | Editor name |
| `FileName[1…nCount]` | STRING | — | File name |
| `Extension[1…nCount]` | STRING | — | File extension |
| `NameSpace[1…nCount]` | STRING | — | Engine name |

### Return Value

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

<a id="std.IndexDataChanged"></a>

## std.IndexDataChanged

This job informs the index server that the index data of an object has changed.

====
The job does not change the index data itself — it was already written by the preceding job (e.g. [dms.XMLInsert](dms.md#dms.XMLInsert) or [dms.XMLUpdate](dms.md#dms.XMLUpdate)). Therefore, both the `KernelBeforeJob` and the `KernelAfterJob` server event (see server events) are triggered for this job only **after** the actual metadata change.

The changed metadata is **not** passed to the job as a parameter (see the input parameters — only `Action`, `dwObjectID`, `dwObjectType`, etc.). A server-event script that wants to react to the change must therefore load the current metadata itself.
====

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | `1` = the `osowner` field in the DB table `objectXXX` is changed; +<br>otherwise `osowner` is not modified. |
| `Action` | INT | Yes | Action performed on the object (see action IDs below) |
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the object |
| `Info` | STRING | Yes | Information written to the DB table `osobjhist` |
| `GUID` | STRING | Yes | Unique key for the DB table `osobjhist` |

### Action IDs

| ID | Description | ID | Description |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Electronic signature | 28 | Object restored | 2 | Object created | 29 | Object permanently deleted | 3 | Index data changed | 30 | Acknowledgment confirmed | 4 | Document changed | 31 | Object info | 5 | Document archived | 32 | Object owner changed | 6 | Document deleted | 33 | Variant activated | 7 | Document issued | 34 | Variant deactivated | 8 | Document status changed | 35 | Variant deleted | 9 | Document status changed | 36 | Variant created | 10 | Document created | 37 | Typeless object assigned type | 11 | Link via notes | 38 | Document moved from archive | 12 | Link dissolved | 39 | Reference copy created | 13 | SQL query | 40 | User info | 14 | SQL command | 41 | Retention time set | 15 | Electronic signature | 42 | Document dearchived | 16 | Signed document deleted | 43 | Document type changed | 17 | Version created | 44 | Preview annotation created | 18 | Version deleted | 45 | Preview annotation changed | 19 | Restored from version | 46 | Preview annotation deleted | 20 | Full-text request | 47 | Acknowledgment confirmed by password | 21 | Document moved | 48 | Release created | 22 | Register moved | 49 | Release changed | 23 | Folder merged | 50 | Release deleted | 24 | Folder merged | 51 | Created from copy | 25 | Register merged | 52 | Removed from location | 26 | Register merged | 53 | Status 'active variant' changed | 27 | Object marked for deletion | 54 | Additional variant created |

### Common Actions (Example)

In practice, only a small subset of the actions listed above occurs for this job. The following values were actually observed in a production environment, together with the job that typically triggers them:

| Action | Meaning | Triggering job |
|---|---|---|
| 3 | Index data changed | [dms.XMLUpdate](dms.md#dms.XMLUpdate) |
| 2 | Object created | [dms.XMLInsert](dms.md#dms.XMLInsert) |
| 9 | Document status changed | Status change when storing/writing a document back ([std.StoreInWork](std.md#std.StoreInWork), [std.StoreInCacheByID](std.md#std.StoreInCacheByID), etc.) |
| 7 | Document issued | Requesting a document for editing ([std.StoreInCache](std.md#std.StoreInCache) with a writing `DocState`) |

### Return Value

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

<a id="std.MergeDocuments"></a>

## std.MergeDocuments

This job adds the document pages of a specified object to another target object.
The document type of both objects should be the same.
The source object loses its document pages after this action.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `dwObjectID1` | INT | Yes | ID of the target object |
| `dwObjectType1` | INT | Yes | Type of the target object |
| `PageCount1` | INT | Yes | Page count of the target object |
| `dwObjectID2` | INT | Yes | ID of the object to be appended |
| `dwObjectType2` | INT | Yes | Type of the object to be appended |
| `PageCount2` | INT | Yes | Page count of the object to be appended |

### Return Value

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

<a id="std.MergeFolder"></a>

## std.MergeFolder

This job combines two folders within the database by moving all documents and registers from the source folder to the target folder.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | `1` = source folder is deleted after merging; `0` = source folder is retained |
| `dwObjectType` | INT | Yes | Type of objects |
| `FolderDest` | INT | Yes | ID of the target folder |
| `FolderSource` | INT | Yes | ID of the source folder |

### Return Value

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

<a id="std.MoveToCache"></a>

## std.MoveToCache

This job transfers the specified object from one server group to another.
The object can only be opened by the client for reading.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the object |

### Return Value

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

<a id="std.ObjectTransfer"></a>

## std.ObjectTransfer

This job transfers an object from a foreign (non-local) work directory to the local work or cache directory, or writes the complete local work directory to the local cache directory, or deletes the local work directory.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `sAction` | STRING | Yes | Action to be performed: +<br>`FromForeignWorkToLocalWork` = transfer object from foreign work directory to local work directory +<br>`FromForeignWorkToLocalCache` = transfer object from foreign work directory to local cache directory +<br>`MoveLocalWorkToLocalCache` = write complete local work directory to local cache directory +<br>`DeleteLocalWork` = delete local work directory |
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the selected object |

### Return Value

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

<a id="std.PackDirectory"></a>

## std.PackDirectory

This job packs the contents of the full-text directory into a CAB file and sends it to the recipient server.
The recipient server unpacks the CAB file and adds all full-text index files to its full-text directory.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `dwPort` | INT | Yes | IP port of the recipient server |
| `sComString` | STRING | Yes | IP address of the recipient server in the format `addr1#port1;addr2#port2;…` +<br>`addr` corresponds to the `ComString` column from the `Server` table. |
| `sAction` | STRING | Yes | `Pack` = pack contents of the full-text directory into a CAB file +<br>`Send` = send CAB file +<br>`DeleteSource` = delete contents of the full-text directory |
| `sRoot` | STRING | Yes | Directory from which subdirectories and files should be packed |
| `dwCabSize` | INT | Yes | Maximum size of the CAB file in KB |
| `sCabDir` | STRING | Yes | Directory where the CAB files should be saved |
| `sAddress` | STRING | Yes | String listing all servers in the target group (format like AS.ini file) |

### Return Value

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

<a id="std.ProcessSlideCPMessages"></a>

## std.ProcessSlideCPMessages

This job drains the `SLIDE` queue in [`oscpmqueue`](database/server_cluster_and_configuration.md#database.oscpmqueue) in a single
call. A SLIDE message indicates that a slide representation (per-page preview / display
images) for a DMS object needs to be produced or rebuilt. The job iterates over every SLIDE
message currently available, produces the slides through the rendition/converter pipeline
and removes the message from the queue after successful processing.

Unlike the pull-based single pickup via
[std.GetNextCPMessage](std.md#std.GetNextCPMessage), this is a **batch processor**: one
call processes as many messages as are currently available in the SLIDE queue and only
returns afterwards.

The job is primarily designed as a server-internal scheduler job and is invoked
automatically at regular intervals. An explicit external API call is possible but not
required in normal operation.

Selection, locking and coalescing behaviour are described under
[Capture and Processing Messages (CP)](std.md).

====
This job is not listed in the official enaio® standard engine overview (`std`).
====

### Input Parameters

The job takes no content input parameters. It drains the SLIDE queue completely and without
filtering.

### Output Parameters

The job returns three positional integer counters describing the batch run statistics:

| Position | Meaning |
|---|---|
| 1 | Number of SLIDE messages found in `oscpmqueue`. |
| 2 | Number of messages processed successfully. |
| 3 | Number of messages whose processing failed. |

### Return Value

`(INT)`: `0` = batch run completed successfully, otherwise error code. Errors processing
individual messages are not reported through the return value but through the third counter
— `return_code != 0` indicates a hard failure of the batch run itself (e.g. database
connection lost).

### Notes

* **Reentrant** — the job may run concurrently on multiple server threads. Locking happens
per message via `oscpmqueue.lock_service` (see
[Selection and locking behaviour](std.md)); two parallel runs
automatically pick disjoint message sets.
* **Fast path on empty queue** — if no SLIDE messages are available, the job returns
immediately with all counters at `0`.
* **Messages that fail to process** — if processing of a message fails, the message stays in
the queue with `lock_service` set and can be released for another run via
[std.ResetServiceCPMessages](std.md#std.ResetServiceCPMessages).
* **Follow-up notification** — after successful slide creation, per object
[std.CPRenditionChanged](std.md#std.CPRenditionChanged) with `Reason=SLIDE` may be
raised to inform downstream components about the new representation.

### Related Jobs

* [std.GetNextCPMessage](std.md#std.GetNextCPMessage) — pull-based single pickup for
other queues (`FULLTEXTIDX`, `RENDITION`, ...); the SLIDE queue is intentionally not
consumed this way but processed in batch on the server side
* [std.CreateCPMessages](std.md#std.CreateCPMessages) — entry point for creating CP
messages (`FULLTEXTIDX`, `FULLTEXTFILTER`, `RENDITION`); SLIDE messages are inserted through
other server-internal paths
* [std.CPRenditionChanged](std.md#std.CPRenditionChanged) — typical follow-up
notification after successful slide creation
* [std.DispatchCPMessage](std.md#std.DispatchCPMessage) — generic cleanup path for a
processed CP message; not used by the batch processor since the SLIDE message is removed
within the job itself
* [std.ResetServiceCPMessages](std.md#std.ResetServiceCPMessages) — releases
reservations left behind by aborted workers

<a id="std.ResetServiceCPMessages"></a>

## std.ResetServiceCPMessages

This job discards the server-side processing assignment of all content provider messages for a service instance.
It is typically called at the start of a CP service instance to return messages stuck from a previous run back to the queue.

====
This job is not listed in the official enaio® standard engine overview (`std`). This description was reconstructed from the call code of the enaio® gateway (`dms-enaio` library).
====

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Reserved; always pass `0`. |
| `ServiceName` | STRING | Yes | Name (instance ID) of the content provider instance whose messages are to be reset. |

### Return Value

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

### See Also

* [std.GetNextCPMessage](std.md#std.GetNextCPMessage) — returns the next pending message
* [std.DispatchCPMessage](std.md#std.DispatchCPMessage) — reports the processing of a message

<a id="std.RestoreDocVersion"></a>

## std.RestoreDocVersion

This job restores a document version as the current document.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `GUID` | STRING | Yes | ID of the version to be restored |
| `OSSTATION` | STRING | Yes | Computer name of the calling client |
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the object |
| `dwUserId` | INT | Yes | User ID |

### Return Value

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

<a id="std.RestoreObject"></a>

## std.RestoreObject

This job restores an object from the trash bin.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `sRestoreMethod` | STRING | Yes | Restoration method: +<br>`SingleRestore` = restore only the specified object +<br>`RestoreAllEntity` = restore subobjects of the specified object |
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the object |
| `dwParentID` | INT | Yes | ID of the target object to restore into |
| `dwParentType` | INT | Yes | Type of the target object |

### Return Value

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

<a id="std.SetActiveVariant"></a>

## std.SetActiveVariant

This job activates a variant.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `dwPrevActVarID` | INT | Yes | ID of the currently active variant |
| `dwNextActVarID` | INT | Yes | ID of the variant to be activated |
| `dwObjectType` | INT | Yes | Type of the selected object |

### Return Value

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

<a id="std.SetHistory"></a>

## std.SetHistory

This job adds an entry to the DB table `osobjhist` for the specified object.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `sInfo` | STRING | Yes | Information about the performed action |
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the object |

### Behavior

* The server creates a history entry of type **`OBJECT_INFORMATION`** (action ID `31`).
* `UserNameShort`, `UserNameFull`, `Station` and `Time` are automatically populated by the server based on the current session.
* The entry can subsequently be retrieved via [dms.GetObjectHistory](dms.md#dms.GetObjectHistory).
* Works for all object types (folders, registers, documents).

#### Example Entry in the History

After the call, the `DMSHistory` XML contains an entry like:

```xml
<Modification osguid="...">
  <Time>09.04.2026 10:50:00</Time>
  <Action id="31">Object information</Action>
  <Description>Log entry from the business model.</Description>
  <UserNameShort>ROOT</UserNameShort>
  <UserNameFull>Administrator</UserNameFull>
  <Station station_id="...">ECM4</Station>
  <Info>Custom log entry</Info>
</Modification>
```

### Return Value

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

<a id="std.SetPlannedRetention"></a>

## std.SetPlannedRetention

This job sets the planned retention time for a document.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Currently not supported — pass `0`. |
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the object |
| `sRetentionDate` | STRING | Yes | Planned retention time in `DD.MM.YYYY` format |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `sRetentionDate` | STRING | — | Set retention time in `DD.MM.YYYY` format |

### Return Value

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

<a id="std.StoreInCache"></a>

## std.StoreInCache

This job sends the specified document files to a enaio® client.
If the client still has the document in the cache, it can calculate and pass the digest value.
The server compares its own digest value with that of the client — if they are identical, the document is not transmitted again.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Options for the transfer: +<br>`0` = dia file and object are transferred +<br>`1` = only the object pages are transferred +<br>`2` = only the dia file of the object is transferred |
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the selected document |
| `DocState` | INT | Yes | Indicates whether the document should be opened for reading or writing: +<br>`HIWORD = 0` = document is opened for writing +<br>`HIWORD = 1` = document is opened for reading |
| `FileCount` | INT | Yes | Number of files (not evaluated) |
| `[Digest]` | STRING | No | Digest value calculated by the client for the requested document |
| `[IncludeDeleted]` | BOOL | No | `1` = documents in the trash bin are also considered |
| `[IgnoreHashCheck]` | BOOL | No | `1` = hash value/signature check is disabled, even if enabled in the registry |
| `[AddAnnotations]` | BOOL | No | `1` = annotations are burned into the image files |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `FileCount` | INT | — | Number of files transferred to the cache |

### Return Value

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

<a id="std.StoreInCacheByID"></a>

## std.StoreInCacheByID

This job sends the specified document files to a enaio® client.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Options for the transfer: +<br>`0` = dia file for the object is transferred +<br>`1` = only the object files are transferred +<br>`2` = only the dia file of the object is transferred |
| `dwObjectID` | INT | Yes | ID of the object |
| `[Convert]` | INT | No | `0` = no conversion +<br>`1` = documents with main types 1, 2, 3, or 4 are converted to PDF +<br>`8` = TIFF documents with main types 2 or 3 are combined into a multipage TIFF |
| `[WhenCOLDThenTIFF]` | INT | No | `1` = ASCII cold files are returned in TIFF format (only when `Convert = 0`) |
| `[AddAnnotations]` | BOOL | No | `1` = annotations are burned into the image files |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `FileCount` | INT | — | Number of files transferred to the cache |

### Output Files

| Name | Description |
|---|---|
| File list | Path and name of the files transferred to the cache |

### Return Value

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

<a id="std.StoreInCacheDirect"></a>

## std.StoreInCacheDirect

This job delivers a specified document via its ID.
It can be used when enaio® server and enaio® client run on the same computer.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Options for the transfer: +<br>`0` = dia file for the object is transferred +<br>`1` = only the object files are transferred +<br>`2` = only the dia file of the object is transferred |
| `dwObjectID` | INT | Yes | ID of the object |
| `Path` | STRING | Yes | Path to which the object files are written |
| `[AddAnnotations]` | BOOL | No | `1` = annotations are burned into the image files |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `FileCount` | INT | — | Number of files transferred to the cache |
| `File_N` | STRING | — | Name of the N-th source file |

### Return Value

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

<a id="std.StoreInWork"></a>

## std.StoreInWork

This job copies all specified documents to the work directory (derived from object type and object ID).
If files with the specified object ID already exist there, they must first be deleted.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | `0` = existing files are deleted +<br>`1 & Flags` = existing files are not deleted (for `StoreInWorkDirect`) +<br>`2 & Flags` = no hard links for files are created (for variant management) |
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Type of the object |
| `FileCount` | INT | Yes | Number of files |
| `bAddFiles` | INT | Yes | `1` = new files are added instead of replacing the old ones |
| `bAddFront` | INT | Yes | `1` = new files are added at the front |
| `[DocFlagsNeeded]` | INT | No | If present, the `Flags` column in the object table is set to this value. |

### Input Files

| Name | Description |
|---|---|
| File list | Name and path of the files to be written to the work directory |

### Return Value

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

<a id="std.StoreRemark"></a>

## std.StoreRemark

This job stores a note in a directory within the NOTE directory identified by the object type.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `RemIdent` | INT | Yes | ID of the note |
| `dwObjectType` | INT | Yes | Type of the object — determines the subdirectory in the NOTE directory |

### Input Files

| Name | Description |
|---|---|
| File list | Path and name of the note file (TXT) to be stored |

### Return Value

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

<a id="std.StoreSignedDocument"></a>

## std.StoreSignedDocument

This job stores a signed document on the server.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OSFIRSTNAME` | STRING | Yes | First name of the user |
| `OSNAME` | STRING | Yes | Name of the user |
| `OSOBJCLASS` | STRING | Yes | Object class |
| `OSSTATION` | STRING | Yes | Workstation |
| `OSTRUST` | STRING | Yes | Trust level |
| `OSOBJID` | INT | Yes | ID of the selected object |
| `OSTIMESTAMP` | INT | Yes | Timestamp |
| `OSOBJTYP` | INT | Yes | Type of the selected object |
| `OSUSERID` | INT | Yes | ID of the user |

### Input Files

| Name | Description |
|---|---|
| OSSIGNATUR-file | File with the signature content (deleted after saving) |
| OSSIGHEADER-file | File with the signature header content (deleted after saving) |
| OSSIGTEXT-file | File with the signature text content (deleted after saving) |
| File to store | The document file to be stored |

### Return Value

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

<a id="std.TransformIndexData"></a>

## std.TransformIndexData

This job exports the full-text index data according to its parameters.
It is usually called from `axacwexp.dll`.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `dwObjectType` | INT | Yes | Object type |
| `sAction` | STRING | Yes | `DeleteIndex` = full-text index data is deleted +<br>`NewIndex` = new full-text index data is inserted +<br>`UpdateIndex` = like `NewIndex`, but additionally the `<UPDATE>` field is inserted |
| `bIgnoreFieldSpecific` | BOOL | Yes | `0` = full-text properties are considered for each field +<br>`1` = full-text properties are ignored for each field |
| `[dwObjectID]` | INT | No | ID of the object. If `0` or not present, all objects with `dwObjectType` are considered. |
| `[bWriteFiles]` | BOOL | No | `0` = only index data (without document files) is exported (default) +<br>`1` = document files are exported with full-text |
| `[iAction]` | INT | No | Action to be performed (see action IDs in [std.IndexDataChanged](std.md#std.IndexDataChanged)) |

### Return Value

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

<a id="std.UndoArchive"></a>

## std.UndoArchive

This job restores the specified document from the Jukebox to the work directory.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | `0` = document gets status "not archivable" +<br>`1` = document gets status "archivable" |
| `dwObjectType` | INT | Yes | Type of the object to be dearchived |
| `dwObjectID` | INT | Yes | ID of the object |

### Return Value

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

<a id="std.Unknown2Known"></a>

## std.Unknown2Known

This job converts a document without type to a document with the passed type.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | `LOWORD(Flags) = 1`: +<br>– `HIWORD(Flags) = 0` → original module number is determined from `HIWORD(dwObjectType)` +<br>– `HIWORD(Flags) ≠ 0` → original module number is determined from `HIWORD(Flags)` |
| `dwObjectID` | INT | Yes | ID of the object |
| `dwObjectType` | INT | Yes | Object type to which the document should be converted |

### Return Value

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

<a id="std.ZipDocument"></a>

## std.ZipDocument

This job compresses one or more files.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `bDeleteSource` | INT | Yes | `1` = source files are deleted after compression; `0` = source files are retained |

### Input Files

| Name | Description |
|---|---|
| File list | Name and path of the file(s) to be compressed |

### Return Value

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