# Workflow Engine (Engine `wfm`)

Here jobs for processing and managing workflow processes and models are provided.

The user specified in the parameters is the user as a person in the workflow organization, unless explicitly specified as a DMS user.

## Organization Structure

* [wfm.ConfigUserAbsence](wfm.md#wfm.ConfigUserAbsence)
* [wfm.DeleteOrganisation](wfm.md#wfm.DeleteOrganisation)
* [wfm.GetAbsentUsers](wfm.md#wfm.GetAbsentUsers)
* [wfm.GetOrganisationClasses](wfm.md#wfm.GetOrganisationClasses)
* [wfm.GetOrganisationObjects](wfm.md#wfm.GetOrganisationObjects)
* [wfm.GetOrganisations](wfm.md#wfm.GetOrganisations)
* [wfm.GetSubstitutes](wfm.md#wfm.GetSubstitutes)
* [wfm.GetUserSubstitutes](wfm.md#wfm.GetUserSubstitutes)
* [wfm.SaveOrganisation](wfm.md#wfm.SaveOrganisation)
* [wfm.SetActiveOrganisation](wfm.md#wfm.SetActiveOrganisation)
* [wfm.SetSubstitutes](wfm.md#wfm.SetSubstitutes)

## Workflow Model

* [wfm.ChangeWorkflowState](wfm.md#wfm.ChangeWorkflowState)
* [wfm.CopyWorkflow](wfm.md#wfm.CopyWorkflow)
* [wfm.DeleteWorkflow](wfm.md#wfm.DeleteWorkflow)
* [wfm.GetWorkflow](wfm.md#wfm.GetWorkflow)
* [wfm.GetWorkflowData](wfm.md#wfm.GetWorkflowData)
* [wfm.GetWorkflowInfo](wfm.md#wfm.GetWorkflowInfo)
* [wfm.GetWorkflowList](wfm.md#wfm.GetWorkflowList)
* [wfm.GetWorkflowListByFamily](wfm.md#wfm.GetWorkflowListByFamily)
* [wfm.StoreWorkflow](wfm.md#wfm.StoreWorkflow)
* [wfm.ValidateWorkflow](wfm.md#wfm.ValidateWorkflow)

## Workflow Process and Activity

* [wfm.CancelWorkItem](wfm.md#wfm.CancelWorkItem)
* [wfm.CompleteWorkItem](wfm.md#wfm.CompleteWorkItem)
* [wfm.CreateProcessInstance](wfm.md#wfm.CreateProcessInstance)
* [wfm.GetActivityPerformers](wfm.md#wfm.GetActivityPerformers)
* [wfm.GetProcessFile](wfm.md#wfm.GetProcessFile)
* [wfm.GetProcessList](wfm.md#wfm.GetProcessList)
* [wfm.GetProcessListByObject](wfm.md#wfm.GetProcessListByObject)
* [wfm.GetProcessProtocol](wfm.md#wfm.GetProcessProtocol)
* [wfm.GetProcessResponsibles](wfm.md#wfm.GetProcessResponsibles)
* [wfm.GetRunningActivities](wfm.md#wfm.GetRunningActivities)
* [wfm.GetWorkItem](wfm.md#wfm.GetWorkItem)
* [wfm.GetWorkItemList](wfm.md#wfm.GetWorkItemList)
* [wfm.GetWorkItemParams](wfm.md#wfm.GetWorkItemParams)
* [wfm.SetActivityPerformers](wfm.md#wfm.SetActivityPerformers)
* [wfm.SetProcessResponsibles](wfm.md#wfm.SetProcessResponsibles)
* [wfm.StartProcess](wfm.md#wfm.StartProcess)
* [wfm.StartWorkItem](wfm.md#wfm.StartWorkItem)

## Workflow Mask, Event and Script

* [wfm.DeleteEvent](wfm.md#wfm.DeleteEvent)
* [wfm.DeleteMasks](wfm.md#wfm.DeleteMasks)
* [wfm.DeleteScript](wfm.md#wfm.DeleteScript)
* [wfm.GetEvents](wfm.md#wfm.GetEvents)
* [wfm.GetEventtypes](wfm.md#wfm.GetEventtypes)
* [wfm.GetGlobalScripts](wfm.md#wfm.GetGlobalScripts)
* [wfm.LoadMasks](wfm.md#wfm.LoadMasks)
* [wfm.LoadScript](wfm.md#wfm.LoadScript)
* [wfm.SaveEvent](wfm.md#wfm.SaveEvent)
* [wfm.SaveMasks](wfm.md#wfm.SaveMasks)
* [wfm.SaveScript](wfm.md#wfm.SaveScript)
* [wfm.SetEventScriptRelation](wfm.md#wfm.SetEventScriptRelation)

## Administration

* [wfm.AdminDeleteProcesses](wfm.md#wfm.AdminDeleteProcesses)
* [wfm.AdminDeleteStatisticReportConfigs](wfm.md#wfm.AdminDeleteStatisticReportConfigs)
* [wfm.AdminDeleteStatisticReports](wfm.md#wfm.AdminDeleteStatisticReports)
* [wfm.AdminGetActivityVariables](wfm.md#wfm.AdminGetActivityVariables)
* [wfm.AdminGetLockInfo](wfm.md#wfm.AdminGetLockInfo)
* [wfm.AdminGetProcessActivities](wfm.md#wfm.AdminGetProcessActivities)
* [wfm.AdminGetProcessList](wfm.md#wfm.AdminGetProcessList)
* [wfm.AdminGetProcessListByRole](wfm.md#wfm.AdminGetProcessListByRole)
* [wfm.AdminGetProcessListByUser](wfm.md#wfm.AdminGetProcessListByUser)
* [wfm.AdminGetProcessLocks](wfm.md#wfm.AdminGetProcessLocks)
* [wfm.AdminGetProcessReport](wfm.md#wfm.AdminGetProcessReport)
* [wfm.AdminGetRoleProcesses](wfm.md#wfm.AdminGetRoleProcesses)
* [wfm.AdminGetStatisticReportConfigs](wfm.md#wfm.AdminGetStatisticReportConfigs)
* [wfm.AdminGetStatisticReportData](wfm.md#wfm.AdminGetStatisticReportData)
* [wfm.AdminGetStatisticReports](wfm.md#wfm.AdminGetStatisticReports)
* [wfm.AdminGetUserProcesses](wfm.md#wfm.AdminGetUserProcesses)
* [wfm.AdminGetWorkerqueue](wfm.md#wfm.AdminGetWorkerqueue)
* [wfm.AdminGetWorkflowList](wfm.md#wfm.AdminGetWorkflowList)
* [wfm.AdminReleaseLock](wfm.md#wfm.AdminReleaseLock)
* [wfm.AdminRequestStatisticReport](wfm.md#wfm.AdminRequestStatisticReport)
* [wfm.AdminResumeActivity](wfm.md#wfm.AdminResumeActivity)
* [wfm.AdminResumeProcess](wfm.md#wfm.AdminResumeProcess)
* [wfm.AdminRollbackProcess](wfm.md#wfm.AdminRollbackProcess)
* [wfm.AdminSaveActivityVariables](wfm.md#wfm.AdminSaveActivityVariables)
* [wfm.AdminSaveReportConfig](wfm.md#wfm.AdminSaveReportConfig)
* [wfm.AdminSuspendActivity](wfm.md#wfm.AdminSuspendActivity)
* [wfm.AdminSuspendProcess](wfm.md#wfm.AdminSuspendProcess)
* [wfm.AdminTerminateActivity](wfm.md#wfm.AdminTerminateActivity)
* [wfm.AdminTerminateProcess](wfm.md#wfm.AdminTerminateProcess)

## History Management

* [wfm.GetHistActivitiesByProcess](wfm.md#wfm.GetHistActivitiesByProcess)
* [wfm.GetHistEntries](wfm.md#wfm.GetHistEntries)
* [wfm.GetHistProcessList](wfm.md#wfm.GetHistProcessList)
* [wfm.GetHistTimerEntries](wfm.md#wfm.GetHistTimerEntries)
* [wfm.GetHistTimersByProcess](wfm.md#wfm.GetHistTimersByProcess)
* [wfm.GetHistVariablesByHistEntry](wfm.md#wfm.GetHistVariablesByHistEntry)
* [wfm.GetHistWorkflowList](wfm.md#wfm.GetHistWorkflowList)
* [wfm.GetHistWorkItemRelActivitiesByProcess](wfm.md#wfm.GetHistWorkItemRelActivitiesByProcess)
* [wfm.GetHistWorkItemRelEntriesByActivity](wfm.md#wfm.GetHistWorkItemRelEntriesByActivity)
* [wfm.GetHistWorkItemRelEntriesByUser](wfm.md#wfm.GetHistWorkItemRelEntriesByUser)
* [wfm.GetHistWorkItemRelUsersByProcess](wfm.md#wfm.GetHistWorkItemRelUsersByProcess)

## Other Jobs

* [wfm.AdhocConfigTemplate](wfm.md#wfm.AdhocConfigTemplate)
* [wfm.AdhocGetTemplateList](wfm.md#wfm.AdhocGetTemplateList)
* [wfm.ConvertExportFile](wfm.md#wfm.ConvertExportFile)
* [wfm.DeleteSysClienttypes](wfm.md#wfm.DeleteSysClienttypes)
* [wfm.Export](wfm.md#wfm.Export)
* [wfm.GetProjectList](wfm.md#wfm.GetProjectList)
* [wfm.GetSysClienttypes](wfm.md#wfm.GetSysClienttypes)
* [wfm.GetVersionInfo](wfm.md#wfm.GetVersionInfo)
* [wfm.GetWFMInfo](wfm.md#wfm.GetWFMInfo)
* [wfm.Import](wfm.md#wfm.Import)
* [wfm.InsertSysClienttypes](wfm.md#wfm.InsertSysClienttypes)

## Server Internal Jobs

> **Note:** The jobs listed here are server internal and are generally not called from outside.

* [wfm.CheckJob](wfm.md#wfm.CheckJob)
* [wfm.DBCommands](wfm.md#wfm.DBCommands)
* [wfm.ServerNotifyClients](wfm.md#wfm.ServerNotifyClients)
* [wfm.ServerUpdateWorkflowModels](wfm.md#wfm.ServerUpdateWorkflowModels)
* [wfm.ServerUserAbsent](wfm.md#wfm.ServerUserAbsent)
* [wfm.WorkerJob](wfm.md#wfm.WorkerJob)
* [wfm.WorkItemNoti](wfm.md#wfm.WorkItemNoti)

## Undocumented Endpoints

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

Adhoc templates::
`wfm.AdhocCheckTemplate`

Statistics reports::
`wfm.AdminGetProcessCount`, `wfm.AdminSaveStatisticReportConfig`

History::
`wfm.GetHistProcessCount`

Asynchronous variants::
`wfm.GetRunningActivitiesAsync`, `wfm.GetWorkItemListAsync`, `wfm.StartProcessEx`

Server notifications::
`wfm.ServerActiveOrganisationChanged`, `wfm.ServerGetWorkItemList`, `wfm.ServerOrganisationSaved`, `wfm.ServerSubstitutesChanged`

Other::
`wfm.CreateProcessXML`, `wfm.GetProcessRoles`, `wfm.Test`

<a id="wfm.AdhocConfigTemplate"></a>

## wfm.AdhocConfigTemplate

With this job, ad hoc templates in the workflow can be configured.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `UserId` | STRING | Yes | ID of the user |
| `OrgId` | STRING | Yes | ID of the organization |
| `Action` | INT | Yes | Action to be performed: |
| `[TemplateId]` | STRING | No | ID of the template. For action 1: empty when saving the template for the first time. For actions 2, 3 and 4: ID of the template to be edited. |
| `[TemplateName]` | STRING | No | Name of the template (only for action 1) |
| `[Public]` | INT | No | `0` = private template, `1` = public template (only for action 1) |
| `[Template]` | BASE64 | No | Template content in XML format (only for action 1, see example) |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `[TemplateId]` | STRING | Optional | ID of the saved template (only for action 1). No return parameter for actions 2, 3 and 4. |

### Return Value

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

### Example

Structure of `Template` (input parameter for action 1):

```xml
<RoutingList Id="3294B433BFF6454D9C861B86B5A8AD5D"
             ActivityId="3294B433BFF6454D9C861B86B5A8AD5D" Expandable="1">
  <Entries>
    <Entry Nr="203" Expandable="1">
      <Item Id="99825B18A8334987935684FDA3D6A40D"
            ActivityId="6EE4490A48164A0FA6DC34A80099AF66"
            ActivityName="Create invoice"
            ModelActivityName="Create invoice"
            TimerId="" TimerDuration="" TimerDurationType=""
            Changeable="1" Deleteable="0">
        <ObjectIds></ObjectIds>
      </Item>
    </Entry>
    <Entry Nr="253" Expandable="1">
      <Item Id="E15594D692C14FDA9AFDE8FA0A43F6E4"
            ActivityId="6EE4490A48164A0FA6DC34A80099AF67"
            ActivityName="Approve invoice BL"
            ModelActivityName="Approve invoice"
            TimerId="" TimerDuration="" TimerDurationType=""
            Changeable="1" Deleteable="0">
        <ObjectIds></ObjectIds>
      </Item>
      <Item Id="C6DA9503CD874D69A9B703D0E06A52E8"
            ActivityId="6EE4490A48164A0FA6DC34A80099AF67"
            ActivityName="Approve invoice GF"
            ModelActivityName="Approve invoice"
            TimerId="" TimerDuration="" TimerDurationType=""
            Changeable="1" Deleteable="0">
        <ObjectIds></ObjectIds>
      </Item>
    </Entry>
  </Entries>
</RoutingList>
```
Detailed description of `RoutingList`:

* `RoutingList`: Routing list with the following structure (or subsets thereof)

** `Id` (STRING): ID of the routing list. This value is set by the server and must not be changed.
** `ActivityId` (STRING): Activity ID
** `Expandable` (INT): `0` = routing list cannot be expanded, `1` = routing list can be expanded

* `Entries`: Groups entries of the routing list. An entry consists of multiple elements that can be executed in parallel.

* `Entry`: Describes an entry in the routing list.

** `Nr` (INT): Used for relative sorting of entries within the routing list. Absolute values have no meaning for the client.
** `Expandable` (INT): `0` = entry cannot be expanded, `1` = entry can be expanded

* `Item`: Describes an item in the routing list (activity, performer and optionally deadline).

** `Id` (STRING): Used for identification. Must not be changed and must be sent identically in all jobs. If an item is created by the client, this must specify an ID here.
** `ActivityId` (STRING): ID of the activity in the workflow model
** `ActivityName` (STRING): Name of the activity (need not match the name in the workflow model)
** `ActivityModelName` (STRING): Name of the activity in the workflow model
** `TimerId` (STRING): ID of a reminder period
** `TimerName` (STRING): Name of the reminder period
** `TimerDuration` (INT): Duration of the period
** `TimerDurationType` (INT): `0` = no period, `1` = relative, `2` = absolute
** `Changeable` (INT): `0` = no changes possible, `1` = item can be modified by the client
** `Deleteable` (INT): `0` = deletion not allowed, `1` = item can be deleted
** `Remark` (STRING): Note for processing (text)
** `ObjectIds` (STRING): List of GUIDs of performers (roles or persons), separated by commas

<a id="wfm.AdhocGetTemplateList"></a>

## wfm.AdhocGetTemplateList

Returns one or more ad hoc templates for the specified user.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `UserId` | STRING | Yes | ID of the user |
| `OrgId` | STRING | Yes | ID of the organization |
| `[TemplateId]` | STRING | No | ID of the template. If this parameter is empty, all ad hoc templates visible to the user are determined (all public templates and the user's privatized templates). |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Templates` | BASE64 | — | List of determined ad hoc templates in XML format (see note) |

### Return Value

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

### Note

Each template in `Templates` has the following structure:

* `Template`: Describes an ad hoc template

** `TemplateId` (STRING): ID of the ad hoc template
** `TemplateName` (STRING): Name of the ad hoc template
** `Public` (INT): `0` = template is not public, `1` = template is public
** `RoutingList`: Routing list (structure as in [wfm.AdhocConfigTemplate](wfm.md#wfm.AdhocConfigTemplate))

Detailed description of `RoutingList` and its sub-elements:

* `RoutingList`: Routing list with the following structure (or subsets thereof)

** `Id` (STRING): ID of the routing list. This value is set by the server and must not be changed.
** `ActivityId` (STRING): Activity ID
** `Expandable` (INT): `0` = routing list cannot be expanded, `1` = routing list can be expanded

* `Entries`: Groups entries of the routing list. An entry consists of multiple elements that can be executed in parallel.

* `Entry`: Describes an entry in the routing list.

** `Nr` (INT): Used for relative sorting of entries within the routing list. Absolute values have no meaning for the client.
** `Expandable` (INT): `0` = entry cannot be expanded, `1` = entry can be expanded

* `Item`: Describes an item in the routing list (activity, performer and optionally deadline).

** `Id` (STRING): Used for identification. Must not be changed and must be sent identically in all jobs. If an item is created by the client, this must specify an ID here.
** `ActivityId` (STRING): ID of the activity in the workflow model
** `ActivityName` (STRING): Name of the activity (need not match the name in the workflow model)
** `ActivityModelName` (STRING): Name of the activity in the workflow model
** `TimerId` (STRING): ID of a reminder period
** `TimerName` (STRING): Name of the reminder period
** `TimerDuration` (INT): Duration of the period
** `TimerDurationType` (INT): `0` = no period, `1` = relative, `2` = absolute
** `Changeable` (INT): `0` = no changes possible, `1` = item can be modified by the client
** `Deleteable` (INT): `0` = deletion not allowed, `1` = item can be deleted
** `Remark` (STRING): Note for processing (text)
** `ObjectIds` (STRING): List of GUIDs of performers (roles or persons), separated by commas

<a id="wfm.AdminDeleteProcesses"></a>

## wfm.AdminDeleteProcesses

This job deletes all specified workflow processes. If the workflow file contains documents that were created during the workflow process and are not yet in enaio®, these are inserted into the archive of the enaio® client of the job executor. Before a process can be deleted, the process must be suspended via the job [wfm.AdminSuspendProcess](wfm.md#wfm.AdminSuspendProcess).

### Input Parameters

| Name | Type | Required | Description |  |  |  |  |
|---|---|---|---|---|---|---|---|
| OrganisationId | STRING | Yes | GUID of the organization to which the processes belong. | Processes | STRING | Yes | Comma-separated list of process GUIDs to be deleted. |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Processes` | STRING | — | Comma-separated list of process GUIDs that could not be deleted. |

### See Also

[wfm.AdminGetProcessList](wfm.md#wfm.AdminGetProcessList),
[wfm.GetOrganisations](wfm.md#wfm.GetOrganisations),
[wfm.AdminSuspendProcess](wfm.md#wfm.AdminSuspendProcess)

<a id="wfm.AdminDeleteStatisticReportConfigs"></a>

## wfm.AdminDeleteStatisticReportConfigs

This job deletes all specified report configurations.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization in which the report configurations are located. |
| `ConfigIds` | STRING | Yes | Comma-separated list of report configuration GUIDs to be deleted. |

### Return Value

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

### See Also

[wfm.AdminGetStatisticReportConfigs](wfm.md#wfm.AdminGetStatisticReportConfigs),
[wfm.AdminSaveReportConfig](wfm.md#wfm.AdminSaveReportConfig)

<a id="wfm.AdminDeleteStatisticReports"></a>

## wfm.AdminDeleteStatisticReports

This job deletes all specified statistical reports.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| ReportIds | STRING | Yes | Comma-separated list of report GUIDs to be deleted. |

### Return Value

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

<a id="wfm.AdminGetActivityVariables"></a>

## wfm.AdminGetActivityVariables

This job returns the IDs, names, structure and values of all workflow variables for an activity in XML format.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| RActivityId | STRING | Yes | Instance ID of an activity. |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `DataFields` | BASE64 | — | List with information about activity variables in XML format. |
**Structure of DataFields**

```xml
<DataFields>
  <DataField Id="72FA13878B7C4744BB33C58B5AAFF5F0" Name="wfProtocol">
    <![CDATA[
<WFVar>
  <List TypeId="75FCEF515EDE4CF5A1BA8DE94FD26023"></List>
  <Types>
    <Type Id="75FCEF515EDE4CF5A1BA8DE94FD26023">
      <Record>
        <Member Name="Datum"><STRING/></Member>
        <Member Name="Uhrzeit"><STRING/></Member>
        <Member Name="Aktivität"><STRING/></Member>
        <Member Name="Benutzer"><STRING/></Member>
        <Member Name="Protokoll"><STRING/></Member>
      </Record>
    </Type>
  </Types>
</WFVar>
    ]]>
  </DataField>
  <DataField Id="4170579B168642B0E8A172BC73459" Name="Testvariable">
    <![CDATA[
<WFVar>
  <String>Hier steht ein String.</String>
  <Types></Types>
</WFVar>
    ]]>
  </DataField>
</DataFields>
```
> **Note:** Detailed description of `DataField`: +
`Id` (STRING) — GUID of the variable. +
`Name` (STRING) — Name of the variable. +
CDATA — Structure and values of the variable.

### See Also

[wfm.AdminGetProcessActivities](wfm.md#wfm.AdminGetProcessActivities),
[wfm.AdminSaveActivityVariables](wfm.md#wfm.AdminSaveActivityVariables)

<a id="wfm.AdminGetLockInfo"></a>

## wfm.AdminGetLockInfo

This job returns information about workflow database tables locked by the system.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| OrganisationsId | STRING | Yes | ID of the organization. |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `LockItems` | BASE64 | — | Information about workflow database tables in XML format. |
**Structure of LockItems**

```xml
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<LockItems>
  <LockItem Id="" Name="" State="" LockTime="" ServerId="" ThreadId=""/>
  <LockItem Id="" Name="" State="" LockTime="" ServerId="" ThreadId=""/>
</LockItems>
```
> **Note:** Detailed description of `LockItem` attributes: +
`Id` (INT) — ID of the database table. +
`Name` (STRING) — Name of the database table. +
`State` (INT) — 1 = database table is locked, otherwise 0. +
`LockTime` (INT) — Timestamp (when the table was locked). +
`ServerId` (INT) — ID of the server that locked the table. +
`ThreadId` (INT) — ID of the thread that locked the table.

### See Also

[wfm.AdminReleaseLock](wfm.md#wfm.AdminReleaseLock)

<a id="wfm.AdminGetProcessActivities"></a>

## wfm.AdminGetProcessActivities

This job returns all activities for a process.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| ProcessId | STRING | Yes | GUID of the process. |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Activities` | BASE64 | — | Contains requested information in XML format. |
**Structure of Activities**

```xml
<Activities>
  <Activity>
    <Name></Name>
    <Id></Id>
    <RActivityId></RActivityId>
    <CreationTime></CreationTime>
    <Owner></Owner>
    <OwnerId></OwnerId>
    <AccessTime></AccessTime>
    <EndTime></EndTime>
    <ReminderTime></ReminderTime>
    <ReminderState></ReminderState>
    <State></State>
    <ClosureTime></ClosureTime>
    <WorkItem></WorkItem>
    <LoopCount></LoopCount>
    <ExecutionPoints></ExecutionPoints>
    <RLoopId></RLoopId>
    <ActivityNr></ActivityNr>
  </Activity>
</Activities>
```
> **Note:** Detailed description of `Activity` elements: +
`Name` (STRING) — Name of the activity. +
`Id` (STRING) — GUID of the activity (from the workflow model). +
`RActivityId` (STRING) — Instance ID of the activity. +
`CreationTime` (INT) — Creation time of the activity on the server. +
`Owner` (STRING) — Owner; has personalized the activity. +
`OwnerId` (STRING) — ID of the owner. +
`AccessTime` (INT) — Time of the last access to the activity. +
`EndTime` (INT) — Time when the activity ended. +
`ReminderTime` (INT) — Reminder period. +
`ReminderState` (INT) — Reminder status (1 = reminder period exceeded, otherwise 0). +
`State` (INT) — Activity status (bitmask): +
&nbsp;&nbsp;0x00000001 (1) — The activity was initialized. +
&nbsp;&nbsp;0x00000002 (2) — The activity was started (e.g. variables were created). +
&nbsp;&nbsp;0x00000004 (4) — The StartActivity event was executed. +
&nbsp;&nbsp;0x00000008 (8) — The EndActivity event was executed. +
&nbsp;&nbsp;0x00000010 (16) — Only for loops: The loop condition was checked. +
&nbsp;&nbsp;0x00000020 (32) — Only for loops: The loop body is being processed. +
&nbsp;&nbsp;0x00000040 (64) — Only for work steps: The work step is ready in the inbox. +
&nbsp;&nbsp;0x00000080 (128) — Only for work steps: The work step is personalized. +
&nbsp;&nbsp;0x00000100 (256) — Waiting for the expiration of a lock period. +
&nbsp;&nbsp;0x00000400 (1024) — The activity was executed (e.g. a work step was forwarded or a loop activity was completely processed). +
&nbsp;&nbsp;0x00000800 (2048) — Subsequent activities were calculated and possibly already created. +
&nbsp;&nbsp;0x00001000 (4096) — The activity is finished, but no subsequent activities have been initiated yet. +
&nbsp;&nbsp;0x00002000 (8192) — The activity was suspended by a user. +
&nbsp;&nbsp;0x00004000 (16384) — The activity is finished. +
&nbsp;&nbsp;0x00008000 (32768) — Only for multi-instance activities: The activity was created. +
&nbsp;&nbsp;0x00010000 (65536) — Only for ad-hoc activities: The ad-hoc activity was created. +
&nbsp;&nbsp;0x00020000 (131072) — Activity canceled. +
&nbsp;&nbsp;0x00040000 (262144) — Only for ad-hoc activities: The ad-hoc activity is being executed. +
&nbsp;&nbsp;0x10000000 (268435456) — The activity was suspended by the system due to an error. +
`ClosureTime` (INT) — Lock period for the activity. +
`WorkItem` (INT) — 1 = activity visible in inboxes, otherwise 0. +
`LoopCount` (INT) — If it is a loop activity, the number of loop iterations is specified here, otherwise 0. +
`ExecutionPoints` (INT) — Execution points for job [wfm.AdminRollbackProcess](wfm.md#wfm.AdminRollbackProcess): 100 = activity is created, 200 = activity is finished. +
`RLoopId` (STRING) — Instance ID of the enclosing loop; empty if none exists. +
`ActivityNr` (INT) — Indicates at which position in the process the activity was created.

### See Also

[wfm.AdminGetProcessList](wfm.md#wfm.AdminGetProcessList),
[wfm.AdminGetActivityVariables](wfm.md#wfm.AdminGetActivityVariables)

<a id="wfm.AdminGetProcessList"></a>

## wfm.AdminGetProcessList

This job returns a list of all running processes for a workflow model.

### Input Parameters

| Name | Type | Required | Description |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| OrganisationId | STRING | Yes | ID of the organization. | WorkflowId | STRING | Yes | ID of the workflow model. | ChunkSize | INT | Yes | Number of processes to be returned with a request at most. Default: 0 returns all processes. | OrderColumn | STRING | Yes | Specifies by which column the result list is sorted. Possible values: `processname` and `creationtime` (default). The process ID is always used as a secondary sorting criterion. | Order | INT | Yes | Sorting direction: 1 = ascending (default), 2 = descending. | [LastFetchedProcessId] | STRING | No | For paging: The last process ID returned in the hit list. Pass in new call so that list starts after previous chunk. Only necessary when paging with `ChunkSize`. | [LastFetchedOrderValue] | STRING | No | For paging: The last value of the sorted column from a previous call with `ChunkSize`. Numeric or string values possible. Requires a fixed `LastFetchedProcessId`. | [States] | INT | No | States of processes to be displayed (bitmask). 0 or not set = all states. Available values (deprecated): INIT 0x01 (1), RUNNING 0x02 (2), SUSPENDED 0x04 (4), ACTIVE 0x08 (8), TERMINATED 0x10 (16), COMPLETED 0x20 (32), SYSSUSPENDED 0x40 (64). | [Filter] | STRING | No | Filter text for the process name. Only processes containing this string anywhere in the name are returned. |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Processes` | BASE64 | — | List of all running processes in XML format. |
**Structure of Processes**

```xml
<Processes>
  <Process Id="" Name="" Subject="" State="" SuspendedActivity="">
    <Creation UserId="" UserName="" Time=""/>
    <LastActivity ExecTime="" Name="" Id="" UserId="" UserName=""/>
  </Process>
</Processes>
```
> **Note:** Detailed description of attributes and elements: +
`Id` (STRING) — ID of a process. +
`Name` (STRING) — Name of a process. +
`Subject` (STRING) — Subject of the process. +
`State` (INT) — State of a process: 1 = INIT, 2 = RUNNING, 4 = SUSPENDED, 8 = ACTIVE, 16 = TERMINATED, 32 = COMPLETED, 64 = SYSSUSPENDED (process was suspended by engine, e.g. due to an error in the event script). +
`SuspendedActivity` (INT) — 1 = at least one activity of the process is suspended, otherwise 0. +
`Creation` — Information about process creation: `UserId` (STRING) creator's user ID, `UserName` (STRING) creator's username, `Time` (INT) creation time. +
`LastActivity` — Information about the last use of the process: `ExecTime` (INT) last execution time, `Name` (STRING) name of the last executed activity, `Id` (STRING) ID of the last executed activity, `UserId` (STRING) executor's ID, `UserName` (STRING) executor's name.

### See Also

[wfm.AdminGetWorkflowList](wfm.md#wfm.AdminGetWorkflowList),
[wfm.GetOrganisations](wfm.md#wfm.GetOrganisations),
[wfm.AdminDeleteProcesses](wfm.md#wfm.AdminDeleteProcesses)

<a id="wfm.AdminGetProcessListByRole"></a>

## wfm.AdminGetProcessListByRole

This job returns all processes for a role ID where work items are currently in the inbox.

### Input Parameters

| Name | Type | Required | Description |  |  |  |  |
|---|---|---|---|---|---|---|---|
| OrganisationId | STRING | Yes | ID of the organization. | RoleId | STRING | Yes | ID of the role. |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Processes` | BASE64 | — | List of all work items in the inbox in XML format. |
**Structure of Processes**

```xml
<Processes>
  <Process Id="" Name="" Subject="" State="">
    <Creation UserId="" UserName="" Time=""/>
    <Activity CreationTime="" Name="" Id="" Owner="" OwnerId=""
              ReminderTime="" OwnerTime="" WICreationTime="" State=""/>
  </Process>
</Processes>
```
> **Note:** Detailed description of attributes and elements: +
`Id` (STRING) — ID of the process. +
`Name` (STRING) — Name of the process. +
`Subject` (STRING) — Subject of the process. +
`State` (INT) — State of the process: 1 = INIT, 2 = RUNNING, 4 = SUSPENDED, 8 = ACTIVE, 16 = TERMINATED, 32 = COMPLETED, 64 = SYSSUSPENDED. +
`Creation` — Information about creation: `UserId` (STRING) creator's user ID, `UserName` (STRING) creator's username, `Time` (INT) process creation time. +
`Activity` — Information about the activity: `CreationTime` (INT) creation time, `Name` (STRING) name of the activity, `Id` (STRING) ID of the activity, `Owner` (STRING) name of the user who personalized the work item, `OwnerId` (STRING) ID of this user, `ReminderTime` (INT) reminder period (0 = no reminder period), `OwnerTime` (INT) time of personalization, `WICreationTime` (INT) time when the work item was created in the inbox. +
`Activity.State` (INT) — Bitmask, status values identical to those in [wfm.AdminGetProcessActivities](wfm.md#wfm.AdminGetProcessActivities).

### See Also

[wfm.GetOrganisations](wfm.md#wfm.GetOrganisations),
[wfm.AdminGetRoleProcesses](wfm.md#wfm.AdminGetRoleProcesses),
[wfm.AdminGetProcessActivities](wfm.md#wfm.AdminGetProcessActivities),
[wfm.AdminDeleteProcesses](wfm.md#wfm.AdminDeleteProcesses)

<a id="wfm.AdminGetProcessListByUser"></a>

## wfm.AdminGetProcessListByUser

This job returns all processes for a user ID where work items are currently in the inbox.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING (GUID) | Yes | ID of the organisation. |
| `UserId` | STRING (GUID) | Yes | Workflow-organisation user object ID — NOT the user ID returned by [mng.GetUserList](mng.md#mng.GetUserList). Resolve via [wfm.GetOrganisationObjects](wfm.md#wfm.GetOrganisationObjects) filtered by `ClassIds` of the user class (typically `9AB24246BB9040A29FCD6015CF4F4BD9`). |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Processes` | BASE64 | — | Contains requested information in XML format. |
**Structure of Processes**

```xml
<Processes>
  <Process Id="" Name="" Subject="" State="">
    <Creation UserId="" UserName="" Time=""/>
    <Activity CreationTime="" Name="" Id="" ReminderTime=""
              OwnerTime="" WICreationTime="" State=""/>
  </Process>
</Processes>
```
> **Note:** Detailed description of attributes and elements: +
`Id` (STRING) — ID of the process. +
`Name` (STRING) — Name of the process. +
`Subject` (STRING) — Subject of the process. +
`State` (INT) — State of the process: 1 = INIT, 2 = RUNNING, 4 = SUSPENDED, 8 = ACTIVE, 16 = TERMINATED, 32 = COMPLETED, 64 = SYSSUSPENDED. +
`Creation` — Information about creation: `UserId` (STRING) creator's user ID, `UserName` (STRING) creator's username, `Time` (INT) process creation time. +
`Activity` — Information about the activity: `CreationTime` (INT) creation time, `Name` (STRING) name of the activity, `Id` (STRING) ID of the activity, `ReminderTime` (INT) reminder period (0 = no reminder period), `WICreationTime` (INT) time when the work item was created in the inbox. +
`Activity.Owner` (STRING, optional) — Name of the user who personalised the work item. Not delivered in every call context / server version — in observed responses the attribute can be absent even when the activity is personalised. +
`Activity.OwnerId` (STRING, optional) — ID of that user. Same caveat as `Owner`. +
`Activity.OwnerTime` (INT) — Unix timestamp of the personalisation. `0` indicates the activity is not currently personalised; the value is reset when personalisation is withdrawn. +
`Activity.State` (INT) — Bitmask. Full bit list see [wfm.AdminGetProcessActivities](wfm.md#wfm.AdminGetProcessActivities).

### See Also

[wfm.GetOrganisations](wfm.md#wfm.GetOrganisations),
[wfm.AdminGetUserProcesses](wfm.md#wfm.AdminGetUserProcesses),
[wfm.AdminGetProcessActivities](wfm.md#wfm.AdminGetProcessActivities),
[wfm.AdminDeleteProcesses](wfm.md#wfm.AdminDeleteProcesses)

<a id="wfm.AdminGetProcessLocks"></a>

## wfm.AdminGetProcessLocks

This job returns information about locked workflow processes.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| OrganisationsId | STRING | Yes | ID of the organization. |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Processes` | BASE64 | — | Information about locked workflow processes in XML format. |
**Structure of Processes**

```xml
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<Processes>
  <Process Id="" Name="" LockTime="" ServerId="" ThreadId=""/>
  <Process Id="" Name="" LockTime="" ServerId="" ThreadId=""/>
</Processes>
```
> **Note:** Detailed description of `Process` attributes: +
`Id` (STRING) — ID of the process. +
`Name` (STRING) — Name of the process. +
`LockTime` (INT) — Timestamp (when the process was locked). +
`ServerId` (INT) — ID of the server that locked the process. +
`ThreadId` (INT) — ID of the thread that locked the process.

### See Also

[wfm.AdminReleaseLock](wfm.md#wfm.AdminReleaseLock)

<a id="wfm.AdminGetProcessReport"></a>

## wfm.AdminGetProcessReport

This job returns information about the specified workflow processes. Do not confuse with statistical process reports!

### Input Parameters

| Name | Type | Required | Description |  |  |  |  |  |  |  |  |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Processes | STRING | Yes | Comma-separated list of process IDs. | File | INT | Yes | 1 = information about the WF file is delivered, otherwise 0. | GlobalDataFields | INT | Yes | 1 = information about global variables is delivered, otherwise 0. |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Processes` | BASE64 | — | Information about workflow processes in XML format. |
**Structure of Processes**

```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<Processes>
  <Process>
    <Id>B216B6ACC46B4A33AFB9D6852D928A33</Id>
    <Name>Globale Variablen Test - Paralleler Ablauf 2</Name>
    <CreationTime>1143128816</CreationTime>
    <EndTime>0</EndTime>
    <UserName>Peter Mustermann</UserName>
    <DataFields>
      <DataField>
        <Id>79FBB5E2F38B434DBF6C7507614CF740</Id>
        <Name>TextVar02</Name>
        <Value><WFVar><String>Wert 1</String><Types></Types></WFVar></Value>
      </DataField>
    </DataFields>
    <Docs>
      <Doc>
        <Id>194</Id>
        <Type>196608</Type>
      </Doc>
    </Docs>
  </Process>
</Processes>
```
> **Note:** Detailed description of elements: +
`Id` (STRING) — ID of the process. +
`Name` (STRING) — Name of the process. +
`CreationTime` (INT) — Timestamp (when the process was created). +
`EndTime` (INT) — Timestamp (when the process was finished). +
`UserName` (STRING) — Name of the process creator. +
`DataFields` — Information about global variables: `Id` (STRING) ID of the variable, `Name` (STRING) name of the variable, `Value` structure and value of the variable. +
`Docs` — Objects of the workflow file: `Id` (STRING) ID of the ECM object, `Type` (INT) object type.

<a id="wfm.AdminGetRoleProcesses"></a>

## wfm.AdminGetRoleProcesses

This job returns all roles of a specific organization for which work items are present in the inbox.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| OrganisationId | STRING | Yes | ID of the organization. |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Roles` | BASE64 | — | List of all roles in XML format. |
**Structure of Roles**

```xml
<Roles>
  <Role Id="" Name="" ProcessCount=""/>
  <Role Id="" Name="" ProcessCount=""/>
</Roles>
```
> **Note:** Detailed description of `Role` attributes: +
`Id` (STRING) — ID of the role. +
`Name` (STRING) — Name of the role. +
`ProcessCount` (INT) — Number of processes for which work items are present in the inbox.

<a id="wfm.AdminGetStatisticReportConfigs"></a>

## wfm.AdminGetStatisticReportConfigs

This job retrieves configurations for process reports (statistics, etc.).

### Input Parameters

| Name | Type | Required | Description |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| OrganisationId | STRING | Yes | ID of the organization where the requested report configurations are located. | [CreatorId] | STRING | No | ID of the creator of a configuration. If set, only configurations with this CreatorId are returned. | UserId | STRING | Yes | ID of the calling user. Only configurations for which the user has rights are returned. | [ConfigTypes] | STRING | No | Comma-separated list of configuration types. If set, only configurations of the corresponding type are returned. Possible values: 0 = Process statistics, 1 = Process details. | [FamilyIds] | STRING | No | Comma-separated list with IDs of workflow families. If set, only configurations assigned to at least one of the specified families are returned. | RespectRights | INT | Yes | Indicates whether only report configurations are returned whose reports the user is allowed to request and view. 0 = regardless of rights, 1 = according to rights. |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `ReportConfigs` | BASE64 | — | Information about the requested report configurations in XML format. |
**Structure of ReportConfigs**

```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<ReportConfigs>
  <ReportConfig ConfigId="" ConfigName="" CreationTime="" CreatorId=""
                CreatorName="" ConfigType="">
    <ConfigData><![CDATA[]]></ConfigData>
  </ReportConfig>
</ReportConfigs>
```
> **Note:** More detailed description of `ReportConfig` attributes: +
`ConfigId` (STRING) — ID of the configuration. +
`ConfigName` (STRING) — Name of the configuration. +
`CreationTime` (INT) — Timestamp (when the configuration was created). +
`CreatorId` (STRING) — User ID of the creator of the configuration. +
`CreatorName` (STRING) — Name of the person object corresponding to the user. +
`ConfigType` (INT) — Type of the configuration: 0 = Process statistics, 1 = Process details. +
`ConfigData` (CDATA) — Configuration as XML description.

### See Also

[wfm.AdminDeleteStatisticReportConfigs](wfm.md#wfm.AdminDeleteStatisticReportConfigs),
[wfm.AdminSaveReportConfig](wfm.md#wfm.AdminSaveReportConfig)

<a id="wfm.AdminGetStatisticReportData"></a>

## wfm.AdminGetStatisticReportData

This job returns the data for a previously generated statistical report.

### Input Parameters

| Name | Type | Required | Description |  |  |  |  |
|---|---|---|---|---|---|---|---|
| ReportId | STRING | Yes | ID of the report. | UserId | STRING | Yes | ID of the calling user. Only data is delivered if the user has the corresponding rights. |

### Return Value

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

### Output Files

| Name | Description |
|---|---|
| Statistical report file | Name and path of the XML file with the data of the statistical report. |

<a id="wfm.AdminGetStatisticReports"></a>

## wfm.AdminGetStatisticReports

Returns the available reports for a statistical report configuration.

### Input Parameters

| Name | Type | Required | Description |  |  |  |  |  |  |  |  |
|---|---|---|---|---|---|---|---|---|---|---|---|
| OrganisationId | STRING | Yes | ID of the organization. | ConfigId | STRING | Yes | ID of the statistical report configuration. | UserId | STRING | Yes | ID of the calling user. Only data is delivered if the user has the corresponding rights. |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Reports` | BASE64 | — | Information about the requested reports in XML format. |
**Structure of Reports**

```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<Reports>
  <Report ReportId="" CreationTime="" CreatorId="" CreatorName="" State=""/>
  <Report ReportId="" CreationTime="" CreatorId="" CreatorName="" State=""/>
</Reports>
```
> **Note:** Detailed description of `Report` attributes: +
`ReportId` (STRING) — ID of the report. +
`CreationTime` (INT) — Timestamp. When State = 0 or 1, this is the time when the report was requested; otherwise the time when the report creation began. +
`CreatorId` (STRING) — User ID of the report creator. +
`CreatorName` (STRING) — Name of the person object corresponding to the user. +
`State` (INT) — Status of the report: 0 = report is requested, 1 = report is currently being created, 2 = report is finished created.

<a id="wfm.AdminGetUserProcesses"></a>

## wfm.AdminGetUserProcesses

This job returns all users of a specific organization for which work items are present in the inbox.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| OrganisationId | STRING | Yes | ID of the organization. |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Users` | BASE64 | — | List of all users in XML format. |
**Structure of Users**

```xml
<Users>
  <User Id="" Name="" ProcessCount=""/>
  <User Id="" Name="" ProcessCount=""/>
</Users>
```
> **Note:** Detailed description of `User` attributes: +
`Id` (STRING) — ID of the user. +
`Name` (STRING) — Name of the user. +
`ProcessCount` (INT) — Number of processes of the user for which work items are present in the inbox.

<a id="wfm.AdminGetWorkerqueue"></a>

## wfm.AdminGetWorkerqueue

This job returns information about elements currently in the worker queue.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| OrganisationsId | STRING | Yes | ID of the organization. |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `WorkerqueueItems` | BASE64 | — | Information about worker queue elements in XML format. |
**Structure of WorkerqueueItems**

```xml
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<WorkerqueueItems>
  <WorkerqueueItem Id="" ActivityName="" ProcessName="" State=""
                   TargetState="" CreationTime="" LockState=""
                   LockTime="" ServerId=""/>
</WorkerqueueItems>
```
> **Note:** Detailed description of `WorkerqueueItem` attributes: +
`Id` (STRING) — Instance ID of the activity in the worker queue. +
`ActivityName` (STRING) — Name of the activity. +
`ProcessName` (STRING) — Name of the process to which the activity belongs. +
`State` (INT) — Current status of the activity. +
`TargetState` (INT) — This status should be reached after processing by the worker queue. +
`CreationTime` (INT) — Timestamp (when the element was added to the worker queue). +
`LockState` (INT) — 1 = worker queue element is locked, otherwise 0. +
`LockTime` (INT) — Timestamp (when the worker queue element was locked). +
`ServerId` (INT) — ID of the server that locked the worker queue element.

### See Also

[wfm.AdminReleaseLock](wfm.md#wfm.AdminReleaseLock)

<a id="wfm.AdminGetWorkflowList"></a>

## wfm.AdminGetWorkflowList

This job returns all currently used workflow models (status ACTIVE/INUSE) and the number of running processes of an organization.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| OrganisationId | STRING | Yes | ID of the organization. |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Workflows` | BASE64 | — | Contains requested information in XML format. |
**Structure of Workflows**

```xml
<Workflows>
  <Workflow Id="" Name="" ProcessCount=""/>
  <Workflow Id="" Name="" ProcessCount=""/>
</Workflows>
```
> **Note:** Detailed description of `Workflow` attributes: +
`Id` (STRING) — ID of the workflow model. +
`Name` (STRING) — Name of the workflow model. +
`ProcessCount` (INT) — Number of running processes for this workflow model.

<a id="wfm.AdminReleaseLock"></a>

## wfm.AdminReleaseLock

This job releases a database lock of the specified type.

### Input Parameters

| Name | Type | Required | Description |  |  |  |  |
|---|---|---|---|---|---|---|---|
| Locktype | INT | Yes | Specifies the lock type: 1 = locked processes are released (`LockId` must contain the corresponding process ID); 2 = locked worker queue element is released (`LockId` must contain the corresponding worker queue item ID); 3 = locked database table is released (`LockId` must contain the corresponding table ID). | LockId | STRING | Yes | See `Locktype`. |

### Return Value

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

### See Also

[wfm.AdminGetWorkerqueue](wfm.md#wfm.AdminGetWorkerqueue),
[wfm.AdminGetProcessLocks](wfm.md#wfm.AdminGetProcessLocks),
[wfm.AdminGetLockInfo](wfm.md#wfm.AdminGetLockInfo)

<a id="wfm.AdminRequestStatisticReport"></a>

## wfm.AdminRequestStatisticReport

This job requests the creation of a new report for a given statistical report configuration.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |
| `UserId` | STRING | Yes | ID of the user performing the action |
| `ConfigId` | STRING | Yes | ID of the statistical report configuration |
| `CompileTime` | INT | Yes | Point in time when the report should be generated earliest |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `ReportId` | STRING | — | ID of the report |
| `CreatorId` | STRING | — | ID of the user who requested the report |
| `CreatorName` | STRING | — | Name of the person object of the user |
| `CreationTime` | INT | — | Timestamp of report creation. When `State` = 0 or 1, this is the time when the report was requested; otherwise the time when the report creation began. |
| `State` | INT | — | Status of the report: |

### Return Value

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

<a id="wfm.AdminResumeActivity"></a>

## wfm.AdminResumeActivity

This job resumes a suspended activity for processing.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `RActivityId` | STRING | Yes | Instance ID of the activity |
| `UserId` | STRING | Yes | ID of the user performing the action |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `State` | INT | — | Status of the activity after resuming |

### Return Value

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

### See Also

[wfm.AdminSuspendActivity](wfm.md#wfm.AdminSuspendActivity)

<a id="wfm.AdminResumeProcess"></a>

## wfm.AdminResumeProcess

This job resumes a suspended process for processing. If individual activities from this process are also suspended, these are also continued.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ProcessId` | STRING | Yes | ID of the process |
| `UserId` | STRING | Yes | ID of the user performing the action |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `State` | INT | — | Status of the process after resuming |

### Return Value

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

### See Also

[wfm.AdminSuspendProcess](wfm.md#wfm.AdminSuspendProcess)

<a id="wfm.AdminRollbackProcess"></a>

## wfm.AdminRollbackProcess

This job resets a process to the specified activity and returns all activities of the process that would be deleted thereby. The rollback point at the activity itself is determined via the `ExecutionPoint` parameter. You can rollback to an activity before it is created or before it is finished. Before a process can be rolled back, it must be suspended via the job [wfm.AdminSuspendProcess](wfm.md#wfm.AdminSuspendProcess).

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `RActivityId` | STRING | Yes | Instance ID of the activity to which the process should be reset |
| `ExecutionPoint` | INT | Yes | Starting point at the activity: `100` = activity is created, `200` = activity is finished |
| `DoRollback` | INT | Yes | `0` = rollback is not performed (simulation); `1` = process is reset. `RunningActivities` is filled for both options. |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `RunningActivities` | BASE64 | — | Contains all activities that would be deleted after rollback (`DoRollback` = 1) or would be deleted (`DoRollback` = 0) |

### Return Value

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

### Example

Structure of `RunningActivities`:

```xml
<RunningActivities>
  <RunningActivity Id="" RActivityId="" Name="" State="" CreationTime=""/>
  <RunningActivity Id="" RActivityId="" Name="" State="" CreationTime=""/>
</RunningActivities>
```
Detailed description of `RunningActivity` attributes:

* `Id` (STRING): ID of the activity from the workflow model
* `RActivityId` (STRING): Instance ID of the activity
* `Name` (STRING): Name of the activity
* `State` (INT): Status of the activity
* `CreationTime` (INT): Creation time of the activity (timestamp)

### See Also

[wfm.AdminSuspendProcess](wfm.md#wfm.AdminSuspendProcess)

<a id="wfm.AdminSaveActivityVariables"></a>

## wfm.AdminSaveActivityVariables

This job saves workflow variables for a specified instance ID of an activity to the database.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `UserId` | STRING | Yes | ID of the user performing the change |
| `RActivityId` | STRING | Yes | Instance ID of an activity |
| `DataFields` | BASE64 | Yes | List with information about variables in XML format |

### Return Value

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

### Example

Structure of `DataFields`:

```xml
<DataFields>
  <DataField Id=""><![CDATA[]]></DataField>
  <DataField Id=""><![CDATA[]]></DataField>
</DataFields>
```
Detailed description of `DataField`:

* `Id` (STRING): ID of the variable
* CDATA: Value of the variable

### See Also

[wfm.AdminGetProcessActivities](wfm.md#wfm.AdminGetProcessActivities),
[wfm.AdminGetActivityVariables](wfm.md#wfm.AdminGetActivityVariables)

<a id="wfm.AdminSaveReportConfig"></a>

## wfm.AdminSaveReportConfig

This job saves (insert or update) a report configuration.

### Input Parameters

| Name | Type | Required | Description |  |  |  |  |
|---|---|---|---|---|---|---|---|
| `UserId` | STRING | Yes | ID of the user performing the change |  |  |  |  |
| `ConfigId` | STRING | Yes | ID of a configuration. If this is not known to the server, a new configuration is created. If the ID already exists, the corresponding configuration is modified (only `ConfigName`, `FamilyIds` and `ConfigData` are changed). | `ConfigName` | STRING | Yes | Name of the configuration |
| `OrganisationId` | STRING | Yes | ID of the organization in which the configuration is located |  |  |  |  |
| `ConfigType` | INT | Yes | Type of the configuration: |  |  |  |  |
| `ConfigData` | STRING | Yes | XML description of the configuration |  |  |  |  |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `SaveType` | INT | — | Indicates how it was saved: |
| `[CreationTime]` | INT | Optional | Time of creation (only when `SaveType` = 0) |
| `[CreatorId]` | STRING | Optional | ID of the user who performed the change (only when `SaveType` = 0) |

### Return Value

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

### See Also

[wfm.AdminDeleteStatisticReportConfigs](wfm.md#wfm.AdminDeleteStatisticReportConfigs),
[wfm.AdminGetStatisticReportConfigs](wfm.md#wfm.AdminGetStatisticReportConfigs)

<a id="wfm.AdminSuspendActivity"></a>

## wfm.AdminSuspendActivity

This job suspends an activity. The activity cannot be processed afterwards.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `RActivityId` | STRING | Yes | Instance ID of the activity |
| `UserId` | STRING | Yes | ID of the user performing the action |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `State` | INT | — | Status of the activity before suspension (bitmask): |

### Return Value

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

### See Also

[wfm.AdminResumeActivity](wfm.md#wfm.AdminResumeActivity)

<a id="wfm.AdminSuspendProcess"></a>

## wfm.AdminSuspendProcess

This job suspends a process. No activities of the process can be processed anymore.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ProcessId` | STRING | Yes | ID of the process |
| `UserId` | STRING | Yes | ID of the user performing the action |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `State` | INT | — | Status of the process before suspension: |

### Return Value

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

### See Also

[wfm.AdminResumeProcess](wfm.md#wfm.AdminResumeProcess)

<a id="wfm.AdminTerminateActivity"></a>

## wfm.AdminTerminateActivity

This job cancels an activity. So far, only multi-instances can be canceled. If this is the last instance of a multi-instance activity, the process continues.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `RActivityId` | STRING | Yes | ID of the activity |
| `UserId` | STRING | Yes | ID of the user performing the action |

### Return Value

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

<a id="wfm.AdminTerminateProcess"></a>

## wfm.AdminTerminateProcess

This job cancels a process. The process is removed from the workflow's runtime tables, but remains in the history and is marked as canceled.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ProcessId` | STRING | Yes | ID of the process |
| `UserId` | STRING | Yes | ID of the user performing the action |

### Return Value

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

<a id="wfm.CancelWorkItem"></a>

## wfm.CancelWorkItem

This job unpersonalizes a work item. The work item is then visible to all participants again and can be personalized again.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `UserId` | STRING | Yes | ID of the current user |
| `WorkItemId` | STRING | Yes | Instance ID of the activity |
| `OrganisationId` | STRING | Yes | ID of the organization |
| `ClientTypeId` | STRING | Yes | ID of the client type used |

### Return Value

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

<a id="wfm.ChangeWorkflowState"></a>

## wfm.ChangeWorkflowState

This job changes/sets the status of a workflow model.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization to which the workflow is assigned |
| `WorkflowId` | STRING | Yes | ID of the workflow model |
| `UserId` | STRING | Yes | ID of the user |
| `State` | INT | Yes | New status of the workflow model to be set (see below) |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `State` | INT | — | New status of the workflow model |

### Return Value

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

### Note

Status values of a workflow model:

* `1` = The model is in use, i.e. new processes can be started from it.
* `2` = The model is locked for processing.
* `3` = The model is being processed, but not locked.
* `4` = The model is test released.
* `5` = The model is deleted but still contained in the DB.
* `6` = The model is released but not in use. No new processes can be started from this model, but running processes are still completed.

### See Also

[wfm.ValidateWorkflow](wfm.md#wfm.ValidateWorkflow)

<a id="wfm.CheckJob"></a>

## wfm.CheckJob

This job determines whether reminder and lock periods have expired, and reacts accordingly.
Activities affected by lock periods are activated and the lock periods are removed from the database.
Activities affected by reminder periods are marked as delayed and the corresponding defined action (email message, forward to substitute, etc.) is performed.

> **Note:** This job is regularly executed by the workflow engine itself as a batch job.

### Return Value

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

<a id="wfm.CompleteWorkItem"></a>

## wfm.CompleteWorkItem

This job transfers the processing data (variables, file) of a work item to the server and forwards the work item depending on the `ActionType` parameter.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `UserId` | STRING | Yes | ID of the user |
| `WorkItemId` | STRING | Yes | Instance of the activity |
| `Parameters` | BASE64 | Yes | List of workflow variables in XML format (see note) |
| `ActionType` | STRING | Yes | Flag indicating what should happen to the activity. +<br>`SEND_BUTTON`: Forward work item. +<br>`STOREONLY`: Changes are saved, but work item is not forwarded. |
| `SendTo` | STRING | Yes | Currently not supported — pass `0`. |
| `File` | BASE64 | Yes | Contains documents of the workflow file in XML format (see note) |
| `DocsDeleted` | STRING | Yes | Comma-separated list of document IDs to be deleted from the WF file |
| `ClientTypeId` | STRING | Yes | ID of the client type used |
| `[RoutingList]` | BASE64 | No | Routing list (see note) |

### Return Value

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

### Notes

**Structure of Parameters**

```xml
<Parameters>
  <Parameter Name="WF_BEARBEITER_1" DataField="9FC5D03089E843F7B2D64F1CC2421418"><![CDATA[Schulze]]></Parameter>
</Parameters>
```
`Parameters` contains a list of workflow variables (`Parameter`):

* `DataField` (STRING): ID of the parameter
* `Name` (STRING): Name of the parameter
* CDATA: Data specifying the content of the parameter

**Structure of File**

```xml
<File>
  <Docs>
    <Doc Id="" Type="" Location="" Workspace="" New="" Deleteable="0" Moveable="2" UseActiveVariant="1"/>
  </Docs>
</File>
```
`File` contains a list of document parameters (`Doc`):

* `Id` (STRING): ID of the document
* `Type` (INT): Type of the document
* `Location` (INT): indicates whether the document is in the SDREL (`Location='1'`) or system archive (`Location='2'`)
* `Workspace` (INT): indicates whether the object is in the info area (`0`) or work area (`1`)
* `New` (INT): indicates whether the object was newly added to the file (`New='1'`)
* `Deleteable` (INT): indicates whether the document can be deleted from the file (`0` = no, `1` = yes)
* `Moveable` (INT): indicates whether the document can be moved within the file (`0` = no, `1` = yes)
* `UseActiveVariant` (INT): indicates whether the active variant should be used for this document (`0` = no, `1` = yes)

**Structure of RoutingList**

```xml
<RoutingList Id="3294B433BFF6454D9C861B86B5A8AD5D"
  ProcessId="BA16C21BB96D46D099E72070BCB644CC"
  ActivityId="3294B433BFF6454D9C861B86B5A8AD5D" Expandable="1">
  <Entries>
    <Entry Nr="203" Expandable="1">
      <Item Id="99825B18A8334987935684FDA3D6A40D"
        ActivityId="6EE4490A48164A0FA6DC34A80099AF66" ActivityName="Create invoice"
        ModelActivityName="Create invoice" Remark="" TimerId="" TimerDuration=""
        TimerDurationType="" Changeable="1" Deleteable="0">
        <ObjectIds></ObjectIds>
      </Item>
    </Entry>
    <Entry Nr="253" Expandable="1">
      <Item Id="E15594D692C14FDA9AFDE8FA0A43F6E4"
        ActivityId="6EE4490A48164A0FA6DC34A80099AF67" ActivityName="Approve invoice BL"
        ModelActivityName="Approve invoice" Remark="" TimerId="" TimerDuration=""
        TimerDurationType="" Changeable="1" Deleteable="0">
        <ObjectIds></ObjectIds>
      </Item>
      <Item Id="C6DA9503CD874D69A9B703D0E06A52E8"
        ActivityId="6EE4490A48164A0FA6DC34A80099AF67" ActivityName="Approve invoice GF"
        ModelActivityName="Approve invoice" Remark="" TimerId="" TimerDuration=""
        TimerDurationType="" Changeable="1" Deleteable="0">
        <ObjectIds></ObjectIds>
      </Item>
    </Entry>
  </Entries>
</RoutingList>
```
`RoutingList` — Routing list with the following structure:

* `Id` (STRING): ID of the routing list. This value is set by the server and must not be changed.
* `ProcessId` (STRING): Process ID
* `ActivityId` (STRING): Activity ID
* `Expandable` (INT): `0` = routing list cannot be expanded, `1` = routing list can be expanded
* `Entries`: groups entries of the routing list; an entry consists of multiple elements that can be executed in parallel
* `Entry`: describes an entry in the routing list
** `Nr` (INT): used for relative sorting of entries within the routing list
** `Expandable` (INT): `0` = entry cannot be expanded, `1` = entry can be expanded
* `Item`: describes an item in the routing list (an activity, a performer and possibly a deadline)
** `Id` (STRING): used for identification; must not be changed
** `ActivityId` (STRING): ID of the activity in the workflow model
** `ActivityName` (STRING): Name of the activity (need not match the name in the workflow model)
** `ActivityModelName` (STRING): Name of the activity in the workflow model
** `TimerId` (STRING): ID of a reminder period
** `TimerDuration` (INT): Duration of the period
** `TimerDurationType` (INT): `0` = no period, `1` = relative, `2` = absolute
** `Changeable` (INT): `0` = no changes possible, `1` = item can be modified by client
** `Deleteable` (INT): `0` = deletion not allowed, `1` = item can be deleted
** `Remark` (STRING): Note for processing (text)
** `ObjectIds` (STRING): List of GUIDs of performers (roles or persons), separated by commas

<a id="wfm.ConfigUserAbsence"></a>

## wfm.ConfigUserAbsence

This job defines one or more users as absent/present and notifies all servers and enaio® editor-for-workflow.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | Organization of the users |
| `Users` | BASE64 | Yes | User list in XML format (see below) |

### Return Value

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

### Example

Structure of `Users`:

```xml
<Users>
  <User Id="" Absent="1"/>
  <User Id="" Absent="0"/>
</Users>
```
`User` structure with the following attributes:

* `Id` (STRING): ID of the user
* `Absent` (INT): Flag
** `0` = user is present
** `1` = user is absent

### See Also

[wfm.GetOrganisations](wfm.md#wfm.GetOrganisations),
[wfm.GetOrganisationObjects](wfm.md#wfm.GetOrganisationObjects),
[wfm.GetAbsentUsers](wfm.md#wfm.GetAbsentUsers)

<a id="wfm.ConvertExportFile"></a>

## wfm.ConvertExportFile

This job converts an export file to the current format (e.g. from 4.20 to 4.50).
The export file must be attached to the job.
The result file is then transmitted with the response.

### Input Files

| Name | Description |
|---|---|
| Export file | Name and path of the workflow export file to be converted |

### Return Value

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

### Output Files

| Name | Description |
|---|---|
| Export file (converted) | Name and path of the converted workflow export file |

<a id="wfm.CopyWorkflow"></a>

## wfm.CopyWorkflow

This job creates a copy of a workflow model including the workflow masks and events.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `UserId` | STRING | Yes | ID of the executing user |
| `SourceOrganisationId` | STRING | Yes | ID of the organization to copy from |
| `SourceWorkflowId` | STRING | Yes | ID of the workflow model to be copied |
| `TargetOrganisationId` | STRING | Yes | ID of the organization to copy to |
| `TargetFamilyId` | STRING | Yes | ID of the workflow family to copy to |
| `TargetWorkflowName` | STRING | Yes | Name of the new workflow |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `WorkflowId` | STRING | — | ID of the new workflow model |

### Return Value

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

<a id="wfm.CreateProcessInstance"></a>

## wfm.CreateProcessInstance

This job creates a process of the specified workflow family if the specified user has the right to execute the workflow. The created process instance can then be started using the job [wfm.StartProcess](wfm.md#wfm.StartProcess).

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `UserId` | STRING | Yes | ID of the user |
| `OrganisationId` | STRING | Yes | ID of the organization |
| `WorkflowId` | STRING | Yes | ID of the workflow family |
| `ClientTypeId` | STRING | Yes | ID of the client type used |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `ProcessId` | STRING | — | ID of the newly created process |

### Return Value

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

### See Also

[wfm.GetWorkflowList](wfm.md#wfm.GetWorkflowList), [wfm.StartProcess](wfm.md#wfm.StartProcess)

<a id="wfm.DBCommands"></a>

## wfm.DBCommands

This job executes cached database commands. The job is generally not called externally.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| DBCommandsId | STRING | Yes | GUID of the database command to be executed in the DB commands cache |

### Return Value

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

<a id="wfm.DeleteEvent"></a>

## wfm.DeleteEvent

This job deletes one or more workflow events of a specific workflow model.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |
| `WorkflowId` | STRING | Yes | ID of the workflow model |
| `EventIds` | STRING | Yes | Comma-separated GUID list of events to delete |
| `ClientTypeId` | STRING | Yes | ID of the client type used |

### Return Value

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

### See Also

[wfm.GetEvents](wfm.md#wfm.GetEvents)

<a id="wfm.DeleteMasks"></a>

## wfm.DeleteMasks

This job deletes one or more workflow masks of a specific workflow model.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |
| `WorkflowId` | STRING | Yes | ID of the workflow model |
| `MaskIds` | STRING | Yes | Comma-separated GUID list of masks to delete |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `OrganisationId` | STRING | — | ID of the organization |
| `WorkflowId` | STRING | — | ID of the workflow model |
| `MaskIds` | STRING | — | Comma-separated GUID list of masks that could not be deleted |

### Return Value

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

<a id="wfm.DeleteOrganisation"></a>

## wfm.DeleteOrganisation

This job deletes an organization. All database entries relating to the organization are deleted from the database (including organization structure and workflow models).

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |

### Return Value

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

### See Also

[wfm.GetOrganisations](wfm.md#wfm.GetOrganisations)

<a id="wfm.DeleteScript"></a>

## wfm.DeleteScript

This job deletes a script registered for a workflow event.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |
| `WorkflowId` | STRING | Yes | ID of the workflow |
| `ScriptId` | STRING | Yes | ID of the script |

### Return Value

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

<a id="wfm.DeleteSysClienttypes"></a>

## wfm.DeleteSysClienttypes

This job deletes the specified client types.

> **Note:** Job not yet implemented.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| ClientTypeIds | STRING | Yes | Comma-separated GUIDs of client types to delete |

### Return Value

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

### See Also

[wfm.GetSysClienttypes](wfm.md#wfm.GetSysClienttypes)

<a id="wfm.DeleteWorkflow"></a>

## wfm.DeleteWorkflow

This job deletes a workflow model and associated history entries from the database and notifies all other servers.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization of the workflow model |
| `WorkflowId` | STRING | Yes | ID of the workflow model |

### Return Value

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

<a id="wfm.Export"></a>

## wfm.Export

This job exports organization structure, workflow projects and/or workflows.

### Input Parameters

| Name | Type | Required | Description |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| OrganisationId | STRING | Yes | ID of the organization to export from | OrgDoExport | INT | Yes | Flag: indicates whether organization data should also be exported (1 = Yes, 0 = No) | WFProjectTree | BASE64 | Yes | Structure indicates which projects and workflow models should be exported (XML format, see note) | ReportConfigDoExport | INT | Yes | Flag: indicates whether report configurations of the organization should be exported | ReportConfigIds | STRING | Yes | Comma-separated list of report configuration IDs to export. If `ReportConfigDoExport = 1` and this list is empty, all configurations of the organization are exported. | AdhocRoutingListTemplateDoExport | INT | Yes | Flag: indicates whether routing list templates of the organization should be exported | AdhocRoutingListTemplateIds | STRING | Yes | Comma-separated ID list of routing list templates to export. If `AdhocRoutingListTemplateDoExport = 1` and this list is empty, all routing list templates of the organization are exported. |

### Return Value

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

### Output Files

| Name | Description |
|---|---|
| Export file | Name and path of the export file |

### Note

Structure of `WFProjectTree`:

```xml
<WFProjectTree>
  <WorkflowProject Id="" CompleteExport="0">
    <WorkflowProject Id="">
      <WorkflowProject Id="" CompleteExport="0">
        <Workflow Id=""/>
        <Workflow Id=""/>
      </WorkflowProject>
    </WorkflowProject>
    <WorkflowProject Id="" CompleteExport="1"/>
    <WorkflowProject Id="" CompleteExport="1">
      <Workflow Id=""/>
      <Workflow Id=""/>
    </WorkflowProject>
  </WorkflowProject>
</WFProjectTree>
```
Detailed description of `WFProjectTree`:

* `WorkflowProject`: Structure (possibly nested) indicating which workflow project (which may also be a workflow family) should be exported

** `Id` (STRING): ID of the workflow project

** `CompleteExport` (INT): Flag indicating whether all projects or workflows hanging under the project should be exported. If set, the sub-structure does not need to be specified further.

* `Workflow`: Structure indicating which workflow should be exported

** `Id` (STRING): ID of the workflow

### See Also

[wfm.Import](wfm.md#wfm.Import)

<a id="wfm.GetAbsentUsers"></a>

## wfm.GetAbsentUsers

This job determines all users of an organization who are marked as absent.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `ObjectIds` | STRING | — | GUIDs of the absent user objects, separated by comma |

### Return Value

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

### See Also

[wfm.GetOrganisations](wfm.md#wfm.GetOrganisations),
[wfm.ConfigUserAbsence](wfm.md#wfm.ConfigUserAbsence)

<a id="wfm.GetActivityPerformers"></a>

## wfm.GetActivityPerformers

This job returns all users/roles assigned as participants to the specified activity.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `RActivityId` | STRING | Yes | Instance ID of the activity |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `ObjectIds` | BASE64 | — | List of roles/users in XML format (see note) |
| `OrganisationId` | STRING | — | ID of the organization to which the roles/users belong |

### Return Value

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

### Note

**Structure of ObjectIds**

```xml
<Objects>
  <Object Id="E95EF24F6C6AE1A40F" Absent="0" Substitute="0" Flag="1"/>
  <Object Id="8FDD6BCB06CE478699" Absent="0" Substitute="0" Flag="1"/>
  <Object Id="A7286EA0463F382057" Absent="0" Substitute="0" Flag="1"/>
</Objects>
```
`Object` — Structure with the following content:

* `Id` (STRING): ID of the object
* `Absent` (INT): Flag indicating whether the person is absent (`1`) or present (`0`)
* `Substitute` (INT): Flag indicating whether the person sees the activity as substitute (`1`)
* `Flag` (INT):
** `1` = user is directly assigned to the work item (not via role)
** `2` = user sees the work item in his inbox
** `4` = work item is personalized by this user

### See Also

[wfm.SetActivityPerformers](wfm.md#wfm.SetActivityPerformers)

<a id="wfm.GetEvents"></a>

## wfm.GetEvents

This job returns the list of all established events for an activity or the entire workflow model.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |
| `WorkflowId` | STRING | Yes | ID of the workflow model |
| `ActivityId` | STRING | Yes | ID of the activity. If this parameter is left empty, all events of the workflow model are returned. |
| `ClientTypeId` | STRING | Yes | ID of the client type used. If this parameter is left empty, events for all defined client types are returned. |
| `EventTypeGroups` | INT | Yes | Combinable flag indicating which events are requested. +<br>`1` = all client events are returned +<br>`2` = the global client script is returned +<br>`4` = all server events are returned +<br>`8` = the global server script is returned +<br>`15` = all events are returned |
| `Code` | INT | Yes | `0` = no script code is transferred; `1` = script code is transferred |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Events` | BASE64 | — | Requested event list in XML format (see note) |

### Return Value

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

### See Also

[wfm.SaveEvent](wfm.md#wfm.SaveEvent), [wfm.DeleteEvent](wfm.md#wfm.DeleteEvent)

### Note

**Structure of Events**

```xml
<Events>
  <Event>
    <Id></Id>
    <EventType></EventType>
    <ActivityId></ActivityId>
    <Params></Params>
    <Description></Description>
    <ClientTypeId></ClientTypeId>
    <Script Id="" Name="" Time="" Description="" ScriptLanguage="1">Skript</Script>
  </Event>
</Events>
```
`Event` — contains additional elements and the `Script` structure:

* `Id` (STRING): ID of the event
* `EventType` (INT): Type of the event +
`1` = BeforeForward, `2` = AfterForward, `3` = BeforeForwardTo, `4` = ButtonClick, +
`5` = BeforeOpen, `6` = AfterSignature, `7` = BeforeCancel, `8` = SimulateMaskEdit, +
`10000` = StartActivity, `10001` = EndActivity, `10003` = PersonalizeWorkItem, +
`10004` = GetWorkItemParams, `1000000` = Global server script, `1000001` = Global client script
* `Params`: for event type `ButtonClick` this contains the ID of the button
* `Description` (STRING): Currently not supported — pass `0`.
* `ActivityId` (STRING): ID of the activity for which the event was created
* `ClientTypeId` (STRING): ID of the client type for which the event was created
* `Script`: Structure containing the script:
** `Id` (STRING): ID of the script
** `Name` (STRING): Name of the script
** `Time` (INT): Creation time of the script
** `Description` (STRING): Currently not supported — pass `0`.
** `ScriptLanguage` (INT): Script language (`1` = VB-Script, `2` = J-Script)
** CDATA: Data (contains the script code)

<a id="wfm.GetEventtypes"></a>

## wfm.GetEventtypes

This job returns all available event types.

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `EventTypes` | BASE64 | — | All event types in XML format (see note) |

### Return Value

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

### Note

**Structure of EventTypes**

```xml
<EventTypes>
  <EventType Id="1" Name="BeforeForward"/>
  <EventType Id="2" Name="AfterForward"/>
  <EventType Id="3" Name="BeforeForwardTo"/>
  <EventType Id="4" Name="ButtonClick"/>
  <EventType Id="5" Name="BeforeOpen"/>
  <EventType Id="6" Name="AfterSignature"/>
  <EventType Id="7" Name="BeforeCancel"/>
  <EventType Id="8" Name="SimulateMaskEdit"/>
  <EventType Id="10000" Name="StartActivity"/>
  <EventType Id="10001" Name="EndActivity"/>
  <EventType Id="10002" Name="BeforeStartSubProc"/>
  <EventType Id="10003" Name="PersonalizeWorkItem"/>
  <EventType Id="10004" Name="GetWorkItemParams"/>
  <EventType Id="10005" Name="CancelWorkItem"/>
</EventTypes>
```
`EventType` — structure characterizing an event type:

* `Id` (STRING): ID of the event type
* `Name` (STRING): Name of the event type

<a id="wfm.GetGlobalScripts"></a>

## wfm.GetGlobalScripts

This job returns the global scripts for a workflow model.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `WorkflowId` | STRING | Yes | ID of the workflow model |
| `OrganisationId` | STRING | Yes | ID of the organization |
| `Code` | INT | Yes | `0` = no script code is returned; `1` = script code is returned |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Scripts` | BASE64 | — | The global scripts in XML format (see note) |

### Return Value

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

### Note

**Structure of Scripts**

```xml
<Scripts>
  <Script Id="" Type="2"><![CDATA[...]]></Script>
  <Script Id="" Type="3"><![CDATA[...]]></Script>
</Scripts>
```
`Script` — structure characterizing a global script:

* `Id` (STRING): Script ID
* `Type` (INT): indicates whether it is a server script (`2`) or client script (`3`)

<a id="wfm.GetHistActivitiesByProcess"></a>

## wfm.GetHistActivitiesByProcess

This job determines all activities for a historical process.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ProcessId` | STRING | Yes | Historical ID of the process |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Activities` | BASE64 | — | The requested activities in XML format |

### Return Value

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

### Example

Structure of `Activities`:

```xml
<Activities>
  <Activity Id="6EE4490A48164A0FA6DC34A80099AF67" RActivityId="3A25AFD5CBD9B246"
            Name="Step1" EntryNr="10"/>
</Activities>
```
.Fields of `<Activity>`
| Attribute | Type | Description |
|---|---|---|
| `Id` | STRING | ID of the activity in the workflow model |
| `RActivityId` | STRING | Instance ID of the activity |
| `Name` | STRING | Name of the activity |
| `EntryNr` | INT | Reflects the temporal sequence |

### See Also

[wfm.GetHistProcessList](wfm.md#wfm.GetHistProcessList), [wfm.GetHistEntries](wfm.md#wfm.GetHistEntries)

<a id="wfm.GetHistEntries"></a>

## wfm.GetHistEntries

This job determines all performed actions for a historical activity or historical process. When calling the job, attention must be paid that only one of the two parameters is set.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `[ProcessId]` | STRING | No | Historical ID of the process |
| `[RActivityId]` | STRING | No | Historical instance ID of the activity |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `HistoryEntries` | BASE64 | — | The requested actions in XML format |

### Return Value

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

### Example

Structure of `HistoryEntries`:

```xml
<HistoryEntries>
  <HistoryEntry HistId=".." EntryNr=".." ProcessId=".." RActivityId=".."
                HistType=".." Time=".." OrganisationId=".." UserId=".." UserName=".."
                ServerId=".." ServerName=".."/>
  <HistoryEntry HistId=".." EntryNr=".." ProcessId=".." RActivityId=".."
                HistType=".." Time=".." OrganisationId=".." UserId=".." UserName=".."
                ServerId=".." ServerName=".."/>
</HistoryEntries>
```
.Fields of `<HistoryEntry>`
| Attribute | Type | Description |
|---|---|---|
| `HistId` | STRING | ID of the historical entry |
| `EntryNr` | INT | Entry number, reflects the temporal sequence |
| `ProcessId` | STRING | ID of the process |
| `RActivityId` | STRING | Instance ID of the activity (only set when calling via parameter `RActivityId`) |
| `HistType` | INT | Type of the historical entry: |
| `Time` | INT | Time of entry creation |
| `OrganisationId` | STRING | ID of the organization |
| `UserId` | STRING | ID of the user |
| `UserName` | STRING | Name of the user |
| `ServerId` | STRING | ID of the server |
| `ServerName` | STRING | Name of the server |

### See Also

[wfm.GetHistActivitiesByProcess](wfm.md#wfm.GetHistActivitiesByProcess), [wfm.GetHistProcessList](wfm.md#wfm.GetHistProcessList), [wfm.GetHistVariablesByHistEntry](wfm.md#wfm.GetHistVariablesByHistEntry)

<a id="wfm.GetHistProcessList"></a>

## wfm.GetHistProcessList

This job determines all processes for a historical workflow model.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |
| `HistWorkfowId` | STRING | Yes | Historical ID of the model |
| `[ChunkSize]` | INT | No | Number of processes to be returned with a request at most. Default: `0` returns all processes. |
| `[OrderColumn]` | STRING | No | Column by which the result list is sorted. Possible values: `processname`, `creationtime` (default), `endtime`. The process ID is always used as a secondary sorting criterion. |
| `[Order]` | INT | No | Sorting direction: `1` = ascending (default), `2` = descending. |
| `[LastFetchedProcessId]` | STRING | No | Required for paging. The last `ProcessId` returned in the hit list must be passed in the new call to start the list after the previous chunk. Only necessary when specifying `ChunkSize`. |
| `[LastFetchedOrderValue]` | STRING | No | Required for paging. Should be the last value of the sorted column from a previous call with `ChunkSize`. Can be a numeric value or a string. If this parameter is not specified, the value of the column with the corresponding process ID is retrieved. Requires a set `LastFetchedProcessId`. |
| `[States]` | INT | No | Status of processes to be displayed. Other statuses are filtered out. If the parameter is not set or `0`, all statuses are displayed. Values are specified as deprecated:<br>* `0x10 (16)` = TERMINATED<br>* `0x20 (32)` = COMPLETED<br>* `0x30 (48)` = TERMINATED / COMPLETED |
| `[Filter]` | STRING | No | Filter text for the process name. If specified, only processes whose name contains this string anywhere are returned. |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Processes` | BASE64 | — | The requested processes in XML format |

### Return Value

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

### Example

Structure of `Processes`:

```xml
<Processes>
  <Process Id=".." Name=".." FinalSubject=".." UserName=".." CreationTime=".."
           EndTime=".."/>
  <Process Id=".." Name=".." FinalSubject=".." UserName=".." CreationTime=".."
           EndTime=".."/>
</Processes>
```
.Fields of `<Process>`
| Attribute | Type | Description |
|---|---|---|
| `Id` | STRING | ID of the process |
| `Name` | STRING | Name of the process |
| `FinalSubject` | STRING | Last subject of the process |
| `UserName` | STRING | Name of the process creator |
| `CreationTime` | STRING | Start time of the process |
| `EndTime` | STRING | End time of the process |

### See Also

[wfm.GetHistWorkflowList](wfm.md#wfm.GetHistWorkflowList), [wfm.GetHistActivitiesByProcess](wfm.md#wfm.GetHistActivitiesByProcess), [wfm.GetHistEntries](wfm.md#wfm.GetHistEntries), [wfm.GetHistTimersByProcess](wfm.md#wfm.GetHistTimersByProcess)

<a id="wfm.GetHistTimerEntries"></a>

## wfm.GetHistTimerEntries

This job determines all actions (historical entries) for a reminder/lock period.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `TimerId` | STRING | Yes | ID of the timer |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `TimerEntries` | BASE64 | — | The requested actions in XML format |

### Return Value

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

### Example

Structure of `TimerEntries`:

```xml
<TimerEntries>
  <TimerEntry HistId=".." EntryNr=".." ProcessId=".." RActivityId=".."
              HistType=".." Time=".." OrganisationId=".." UserId=".." UserName=".."
              ServerId=".." ServerName=".."/>
</TimerEntries>
```
.Fields of `<TimerEntry>`
| Attribute | Type | Description |
|---|---|---|
| `HistId` | STRING | Historical ID of the entry |
| `EntryNr` | INT | Number of the entry, reflects the temporal sequence |
| `ProcessId` | STRING | ID of the process |
| `RActivityId` | STRING | Instance ID of the activity |
| `HistType` | INT | Type of the historical entry: |
| `Time` | INT | Time of entry creation |
| `OrganisationId` | STRING | ID of the organization |
| `UserId` | STRING | ID of the user |
| `UserName` | STRING | Name of the user who personalized the activity |
| `ServerId` | STRING | ID of the server |
| `ServerName` | STRING | Name of the server |

### See Also

[wfm.GetHistTimersByProcess](wfm.md#wfm.GetHistTimersByProcess)

<a id="wfm.GetHistTimersByProcess"></a>

## wfm.GetHistTimersByProcess

This job determines all reminder/lock periods for a historical process.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ProcessId` | STRING | Yes | Historical ID of the process |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Timers` | BASE64 | — | The requested reminder/lock periods in XML format |

### Return Value

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

### Example

Structure of `Timers`:

```xml
<Timers>
  <Timer TimerId=".." ProcessId=".." FromActivityId=".." FromActivityName=".."
         ToActivityId=".." ToActivityName=".." TimerType=".." DestinationType=".."
         DestinationTime=".." LoopType=".."/>
</Timers>
```
.Fields of `<Timer>`
| Attribute | Type | Description |
|---|---|---|
| `TimerId` | STRING | ID of the reminder/lock period |
| `ProcessId` | STRING | ID of the process |
| `FromActivityId` | STRING | ID of the activity from which the period is valid |
| `FromActivityName` | STRING | Name of the activity from which the period is valid |
| `ToActivityId` | STRING | ID of the activity until which the period is valid |
| `ToActivityName` | STRING | Name of the activity until which the period is valid |
| `TimerType` | INT | Type of the period: |
| `DestinationType` | INT | Reference point of the period: |
| `DestinationTime` | INT | Indicates when the target should be reached |
| `LoopType` | INT | Is always returned as `0` |

### See Also

[wfm.GetHistProcessList](wfm.md#wfm.GetHistProcessList), [wfm.GetHistTimerEntries](wfm.md#wfm.GetHistTimerEntries)

<a id="wfm.GetHistVariablesByHistEntry"></a>

## wfm.GetHistVariablesByHistEntry

This job determines the workflow variables for a history entry.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `HistId` | STRING | Yes | ID of the history entry |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `DataFields` | BASE64 | — | The requested historical variables in XML format |

### Return Value

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

### Example

Structure of `DataFields`:

```xml
<DataFields>
  <DataField Id="123.." Name="strTest">
    <![CDATA[Ich bin ein String]]>
  </DataField>
  <DataField Id="" Name="">
    <![CDATA[]]>
  </DataField>
</DataFields>
```
.Fields of `<DataField>`
| Attribute / Content | Type | Description |
|---|---|---|
| `Id` | STRING | ID of the variable |
| `Name` | STRING | Name of the variable |
| CDATA | — | Value and structure of the variable |

### See Also

[wfm.GetHistEntries](wfm.md#wfm.GetHistEntries)

<a id="wfm.GetHistWorkItemRelActivitiesByProcess"></a>

## wfm.GetHistWorkItemRelActivitiesByProcess

This job determines all activities for a historical process that were placed in an inbox, i.e. were processed by a user.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ProcessId` | STRING | Yes | Historical ID of the process |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Activities` | BASE64 | — | The requested activities in XML format |

### Return Value

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

### Example

Structure of `Activities`:

```xml
<Activities>
  <Activity Id="6EE4490A48164A0FA6DC34A80099AF67" RActivityId="3A25AFD5CBD9B246"
            Name="Step1" EntryNr="10"/>
</Activities>
```
.Fields of `<Activity>`
| Attribute | Type | Description |
|---|---|---|
| `Id` | STRING | ID of the activity in the workflow model |
| `RActivityId` | STRING | Instance ID of the activity |
| `Name` | STRING | Name of the activity |
| `EntryNr` | INT | Entry number, reflects the temporal sequence |

### See Also

[wfm.GetHistProcessList](wfm.md#wfm.GetHistProcessList), [wfm.GetHistWorkItemRelEntriesByActivity](wfm.md#wfm.GetHistWorkItemRelEntriesByActivity)

<a id="wfm.GetHistWorkItemRelEntriesByActivity"></a>

## wfm.GetHistWorkItemRelEntriesByActivity

This job determines all historical entries for the specified work item.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `RActivityId` | STRING | Yes | Instance ID of the activity |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `HistWorkItemRelEntries` | BASE64 | — | The requested entries in XML format |

### Return Value

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

### Example

Structure of `HistWorkItemRelEntries`:

```xml
<HistWorkItemRelEntries>
  <HistWorkItemRelEntry RActivityId="" ActivityName="" OrganisationId=""
                        UserId="" UserName="" Reason="" HistType=""
                        HistId="" EntryNr="" Time=""/>
</HistWorkItemRelEntries>
```
.Fields of `<HistWorkItemRelEntry>`
| Attribute | Type | Description |
|---|---|---|
| `RActivityId` | STRING | Instance ID of the activity |
| `ActivityName` | STRING | Name of the activity |
| `OrganisationId` | STRING | ID of the organization |
| `UserId` | STRING | ID of the user who had the activity in the inbox |
| `UserName` | STRING | Name of the user |
| `Reason` | INT | Reason why the user had the activity in the inbox: |
| `HistType` | INT | Type of the historical entry: |
| `HistId` | STRING | ID of the historical entry |
| `EntryNr` | INT | Reflects the temporal sequence |
| `Time` | INT | Creation time of the entry |

### See Also

[wfm.GetHistWorkItemRelActivitiesByProcess](wfm.md#wfm.GetHistWorkItemRelActivitiesByProcess)

<a id="wfm.GetHistWorkItemRelEntriesByUser"></a>

## wfm.GetHistWorkItemRelEntriesByUser

This job determines all activities processed by the specified user and the associated historical entries of the specified historical process.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ProcessId` | STRING | Yes | Historical ID of the process |
| `UserId` | STRING | Yes | ID of the user |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `HistWorkItemRelEntries` | BASE64 | — | The requested information in XML format |

### Return Value

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

### Example

Structure of `HistWorkItemRelEntries`:

```xml
<HistWorkItemRelEntries>
  <HistWorkItemRelEntry RActivityId="" ActivityName="" OrganisationId=""
                        UserId="" UserName="" Reason="" HistType=""
                        HistId="" EntryNr="" Time=""/>
</HistWorkItemRelEntries>
```
.Fields of `<HistWorkItemRelEntry>`
| Attribute | Type | Description |
|---|---|---|
| `RActivityId` | STRING | Instance ID of the activity |
| `ActivityName` | STRING | Name of the activity |
| `OrganisationId` | STRING | ID of the organization |
| `UserId` | STRING | ID of the user who had the activity in the inbox |
| `UserName` | STRING | Name of the user |
| `Reason` | INT | Reason why the user had the activity in the inbox: |
| `HistType` | INT | Type of the historical entry: |
| `HistId` | STRING | ID of the historical entry |
| `EntryNr` | INT | Reflects the temporal sequence |
| `Time` | INT | Creation time of the entry |

### See Also

[wfm.GetHistProcessList](wfm.md#wfm.GetHistProcessList)

<a id="wfm.GetHistWorkItemRelUsersByProcess"></a>

## wfm.GetHistWorkItemRelUsersByProcess

This job determines all users or roles for which work items of the specified historical process were placed in inboxes.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ProcessId` | STRING | Yes | Historical ID of the process |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Users` | BASE64 | — | The requested users in XML format |

### Return Value

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

### Example

Structure of `Users`:

```xml
<Users>
  <User UserId=".." UserName=".."/>
  <User UserId=".." UserName=".."/>
</Users>
```
.Fields of `<User>`
| Attribute | Type | Description |
|---|---|---|
| `UserId` | STRING | ID of the user or role |
| `UserName` | STRING | Name of the user or role |

### See Also

[wfm.GetHistProcessList](wfm.md#wfm.GetHistProcessList)

<a id="wfm.GetHistWorkflowList"></a>

## wfm.GetHistWorkflowList

This job determines all workflow models in the history management and the number of processes started from the workflow model.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Workflows` | BASE64 | — | The requested workflow models in XML format |

### Return Value

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

### Example

Structure of `Workflows`:

```xml
<Workflows>
  <Workflow Id="18268F5E1F532" HistWorkfowId="04DC0D15A62A4" Name="test"
            ProcessCount="3" Version="70" FamilyId="0774DC0D15A62A4"
            FamilyName="testfam"/>
  <Workflow Id="39418268F5532" HistWorkfowId="0BFB9FF2D225E7" Name="test"
            ProcessCount="1" Version="83" FamilyId="T0774DC0D15A62"
            FamilyName="testfamilie"/>
</Workflows>
```
.Fields of `<Workflow>`
| Attribute | Type | Description |
|---|---|---|
| `Id` | STRING | ID of the workflow model |
| `HistWorkfowId` | STRING | Historical ID of the workflow model |
| `Name` | STRING | Name of the workflow model |
| `ProcessCount` | INT | Indicates how often the workflow model was started |
| `Version` | INT | Version number of the workflow model |
| `FamilyId` | STRING | GUID of the associated workflow family |
| `FamilyName` | STRING | Name of the associated workflow family |

### See Also

[wfm.GetOrganisations](wfm.md#wfm.GetOrganisations), [wfm.GetHistProcessList](wfm.md#wfm.GetHistProcessList)

<a id="wfm.GetOrganisationClasses"></a>

## wfm.GetOrganisationClasses

This job returns information about the classes of an organization.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |
| `RequestType` | INT | Yes | Flag specifying the request — the following parameters must be set accordingly: +<br>`0` = search for all classes +<br>`1` = search by IDs in parameter `ClassIds` +<br>`2` = search by names in parameter `ClassName` |
| `ClassIds` | STRING | Yes | Comma-separated list of class IDs (relevant when `RequestType` = 1) |
| `ClassName` | STRING | Yes | Class name (relevant when `RequestType` = 2) |
| `AttributeId` | STRING | Yes | Currently not supported — pass `0`. |
| `RequestData` | INT | Yes | Specifies the results of the request: +<br>`1` = only index data of the classes determine (object ID, name, class ID) +<br>`3` = index data and class attributes determine +<br>`5` = index data and class relationships determine +<br>`7` = index data, class attributes and class relationships determine |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Classes` | BASE64 | — | Information about the requested classes in XML format (see below) |

### Return Value

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

### Example

Structure of `Classes`:

```xml
<Classes>
  <Class Id="10B9A20E90244BB9B701354C1AB84F8A" Name="Department">
    <Attributes/>
    <ParentObjects>
      <ParentObject Id="894CB679F2ED480A89107BF33A1F" Name="Organization"/>
    </ParentObjects>
    <ChildClasses>
      <ChildClass Id="12AA95D1D8244E6BB56C70A8D5CEE675" Name="Role"/>
    </ChildClasses>
  </Class>
  <Class Id="9AB24246BB9040A29FCD6015CF4F4BD9" Name="Person">
    <Attributes>
      <Attribute Id="33D4AB4B39" Name="Last Name" AttributeClassId="07F405D">
        <AttributeValue><![CDATA[]]></AttributeValue>
      </Attribute>
    </Attributes>
    <ParentObjects>
      <ParentObject Id="12AA95D1D8244E6BB56C70A8D5CEE675" Name="Role"/>
    </ParentObjects>
    <ChildClasses/>
  </Class>
</Classes>
```
Description of the XML structure:

* `Class`: Information about an organization class
** `Id` (STRING): ID of the class
** `Name` (STRING): Name of the class

* `Attribute`: Information about an object attribute
** `Id` (STRING): ID of the attribute
** `Name` (STRING): Name of the attribute
** `AttributeClassId` (STRING): Attribute class ID of the attribute
** `AttributeValue`: CDATA with attribute value, possibly MIME-encoded

* `ParentObject`: Organization object that stands directly above the current class in the organization tree
** `Id` (STRING): ID of the object
** `Name` (STRING): Name of the object

* `ChildClass`: Organization object that stands directly under the current class in the organization tree
** `Id` (STRING): ID of the object
** `Name` (STRING): Name of the object

### See Also

[wfm.GetOrganisations](wfm.md#wfm.GetOrganisations),
[wfm.GetOrganisationObjects](wfm.md#wfm.GetOrganisationObjects)

<a id="wfm.GetOrganisationObjects"></a>

## wfm.GetOrganisationObjects

This job returns information about the objects in an organization.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |
| `RequestType` | INT | Yes | Flag specifying the request — the following parameters must be set accordingly: +<br>`0` = search for all objects +<br>`1` = search by IDs in parameter `ObjectIds` +<br>`2` = search by names in parameter `ObjectName` +<br>`3` = search by IDs in parameter `ClassIds` +<br>`4` = search by names in parameter `ClassName` +<br>`5` = search for parent objects by names in parameter `ObjectName` +<br>`6` = search for child objects by names in parameter `ObjectName` +<br>`7` = search for parent objects by names in parameter `ClassName` +<br>`8` = search for child objects by names in parameter `ClassName` |
| `ObjectIds` | STRING | Yes | Comma-separated list of object IDs (relevant when `RequestType` = 1) |
| `ObjectName` | STRING | Yes | Object name (relevant when `RequestType` = 2, 5, 6) |
| `ClassIds` | STRING | Yes | Comma-separated list of class IDs (relevant when `RequestType` = 3) |
| `ClassName` | STRING | Yes | Class name (relevant when `RequestType` = 4, 7, 8) |
| `AttributeId` | STRING | Yes | Currently not supported — pass `0`. |
| `AttributeValue` | STRING | Yes | Currently not supported — pass `0`. |
| `RequestData` | INT | Yes | Specifies the results of the request: +<br>`1` = only index data of the objects determine (object ID, name, class ID) +<br>`3` = index data and object attributes determine +<br>`5` = index data and parent and child objects determine +<br>`7` = index data, object attributes and parent and child objects determine |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Objects` | BASE64 | — | Information about the requested objects in XML format (see below) |

### Return Value

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

### Example

Structure of `Objects`:

```xml
<Objects>
  <Object Id="" Name="" ClassId="">
    <Attributes>
      <Attribute Id="" Name="" AttributeClassId="">
        <AttributeValue><![CDATA[]]></AttributeValue>
      </Attribute>
    </Attributes>
    <ParentObjects>
      <ParentObject Id="" Name="" ClassId=""/>
    </ParentObjects>
    <ChildObjects>
      <ChildObject Id="" Name="" ClassId=""/>
    </ChildObjects>
  </Object>
</Objects>
```
Description of the XML structure:

* `Object`: Information about an organization object
** `Id` (STRING): ID of the object
** `Name` (STRING): Name of the object
** `ClassId` (STRING): Class ID of the object

* `Attribute`: Information about an object attribute
** `Id` (STRING): ID of the attribute
** `Name` (STRING): Name of the attribute
** `AttributeClassId` (STRING): Attribute class ID of the attribute
** `AttributeValue`: CDATA with attribute value, possibly MIME-encoded

* `ParentObject`: Organization object that stands directly above the current object in the organization tree
** `Id` (STRING): ID of the object
** `Name` (STRING): Name of the object
** `ClassId` (STRING): Class ID of the object

* `ChildObject`: Organization object that stands directly under the current object in the organization tree
** `Id` (STRING): ID of the object
** `Name` (STRING): Name of the object
** `ClassId` (STRING): Class ID of the object

### See Also

[wfm.GetOrganisations](wfm.md#wfm.GetOrganisations),
[wfm.GetOrganisationClasses](wfm.md#wfm.GetOrganisationClasses)

<a id="wfm.GetOrganisations"></a>

## wfm.GetOrganisations

This job returns all defined organizations and indicates which organization is activated. Only one organization can be activated at a time via the enaio® editor-for-workflow.

### Input Parameters

This job does not expect any input parameters.

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Organisations` | BASE64 | — | Information about all available organizations in XML format (see <<organisations-xml>>). The value is transmitted BASE64-encoded by the server; after decoding, the content is UTF-8-encoded XML. |

### Return Value

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

### Structure of `Organisations`

```xml
<Organisations>
  <Organisation Id="1" Name="Standard" Active="1"/>
  <Organisation Id="2" Name="Archiv" Active="0"/>
</Organisations>
```

#### Attributes of `Organisation`

| Attribute | Type | Description |
|---|---|---|
| `Id` | STRING | Unique ID of the organization. Used as an input parameter for other `wfm.*` jobs, e.g. `OrganisationId` in [wfm.GetAbsentUsers](wfm.md#wfm.GetAbsentUsers) or [wfm.GetOrganisationClasses](wfm.md#wfm.GetOrganisationClasses). |
| `Name` | STRING | Display name of the organization, as configured in the enaio® editor-for-workflow. |
| `Active` | INT | Indicates whether the organization is active (`1`) or not (`0`). It is guaranteed server-side that exactly one organization carries the value `1`. |

### Notes

* Exactly one organization is always active. This invariant is enforced server-side by the enaio® editor-for-workflow.
* If the workflow engine (`wfm`) is not licensed or not loaded, the job fails with an error code — no empty list is returned.

### See Also

* [wfm.SetActiveOrganisation](wfm.md#wfm.SetActiveOrganisation) — Activates a specific organization
* [wfm.GetAbsentUsers](wfm.md#wfm.GetAbsentUsers) — Retrieves absent users of an organization (expects `OrganisationId`)
* [wfm.GetOrganisationClasses](wfm.md#wfm.GetOrganisationClasses) — Returns the classes of an organization
* [wfm.GetOrganisationObjects](wfm.md#wfm.GetOrganisationObjects) — Returns the objects in an organization class
* [wfm.SaveOrganisation](wfm.md#wfm.SaveOrganisation) — Saves an organization
* [wfm.DeleteOrganisation](wfm.md#wfm.DeleteOrganisation) — Deletes an organization

<a id="wfm.GetProcessFile"></a>

## wfm.GetProcessFile

This job returns the file for a process.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ProcessId` | STRING | Yes | ID of the process. |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `File` | BASE64 | — | The file for the process in XML format (see note). |

### Return Value

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

### Note

**Structure of File**

```xml
<File>
  <Docs>
    <Doc Id="45" Type="23" Location="1" Workspace="0" New="1"
         Deleteable="1" Moveable="2" UseActiveVariant="0"
         OriginalId="42" Display="1"/>
  </Docs>
</File>
```
Detailed description of `Doc`:

* `Id` (STRING): ID of the document
* `Type` (INT): Type of the document
* `Location` (INT): indicates whether the document is in the SDREL (`1`, SDREL is the database table root document relations) or system archive (`2`)
* `Workspace` (INT): indicates whether the object is in the info area (`0`) or work area (`1`)
* `New` (INT): indicates whether the object was newly added to the file (`1` = yes)
* `Deleteable` (INT): indicates whether the document can be deleted from the file (0 = no, 1 = yes)
* `Moveable` (INT): indicates whether the document can be moved within the file (0 = no, 1 = yes)
* `UseActiveVariant` (INT): indicates whether the active variant should be used for the object (0 = no, 1 = yes)
* `OriginalId` (INT): indicates which document was originally dragged into the file (what ID this document had)
* `Display` (INT): indicates whether this document should be displayed in the preview (0 = no, 1 = yes)

<a id="wfm.GetProcessList"></a>

## wfm.GetProcessList

This job returns a list of processes, where the status can be specified.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Flags` | INT | Yes | Combined flag indicating the possible statuses of the processes to query. +<br>`1` = CSPROCESS_INIT +<br>`2` = CSPROCESS_RUNNING +<br>`4` = CSPROCESS_SUSPENDED +<br>`8` = CSPROCESS_ACTIVE +<br>`16` = CSPROCESS_TERMINATED +<br>`32` = CSPROCESS_COMPLETED |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Processes` | BASE64 | — | Information about the requested processes in XML format (see note) |

### Return Value

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

### Note

**Structure of Processes**

```xml
<Processes>
  <Process>
    <Id>9E813BD6D4054B6ABD9385A804FEA398</Id>
    <Name>test 231</Name>
    <Subject>Test (€42)</Subject>
    <State>2</State>
    <CreatorId>8FDD6BCB06CE467FAE8885E81F078699</CreatorId>
    <CreationTime>1077888972</CreationTime>
  </Process>
</Processes>
```
`Process` — structure with the following content:

* `Id` (STRING): ID of the process
* `Name` (STRING): Name of the process
* `State` (INT): Status of the process
* `CreatorId` (STRING): ID of the process creator
* `CreationTime` (INT): Creation time of the process

<a id="wfm.GetProcessListByObject"></a>

## wfm.GetProcessListByObject

This job returns a list of processes that have a specific object in their file.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |
| `ObjectId` | INT | Yes | ID of the object |
| `[UserId]` | STRING | No | ID of the user from the organization structure |
| `[AllProcesses]` | INT | No | If `1`, ended processes are also determined. Otherwise, only running processes are returned. Default: `0`. |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Processes` | BASE64 | — | Information about the requested processes in XML format (see note) |

### Note

**Structure of Processes**

```xml
<Processes>
  <Process
    Id="9E813BD6D4054B6ABD9385A804FEA398"
    Name="test 231"
    Subject="Test (€42)"
    State="2"
    CreatorId="8FDD6BCB06CE467FAE8885E81F078699"
    CreationTime="1077888972"
    ProcessResponsible="0"/>
</Processes>
```
`Process` — structure with the following content:

* `Id` (STRING): ID of the process
* `Name` (STRING): Name of the process
* `State` (INT): Status of the process
* `CreatorId` (STRING): ID of the process creator
* `CreationTime` (INT): Creation time of the process
* `ProcessResponsible` (INT): `1` = the requesting user is the process responsible for this process; `0` = otherwise

<a id="wfm.GetProcessProtocol"></a>

## wfm.GetProcessProtocol

This job returns the protocol file for a process.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ProcessId` | STRING | Yes | ID of the process |

### Output Files

| Name | Description |
|---|---|
| Protocol file | Name and path of the process protocol file |

### Return Value

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

<a id="wfm.GetProcessResponsibles"></a>

## wfm.GetProcessResponsibles

This job returns the responsibles for the specified process.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ProcessId` | STRING | Yes | ID of the process |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `ProcessId` | STRING | — | ID of the organization of the process |
| `Responsibles` | STRING | — | Comma-separated ID list of process responsibles |

### Return Value

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

### See Also

[wfm.SetProcessResponsibles](wfm.md#wfm.SetProcessResponsibles)

<a id="wfm.GetProjectList"></a>

## wfm.GetProjectList

This job returns all workflow projects from an organization.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | GUID of the organization |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Projects` | BASE64 | — | List of all workflow projects in XML format (see note) |

### Return Value

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

### Note

**Structure of Projects**

```xml
<Projects>
  <Project Id="" Name="" Type="" CreatorId="" CreationTime="" Description=""/>
  <Project Id="" Name="" Type="" CreatorId="" CreationTime="" Description=""/>
</Projects>
```
`Project` — structure with the following attributes:

* `Id` (STRING): ID of the project
* `Name` (STRING): Name of the project
* `Type` (INT): 1 = root project, 2 = workflow project, 3 = workflow family
* `CreatorId` (STRING): GUID of the creator
* `CreationTime` (INT): Creation time
* `Description` (STRING): Description

<a id="wfm.GetRunningActivities"></a>

## wfm.GetRunningActivities

Returns only activities currently in the _started_ state for the given user. Activities that are merely personalised but not yet started are not included — for the full tray, see [wfm.GetWorkItemList](wfm.md#wfm.GetWorkItemList).

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING (GUID) | Yes | ID of the organisation. Must be set — an empty value yields error `-1043267169` with the message `GUID 'OrganisationId' is not set`. |
| `UserId` | STRING (GUID) | Yes | Workflow-organisation user object ID (NOT the user ID — resolve via [wfm.GetOrganisationObjects](wfm.md#wfm.GetOrganisationObjects) filtered by the user class ID). Must be set — an empty value yields error `-1043267169` with the message `GUID 'UserId' is not set`. |
| `ClientTypeId` | STRING (GUID) | Yes | ID of the client type used. Must be set — an empty value yields error `-1043267169` with the message `GUID 'ClientTypeId' is not set`. |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `RunningActivities` | BASE64 | — | List of data for all running activities of the user in XML format (see note) |

### Return Value

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

### Note

**Structure of RunningActivities**

```xml
<RunningActivities>
  <RunningActivity>
    <Activity Id="" RActivityId="" Name="" State="" ClosureTime="" OverTime=""
      ReminderTime="" CanCancel=""/>
    <User Name=""/>
    <Process Id="" Name="" WorkflowId="" Subject="" CreationTime="" IconId="" ObjectId=""/>
    <Columns>
      <Column DisplayName="" Value="" Position=""/>
    </Columns>
  </RunningActivity>
  <Resources/>
</RunningActivities>
```
`RunningActivity` — structure with the following elements:

* `Activity`: describes a running activity
** `Id` (STRING): ID of the activity in the model
** `RActivityId` (STRING): instance ID of the activity
** `Name` (STRING): name of the activity
** `State` (INT): status of the activity
** `ClosureTime` (INT): lock period — indicates how long the activity is still locked
** `OverTime` (INT): flag indicating whether the activity should have been completed (`1`)
** `ReminderTime` (INT): reminder period — indicates until when the activity should be completed
** `CanCancel` (INT): currently not supported — pass `0`.
* `User`:
** `Name` (STRING): name of the user who personalized
* `Process`: describes the associated process
** `Id` (STRING): ID of the process
** `Name` (STRING): name of the process
** `WorkflowId` (STRING): ID of the workflow
** `Subject` (STRING): subject of the process
** `CreationTime` (INT): creation time of the process
** `IconId` (INT): icon ID of the workflow model
** `ObjectId` (STRING): ID of the document to be displayed in preview by clients
* `Columns`: list of elements of type `Column`
** `Column`: used for displaying workflow variables
*** `DisplayName` (STRING): the variable should be displayed under this name
*** `Value`: value of the variable
*** `Position` (INT): determines the order of the elements
* `Resources`: carries localisations for `ResId` references (e.g. column names). Present even when the result list is empty — a response containing only `<Resources/>` as a child of `<RunningActivities>` means "no hits" and is not an error indication.

### Edge Cases

* Empty value in any of the three GUID parameters (`OrganisationId`, `UserId`, `ClientTypeId`) → error code `-1043267169` with message `"GUID '<parameter name>' is not set"` (see [Error Codes](errorcodes.md)).
* Distinction from [wfm.GetWorkItemList](wfm.md#wfm.GetWorkItemList): `GetRunningActivities` returns a strict subset — only activities in the _started_ state. A work item that sits in the inbox and is personalised (`Activity.State` includes bit `128`) but has not yet been started will not appear here.
* An empty response still contains a `<Resources/>` element next to the root element — that is expected behaviour.

<a id="wfm.GetSubstitutes"></a>

## wfm.GetSubstitutes

This job determines substitutes for any number of users and roles.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |
| `UserIds` | STRING | Yes | Comma-separated list of IDs of users/roles for whom substitute information is requested |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Substitutes` | BASE64 | — | Requested substitute information in XML format (see below) |

### Return Value

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

### Example

Structure of `Substitutes`:

```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Substitutes>
  <Object Id="BB4FF62D3FE24DD790DE342585917A36">
    <Substitute Id="8CD236F862644DAD904CD8C228EF4F23" Name="LEHMANN" Absent="1"
                UserGUID="4FEEDE694EB94E7E9C4A847FC32D10E4" Login="Lehmann"/>
  </Object>
</Substitutes>
```
Description of the XML structure:

* `Object`: object ID of the user
** `Id` (STRING): object ID of the user
* `Substitute`: all substitute assignments for a specific user/role
** `Id` (STRING): object ID of the substitute for user/role
** `Name` (STRING): login name of the substitute
** `Absent` (INT): `1` = user is absent, `0` = otherwise
** `UserGUID` (STRING): GUID of the user from the user table
** `Login` (STRING): login of the user from the user table

### See Also

[wfm.GetOrganisations](wfm.md#wfm.GetOrganisations),
[wfm.GetOrganisationObjects](wfm.md#wfm.GetOrganisationObjects),
[wfm.SetSubstitutes](wfm.md#wfm.SetSubstitutes)

<a id="wfm.GetSysClienttypes"></a>

## wfm.GetSysClienttypes

This job returns all client types defined in the system.

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `ClientTypes` | BASE64 | — | List of all defined client types (XML format, see note) |

### Note

Structure of `ClientTypes`:

```xml
<ClientTypes>
  <ClientType Id="" Name=""/>
  <ClientType Id="" Name=""/>
</ClientTypes>
```
Detailed description of `ClientType`:

* `Id` (STRING): GUID of the client type
* `Name` (STRING): Name of the client type

### See Also

[wfm.InsertSysClienttypes](wfm.md#wfm.InsertSysClienttypes)

<a id="wfm.GetUserSubstitutes"></a>

## wfm.GetUserSubstitutes

This job returns all users that the requesting user represents.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |
| `UserId` | STRING | Yes | ID of the user for whom the information is requested |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Objects` | BASE64 | — | Requested information in XML format (see below) |

### Return Value

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

### Example

Structure of `Objects`:

```xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Objects>
  <Object Id="BB4FF62D3FE24DD790DE342585917A36">
    <Substitute Id="8CD236F862644DAD904CD8C228EF4F23" Name="LEHMANN" Absent="1"
      UserGUID="4FEEDE694EB94E7E9C4A847FC32D10E4" Login="Lehmann"/>
  </Object>
</Objects>
```

### Note

Detailed description of `Objects`:

* `Object` — contains all users to be represented:
** `Id` (STRING): object ID of the user
* `Substitute` — describes a substitute:
** `Id` (STRING): object ID of the substitute for user/role
** `Name` (STRING): login name of the substitute
** `Absent` (INT): `1` = user is absent, `0` = otherwise
** `UserGUID` (STRING): GUID of the user from the user table
** `Login` (STRING): login of the user from the user table

### See Also

[wfm.GetOrganisations](wfm.md#wfm.GetOrganisations),
[wfm.GetOrganisationObjects](wfm.md#wfm.GetOrganisationObjects),
[wfm.SetSubstitutes](wfm.md#wfm.SetSubstitutes)

<a id="wfm.GetVersionInfo"></a>

## wfm.GetVersionInfo

This job returns information about the version of the workflow engine.

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |  |  |  |  |
|---|---|---|---|---|---|---|---|
| `EngineVersion` | INT | — | Major version of the engine (e.g. 450) | `EngineSubVersion` | INT | — | Sub-version of the engine (e.g. 3) |

<a id="wfm.GetWFMInfo"></a>

## wfm.GetWFMInfo

This job returns information about a user (e.g. absence, WF user ID) via the DMS user ID.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| Requests | BASE64 | Yes | List of requests in XML format (see note) |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Requests` | BASE64 | — | Responses to the requests in XML format (see note) |

### Note

Structure of input parameter `Requests`:

```xml
<Requests>
  <Request UserId="" RequestType=""/>
  <Request UserId="" RequestType=""/>
</Requests>
```
Detailed description of input `Requests`:

* `UserId` (STRING): ID of the DMS user

* `RequestType` (INT): Flag for the type of request

** `1` = the ID of the active organization should be determined
** `2` = it should be determined whether the DMS user is contained in the active organization
** `3` = the ID of the WF user for the DMS user ID should be determined
** `4` = it should be determined whether the specified user is marked as absent

Structure of output parameter `Requests`:

```xml
<Requests>
  <Request UserId="" RequestType="" Value=""/>
  <Request UserId="" RequestType="" Value=""/>
</Requests>
```
Detailed description of output `Requests`:

* `UserId` (STRING): ID of the DMS user
* `RequestType` (INT): Flag for the type of request (as input)
* `Value` (INT): Response to the request

** for `RequestType = 2`: 1 = DMS user contained in organization, otherwise 0
** for `RequestType = 4`: 1 = DMS user marked as absent, otherwise 0

<a id="wfm.GetWorkItem"></a>

## wfm.GetWorkItem

This job starts a work item. The work item is personalized for the specified user. Additionally, all required data (mask, file and workflow variables) for the client are returned.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `UserId` | STRING | Yes | ID of the user |
| `WorkItemId` | STRING | Yes | Instance ID of the activity |
| `ClientTypeId` | STRING | Yes | ID of the client type used |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `ExtendedAttributes` | BASE64 | — | List of data for the parameters (`Attribute`) in XML format (see note) |
| `File` | BASE64 | — | List of documents of the info/work area of the WF file in XML format (see note) |
| `Masks` | BASE64 | — | Mask data in XML format (see note) |
| `Parameters` | BASE64 | — | List of parameters for the data mask in XML format (see note) |
| `[RoutingList]` | BASE64 | Optional | Routing list (optional, see note) |

### Return Value

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

### See Also

[wfm.GetWorkItemList](wfm.md#wfm.GetWorkItemList), [wfm.CancelWorkItem](wfm.md#wfm.CancelWorkItem), [wfm.CompleteWorkItem](wfm.md#wfm.CompleteWorkItem)

### Note

**Structure of ExtendedAttributes**

```xml
<ExtendedAttributes>
  <ExtendedAttribute Name="MASKID" Value=""/>
  <ExtendedAttribute Name="SEND_BUTTON" Value="0"/>
  <ExtendedAttribute Name="SENDTO_BUTTON" Value="0"/>
  <ExtendedAttribute Name="END_BUTTON" Value="0"/>
  <ExtendedAttribute Name="SIGN_ACTIVITY" Value=""/>
  <ExtendedAttribute Name="CHECK_PASSWORD" Value=""/>
</ExtendedAttributes>
```
`ExtendedAttributes` — list of parameters (`Attribute`) with the following structure:

* `Name` (STRING): Name of the attribute
** `MASKID`: GUID of the workflow mask
** `SEND_BUTTON`: Display of the forward button
** `END_BUTTON`: Display of the finish button
** `SIGN_ACTIVITY`: `1` = digital signature required, otherwise `0`
** `CHECK_PASSWORD`: `1` = password must be entered to forward, otherwise `0`
* `Value`: Value of the attribute

**Structure of File**

```xml
<File>
  <Docs>
    <Doc Id="" Type="" Rights="" Location="" Workspace="" Deleteable="0" Moveable="1"
      UseActiveVariant="" OriginalId="" Display=""/>
  </Docs>
</File>
```
`File` encapsulates the parameters `Workspace` and `Infospace`. `Docs` is a list of document parameters (`Doc`):

* `Id` (INT): ID of the document from the DMS
* `Type` (INT): Type of the document
* `Rights` (INT): Access rights +
`0` = accessDenied, `1` = accessView, `2` = accessEdit, `4` = accessDelete, `8` = accessEditDataSheet, `15` = accessAll
* `Location` (INT): Location of the document (`1` = SDREL, `2` = WF archive)
* `Workspace` (INT): indicates whether the object is in the info area (`0`) or work area (`1`)
* `Deleteable` (INT): indicates whether the document can be deleted from the file (`0` = no, `1` = yes)
* `Moveable` (INT): indicates whether the document can be moved within the file (`0` = no, `1` = yes)
* `UseActiveVariant` (INT): indicates whether the active variant should be used for the object (`0` = no, `1` = yes)
* `OriginalId` (INT): indicates which document was originally dragged into the file
* `Display` (INT): indicates whether this document should be displayed in the preview (`0` = no, `1` = yes)

**Structure of Masks**

```xml
<Masks>
  <Mask Id="" Name="" Flags="" FrameWidth="" FrameHeight="">
    <MaskField Id="" Name="" InternalName="" TabOrder="" DataType="" InpLen="" Init=""
      Flags="" Flags1="" Flags2="" InpLeft="" InpTop="" InpRight="" InpBottom=""
      FieldLeft="" FieldTop="" FieldRight="" FieldBottom="" ToolTip="" ValuesId="">
      <MaskFieldVal><![CDATA[ ]]></MaskFieldVal>
    </MaskField>
  </Mask>
</Masks>
```
`Masks` — list of masks (`Mask`):

* `Id` (STRING): ID of the mask
* `Name` (STRING): Name of the mask
* `Flags` (INT): Flags
* `FrameWidth` (INT): Width of the mask
* `FrameHeight` (INT): Height of the mask
* `MaskField`: Structure containing information about a mask field; contains either the value of the mask field (`MaskFieldVal`) or a list of mask field controls (`MaskListCtrls`)
** `Id` (STRING): ID of the mask field
** `Name` (STRING): Name
** `InternalName` (STRING): Internal name
** `TabOrder` (INT): Tab order
** `DataType` (INT): Data type
** `InpLen` (INT): Input length
** `Init` (STRING): Initialization value
** `Flags` (INT): Flags
** `Flags1` (INT): Additional flags
** `Flags2` (INT): Additional flags
** `InpLeft` (INT): X-position of the input field
** `InpTop` (INT): Y-position of the input field
** `InpRight` (INT): Width of the input field
** `InpBottom` (INT): Height of the input field
** `FieldLeft` (INT): X-position of the field label
** `FieldTop` (INT): Y-position of the field label
** `FieldRight` (INT): Width of the field label in pixels
** `FieldBottom` (INT): Height of the field label in pixels
** `ToolTip` (INT): Tooltip
** `ValuesId` (INT): Reference to list fields
** `MaskFieldVal`: Value of the mask field as CDATA
** `MaskListCtrl`: Structure with information about a mask field control
*** `ColPos` (INT): Column position
*** `Name` (STRING): Name
*** `Type` (STRING): Type
*** `Length` (INT): Length
*** `ColWidth` (INT): Column width
*** `Color` (INT): Color
*** `TextAlign` (INT): Text alignment
*** `ValuesId` (STRING): Reference to list fields
*** `MaskListCtrlVal`: Value of the mask field control as CDATA
** `Page`: Structure with information about a page control (contains further mask fields)
*** `Id` (STRING): ID of the page control
*** `Name` (STRING): Name of the page control
*** `Number` (INT): indicates the position ("page number") of a page
*** `IconId` (INT): ID of the icon (from DB table Osicons) to be displayed on the page control

**Structure of Parameters**

```xml
<Parameters>
  <Parameter FormField="" DataField="" Name="" Mode="" Selection=""
    InfoText="" ListType=""><![CDATA[ ]]></Parameter>
</Parameters>
```
`Parameters` — list of formal parameters:

* `FormField` (STRING): ID of the field on a form sheet to which the workflow variable is assigned; if no assignment exists: name of the workflow variable
* `DataField` (STRING): ID of the workflow variable
* `Name` (STRING): Name of the workflow variable
* `Mode` (INT): Mode of the workflow variable +
`1` = input parameter, `2` = output parameter, `3` = input/output parameter
* `Selection` (STRING): Selection type for workflow variables in list form (`single` or `multi:x`)
* `InfoText` (STRING): Information text for workflow variables in list form
* `ListType` (STRING): Type of the list (`ProcessList`, `UserList`, `UserDefList`)
* CDATA: Structure and data of the workflow variable

**Structure of RoutingList**

```xml
<RoutingList Id="3294B433BFF6454D9C861B86B5A8AD5D"
  ProcessId="BA16C21BB96D46D099E72070BCB644CC"
  ActivityId="3294B433BFF6454D9C861B86B5A8AD5D" Expandable="1">
  <Entries>
    <Entry Nr="203" Expandable="1">
      <Item Id="99825B18A8334987935684FDA3D6A40D"
        ActivityId="6EE4490A48164A0FA6DC34A80099AF66" ActivityName="Create Invoice"
        ModelActivityName="Create Invoice" Remark="" TimerId="" TimerDuration=""
        TimerDurationType="" Changeable="1" Deleteable="0">
        <ObjectIds></ObjectIds>
      </Item>
    </Entry>
  </Entries>
</RoutingList>
```
`RoutingList` — routing list (structure identical to [wfm.CompleteWorkItem](wfm.md#wfm.CompleteWorkItem)).

<a id="wfm.GetWorkItemList"></a>

## wfm.GetWorkItemList

This job returns a list of all work items for which the specified user is configured as a participant and the work item is not yet personalized by another participant.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |
| `UserId` | STRING | Yes | ID of the user |
| `ClientTypeId` | STRING | Yes | ID of the client type used |
| `Flags` | INT | Yes | With flags, the requested work items can be limited. +<br>`1` = INITIATED +<br>`2` = RUNNING +<br>`4` = SUSPENDED +<br>`16` = TERMINATED +<br>`32` = COMPLETED +<br>`64` = INUSE |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `WorkItems` | BASE64 | — | List of requested work items in XML format (see note) |

### Return Value

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

### See Also

[wfm.GetWorkItem](wfm.md#wfm.GetWorkItem), [wfm.StartWorkItem](wfm.md#wfm.StartWorkItem), [wfm.GetWorkItemParams](wfm.md#wfm.GetWorkItemParams)

### Note

**Structure of WorkItems**

```xml
<WorkItems>
  <WorkItem Id="" State="" Personalized="" ProcessId="" ProcessName=""
    ProcessSubject="" ActivityId="" ActivityName="" WarningTime="" OverTime=""
    CreationTime="" WorkflowId="" Substitute="" IconId="" WorkflowType="2"
    WorkflowVersion="5" ObjectId="32">
    <Columns>
      <Column DisplayName="" Value="" Position=""/>
    </Columns>
  </WorkItem>
</WorkItems>
```
`WorkItem` — describes a work item:

* `Id` (STRING): ID of the work item
* `State` (INT): Status of the work item +
`1` = INITIATED, `2` = RUNNING, `4` = SUSPENDED, `16` = TERMINATED, `32` = COMPLETED, `64` = INUSE
* `Personalized` (STRING): Name of the user who personalized this item
* `ProcessId` (STRING): Process ID
* `ProcessName` (STRING): Process name
* `ProcessSubject` (STRING): Process subject
* `ActivityId` (STRING): Instance ID of the activity
* `ActivityName` (STRING): Name of the activity
* `WarningTime` (INT): Reminder period
* `OverTime` (INT): Flag indicating whether the item should have been completed (`1`)
* `CreationTime` (INT): Creation time of the activity
* `WorkflowId` (STRING): Workflow ID
* `IconId` (INT): Icon ID of the workflow model
* `Substitute` (INT): `1` = user gets the work item as substitute, otherwise `0`
* `WorkflowType` (INT): `1` = ProductionWorkflow, `2` = Adhoc-Workflow
* `WorkflowVersion` (INT): Version number of the workflow model
* `ObjectId` (STRING): ID of the document to be displayed in preview by clients
* `Columns`: List of elements of type `Column`
** `Column`: used for displaying workflow variables
*** `DisplayName` (STRING): the variable should be displayed under this name
*** `Value`: value of the variable
*** `Position` (INT): determines the order of the elements

<a id="wfm.GetWorkItemParams"></a>

## wfm.GetWorkItemParams

This job determines all parameters of a work item for the user who personalized the work item. All workflow variables, parameters for the input mask, content of the workflow file and additional parameters (e.g. whether a password entry is required to forward) are returned.

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

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `WorkItemId` | STRING | Yes | Instance ID of the activity |
| `UserId` | STRING | Yes | ID of the user |
| `ClientTypeId` | STRING | Yes | ID of the client type used |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Parameters` | BASE64 | — | List of parameters for the data mask in XML format (see note) |
| `ExtendedAttributes` | BASE64 | — | List of data for the parameters (`Attribute`) in XML format (see note) |
| `File` | BASE64 | — | List of documents of the info/work area of the WF file in XML format (see note) |
| `[RoutingList]` | BASE64 | Optional | Routing list (optional, see note) |

### Return Value

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

### Note

**Structure of Parameters**

```xml
<Parameters>
  <Parameter FormField="" DataField="" Name="" Mode="" Selection=""
    InfoText="" ListType=""><![CDATA[ ]]></Parameter>
</Parameters>
```
`Parameters` — list of formal parameters:

* `FormField` (STRING): ID of the field on a form sheet to which the workflow variable is assigned; if no assignment exists: name of the workflow variable
* `DataField` (STRING): ID of the workflow variable
* `Name` (STRING): Name of the workflow variable
* `Mode` (INT): Mode of the workflow variable +
`1` = input parameter, `2` = output parameter, `3` = input/output parameter
* `Selection` (STRING): Selection type for workflow variables in list form (`single` or `multi:x`)
* `InfoText` (STRING): Information text for workflow variables in list form
* `ListType` (STRING): Type of the list (`ProcessList`, `UserList`, `UserDefList`)
* CDATA: Structure and data of the workflow variable

**Structure of ExtendedAttributes**

```xml
<ExtendedAttributes>
  <ExtendedAttribute Name="MASKID" Value=""/>
  <ExtendedAttribute Name="SEND_BUTTON" Value="0"/>
  <ExtendedAttribute Name="SENDTO_BUTTON" Value="0"/>
  <ExtendedAttribute Name="END_BUTTON" Value="0"/>
  <ExtendedAttribute Name="SIGN_ACTIVITY" Value=""/>
  <ExtendedAttribute Name="CHECK_PASSWORD" Value=""/>
</ExtendedAttributes>
```
`ExtendedAttributes` — list of parameters (`Attribute`) with the following structure:

* `Name` (STRING): Name of the attribute
** `MASKID`: GUID of the workflow mask
** `SEND_BUTTON`: Display of the forward button
** `END_BUTTON`: Display of the finish button
** `SIGN_ACTIVITY`: `1` = digital signature required, otherwise `0`
** `CHECK_PASSWORD`: `1` = password must be entered to forward, otherwise `0`
* `Value`: Value of the attribute

**Structure of File**

```xml
<File>
  <Docs>
    <Doc Id="45" Type="23" Location="1" Workspace="0" New="1" Deleteable="1"
      Moveable="2" UseActiveVariant="0" OriginalId="42" Display="1"/>
  </Docs>
</File>
```
`Docs` — list of document parameters (`Doc`):

* `Id` (STRING): ID of the document
* `Type` (INT): Type of the document
* `Location` (INT): indicates whether the document is in the SDREL (`Location='1'`) or system archive (`Location='2'`)
* `Workspace` (INT): indicates whether the object is in the info area (`0`) or work area (`1`)
* `New` (INT): indicates whether the object was newly added to the file (`New='1'`)
* `Deleteable` (INT): indicates whether the document can be deleted from the file (`0` = no, `1` = yes)
* `Moveable` (INT): indicates whether the document can be moved within the file (`0` = no, `1` = yes)
* `UseActiveVariant` (INT): indicates whether the active variant should be used for the object (`0` = no, `1` = yes)
* `OriginalId` (INT): indicates which document was originally dragged into the file
* `Display` (INT): indicates whether this document should be displayed in the preview (`0` = no, `1` = yes)

**Structure of RoutingList**

```xml
<RoutingList Id="3294B433BFF6454D9C861B86B5A8AD5D"
  ProcessId="BA16C21BB96D46D099E72070BCB644CC"
  ActivityId="3294B433BFF6454D9C861B86B5A8AD5D" Expandable="1">
  <Entries>
    <Entry Nr="203" Expandable="1">
      <Item Id="99825B18A8334987935684FDA3D6A40D"
        ActivityId="6EE4490A48164A0FA6DC34A80099AF66" ActivityName="Create Invoice"
        ModelActivityName="Create Invoice" Remark="" TimerId="" TimerDuration=""
        TimerDurationType="" Changeable="1" Deleteable="0">
        <ObjectIds></ObjectIds>
      </Item>
    </Entry>
  </Entries>
</RoutingList>
```
`RoutingList` — routing list (structure identical to [wfm.CompleteWorkItem](wfm.md#wfm.CompleteWorkItem)).

<a id="wfm.GetWorkflow"></a>

## wfm.GetWorkflow

This job retrieves a workflow model from the server.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `WorkflowId` | STRING | Yes | ID of the workflow model |
| `ProcessId` | STRING | Yes | ID of the process (process must be active); can be optionally used and replaces the `FamilyId` and `WorkflowId` parameters; only valid for `Action` = 1 |
| `OrganisationId` | STRING | Yes | ID of the organization of the workflow model |
| `UserId` | STRING | Yes | ID of the DMS user |
| `FamilyId` | STRING | Yes | ID of the workflow family of the workflow model |
| `Action` | INT | Yes | Action to be performed: +<br>`1` = workflow model is requested for reading +<br>`2` = workflow model should be edited +<br>`3` = an empty workflow model is requested |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `NewId` | STRING | only for `Action` = `3` | New ID of the requested workflow, if created (see input parameter `Action`) |
| `State` | INT | — | State of the model: +<br>`1` = The model is in use, i.e. new processes can be started from it. +<br>`2` = The model is locked for editing. +<br>`3` = The model is being edited, but not locked. +<br>`4` = The model is released for testing. +<br>`5` = The model is deleted but still in the database. +<br>`6` = The model is released but not in use. No new processes can be started from this model, but running processes will still be completed. |

### Output Files

| Name | Description |
|---|---|
| File list | Name and path of the file containing the XML package with the model description in XML format |

### Return Value

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

### See Also

[wfm.StoreWorkflow](wfm.md#wfm.StoreWorkflow)

<a id="wfm.GetWorkflowData"></a>

## wfm.GetWorkflowData

This job returns the status information of a workflow model for a workflow ID.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization of the workflow model |
| `WorkflowId` | STRING | Yes | ID of the workflow model |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `WorkflowId` | STRING | — | ID of the workflow model |
| `WorkflowName` | STRING | — | Name of the workflow model |
| `WorkflowState` | INT | — | Status of the workflow model: +<br>`1` = The model is in use, i.e. new processes can be started from it. +<br>`2` = The model is locked for processing. +<br>`3` = The model is being processed, but not locked. +<br>`4` = The model is test released. +<br>`5` = The model is deleted but still contained in the DB. +<br>`6` = The model is released but not in use. No new processes can be started from this model, but running processes are still completed. |
| `WorkflowCreator` | STRING | — | ID of the creator of the workflow model |
| `WorkflowCreationTime` | INT | — | Creation time of the workflow model |
| `WorkflowVersion` | STRING | — | Version of the workflow model |
| `WorkflowLockId` | STRING | — | ID of the user who locked the workflow model |
| `WorkflowLockName` | STRING | — | Name of the user who locked the workflow model |
| `WorkflowLockTime` | INT | — | Lock time of the workflow model |
| `WorkflowDescription` | STRING | — | Short description of the workflow model |
| `WorkflowIconId` | INT | — | Icon ID of the workflow model |

### Return Value

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

<a id="wfm.GetWorkflowInfo"></a>

## wfm.GetWorkflowInfo

This job returns the input parameters (workflow variables) of an active workflow model (status = 1) of the specified workflow family.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization of the workflow model |
| `FamilyId` | STRING | Yes | ID of the family of the active workflow model |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `InputParams` | BASE64 | — | Input parameters of the model in XML format (see below) |

### Return Value

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

### Example

Structure of `InputParams`:

```xml
<InputParams>
  <InputParam Id="" Name=""><![CDATA[]]></InputParam>
  <InputParam Id="" Name=""><![CDATA[]]></InputParam>
</InputParams>
```
`InputParam` structure:

* `Id` (STRING): ID of the input parameter
* `Name` (STRING): Name of the input parameter
* CDATA: Structure of the input parameter

### See Also

[wfm.GetWorkflowList](wfm.md#wfm.GetWorkflowList)

<a id="wfm.GetWorkflowList"></a>

## wfm.GetWorkflowList

This job returns a list of all startable workflows for the specified user.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |
| `UserId` | STRING | Yes | ID of the user |
| `Flags` | INT | Yes | Marker parameter — currently only value `48` valid |
| `ClientTypeId` | STRING | Yes | ID of the client type used |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Workflows` | BASE64 | — | List of data for the requested workflows in XML format (see below) |

### Return Value

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

### Example

Structure of `Workflows`:

```xml
<Workflows>
  <Workflow FamilyId="" ModelName="" Name="" Id="" Description="" IconId=""/>
  <Workflow FamilyId="" ModelName="" Name="" Id="" Description="" IconId=""/>
</Workflows>
```
`Workflow` structure:

* `FamilyId` (STRING): ID of the workflow family of the workflow
* `Id` (STRING): ID of the workflow
* `Name` (STRING): Name of the workflow (instance name)
* `Description` (STRING): Description of the workflow model
* `IconId` (INT): Icon ID of the workflow model
* `ModelName` (STRING): Name of the workflow model

### See Also

[wfm.GetOrganisations](wfm.md#wfm.GetOrganisations),
[wfm.GetOrganisationObjects](wfm.md#wfm.GetOrganisationObjects),
[wfm.CreateProcessInstance](wfm.md#wfm.CreateProcessInstance)

<a id="wfm.GetWorkflowListByFamily"></a>

## wfm.GetWorkflowListByFamily

This job returns all workflow models contained in a workflow family. Within a workflow family, there is always only one model with status = 1.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |
| `FamilyId` | STRING | Yes | ID of the workflow family |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Workflows` | BASE64 | — | Workflow list in XML format (see below) |

### Return Value

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

### Example

Structure of `Workflows`:

```xml
<Workflows>
  <Workflow Id="" Name="" State="" Creator="" CreationTime=""
            Version="" LockId="" LockName="" LockTime="" Description=""
            IconId=""/>
  <Workflow Id="" Name="" State="" Creator="" CreationTime=""
            Version="" LockId="" LockName="" LockTime="" Description=""
            IconId=""/>
</Workflows>
```
`Workflow` structure:

* `Id` (STRING): ID of the workflow
* `Name` (STRING): Name of the workflow
* `State` (INT): Status of the workflow:
** `1` = The model is in use, i.e. new processes can be started from it.
** `2` = The model is locked for processing.
** `3` = The model is being processed, but not locked.
** `4` = The model is test released.
** `5` = The model is deleted but still contained in the DB.
** `6` = The model is released but not in use. No new processes can be started from this model, but running processes are still completed.
* `Creator` (STRING): Creator
* `CreationTime` (INT): Creation time
* `Version`: Version number of the workflow
* `LockId` (STRING): ID of the user who locked the workflow
* `LockName` (STRING): Name of the user who locked the workflow
* `LockTime` (INT): Time of locking
* `Description` (STRING): Description of the workflow
* `IconId` (INT): Icon ID of the workflow model

<a id="wfm.Import"></a>

## wfm.Import

This job imports an organization. For this, a file is attached to the job.

### Input Files

| Name | Description |
|---|---|
| Import file | Name and path of the file to be imported |

### Input Parameters

| Name | Type | Required | Description |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| DoImportOrganisation | INT | Yes | Indicates whether organization data should also be imported (1 = Yes, 0 = No) | DestOrganisationId | BASE64 | Yes | If organization data is to be imported: specifies the target organization. Remains empty if a new organization should be created. | WorkflowProjects | BASE64 | Yes | Specifies the workflow projects to be imported in XML format (see note) | Workflows | BASE64 | Yes | Specifies the workflow models to be imported in XML format (see note) | ReportConfigs | BASE64 | Yes | Specifies the report configurations to be imported in XML format (see note) | Templates | BASE64 | Yes | Specifies the routing list templates to be imported in XML format |

### Return Value

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

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `ChangedOrganisations` | STRING | — | Comma-separated ID list of changed organizations |

### Note

Structure of `WorkflowProjects`:

```xml
<WorkflowProjects>
  <WorkflowProject Id="" DestPrjId="" DestOrgId="" Overwrite="" CompleteImport="" OldParent=""/>
  <WorkflowProject Id="" DestPrjId="" DestOrgId="" Overwrite="" CompleteImport="" OldParent=""/>
</WorkflowProjects>
```
Detailed description of `WorkflowProject`:

* `Id` (STRING): ID of the project in the import file
* `DestPrjId` (STRING): ID of the parent project
* `DestOrgId` (STRING): ID of the target organization. Not specified if a new organization is created during import and the project has this new organization as target.
* `Overwrite` (INT): Flag indicating whether a possibly already existing project with the same ID should be overwritten. Otherwise, a new project with a new ID is created.
* `CompleteImport` (INT): Flag indicating whether the entire substructure (projects/workflows) of the project should be imported. This does not need to be listed.
* `OldParent` (INT): Only relevant if the parent workflow project was copied (not overwritten). If set, the project is written to the old WF project (overwrite flag is observed); if not set, to the newly created (copied) WF project. If the parent WF project was overwritten, this flag should always be set.

Structure of `Workflows`:

```xml
<Workflows>
  <Workflow Id="" DestFamId="" DestOrgId="" Overwrite="" OldFamily=""/>
  <Workflow Id="" DestFamId="" DestOrgId="" Overwrite="" OldFamily=""/>
</Workflows>
```
Detailed description of `Workflow`:

* `Id` (STRING): ID of the workflow in the import file
* `DestFamId` (STRING): ID of the target WF family
* `DestOrgId` (STRING): ID of the target organization. Not specified if a new organization is created during import and the model has this new organization as target.
* `Overwrite` (INT): Flag indicating whether a possibly already existing workflow with the same ID should be overwritten. Otherwise, a new workflow with a new ID is created.
* `OldFamily` (INT): Only relevant if the parent workflow family was copied (not overwritten). If set, the model is written to the old WF family (overwrite flag is observed); if not set, to the newly created (copied) WF family. If the parent WF family was overwritten, this flag should always be set.

Structure of `ReportConfigs`:

```xml
<ReportConfigs>
  <ReportConfig ConfigId="" Overwrite="" DestOrgId=""/>
  <ReportConfig ConfigId="" Overwrite="" DestOrgId=""/>
</ReportConfigs>
```
Detailed description of `ReportConfig`:

* `ConfigId` (STRING): ID of the configuration in the import file
* `DestOrgId` (STRING): ID of the target organization
* `Overwrite` (INT): Flag indicating whether a possibly already existing configuration with the same ID should be overwritten. Otherwise, a new configuration with a new ID is created.

### See Also

[wfm.Export](wfm.md#wfm.Export)

<a id="wfm.InsertSysClienttypes"></a>

## wfm.InsertSysClienttypes

This job defines new client types.

> **Note:** This job is not yet implemented.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Clienttypes` | BASE64 | Yes | List of all defined client types in XML format (see below) |

### Return Value

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

### Example

Structure of `Clienttypes`:

```xml
<Clienttypes>
  <Clienttype Id="" Name=""/>
  <Clienttype Id="" Name=""/>
</Clienttypes>
```

### Note

Detailed description of `Clienttypes`:

* `Clienttype` — structure with information about a client type:
** `Id` (STRING): GUID of the client type
** `Name` (STRING): Name of the client type

### See Also

[wfm.GetSysClienttypes](wfm.md#wfm.GetSysClienttypes)

<a id="wfm.LoadMasks"></a>

## wfm.LoadMasks

This job returns the specified masks or all masks for a workflow model with substructure (fields, ListCtrlCols, catalogs).

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization in which the workflow with the masks is located. |
| `WorkflowId` | STRING | Yes | ID of the workflow with the masks. |
| `MaskIds` | STRING | Yes | IDs of the requested masks (comma-separated). Empty = all masks of the workflow model are loaded. |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `OrganisationId` | STRING | — | ID of the organization in which the workflow with the masks is located. |
| `WorkflowId` | STRING | — | ID of the workflow with the masks. |
| `Masks` | BASE64 | — | Mask data in XML format (see note). |

### Return Value

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

### Note

**Structure of Masks**

```xml
<Masks>
  <Mask Id="" Name="" Flags="" FrameWidth="" FrameHeight="">
    <!-- Standard mask field -->
    <MaskField Id="" Name="" InternalName="" FieldName="" TabOrder=""
                DataType="" InpLen="" Init="" Flags="" Flags1="" Flags2=""
                InpLeft="" InpTop="" InpRight="" InpBottom=""
                FieldLeft="" FieldTop="" FieldRight="" FieldBottom=""
                ToolTip="" ValuesId="">
      <MaskFieldVal><![CDATA[ ]]></MaskFieldVal>
    </MaskField>

    <!-- List control mask field -->
    <MaskField Id="" Name="" InternalName="" TabOrder=""
                DataType="" InpLen="" Init="" Flags="" Flags1="" Flags2=""
                InpLeft="" InpTop="" InpRight="" InpBottom=""
                FieldLeft="" FieldTop="" FieldRight="" FieldBottom=""
                ToolTip="" ValuesId="">
      <MaskListCtrls>
        <MaskListCtrl ColPos="" Name="" Type="" Length=""
                      ColWidth="" Color="" TextAlign="" ValuesId=""/>
        <MaskListCtrlVal><![CDATA[ ]]></MaskListCtrlVal>
      </MaskListCtrls>
    </MaskField>

    <!-- Page control mask field -->
    <MaskField Id="" Name="" InternalName="" TabOrder=""
                DataType="" InpLen="" Init="" Flags="" Flags1="" Flags2=""
                InpLeft="" InpTop="" InpRight="" InpBottom=""
                FieldLeft="" FieldTop="" FieldRight="" FieldBottom=""
                ToolTip="" ValuesId="">
      <Page Id="" Name="" Number="" IconId="">
        <MaskFields>
          <MaskField Id="" Name="" InternalName=""
                     TabOrder="" DataType="" InpLen="" Init="" Flags="" Flags1=""
                     Flags2="" InpLeft="" InpTop="" InpRight="" InpBottom=""
                     FieldLeft="" FieldTop="" FieldRight="" FieldBottom=""
                     ToolTip="" ValuesId=""/>
        </MaskFields>
      </Page>
    </MaskField>
  </Mask>
</Masks>
```
`Masks` — list of masks; each element is of type `Mask`:

* `Mask` — structure containing a list of mask fields of type `MaskField`:
** `Id` (STRING): ID of the mask.
** `Name` (STRING): Name of the mask.
** `Flags` (INT): Flags.
** `FrameWidth` (INT): Width of the mask.
** `FrameHeight` (INT): Height of the mask.
** `MaskField` — structure with information about a mask field; contains either the field value (`MaskFieldVal`) or a list of controls (`MaskListCtrls`):
*** `Id` (STRING): ID of the mask field.
*** `Name` (STRING): Name.
*** `InternalName` (STRING): Internal name.
*** `TabOrder` (INT): Tab order.
*** `DataType` (INT): Data type.
*** `InpLen` (INT): Input length.
*** `Init` (STRING): Initialization value.
*** `Flags` (INT): Flags.
*** `Flags1` (INT): Additional flags.
*** `Flags2` (INT): Additional flags.
*** `InpLeft` (INT): X-position of the input field.
*** `InpTop` (INT): Y-position of the input field.
*** `InpRight` (INT): Width of the input field.
*** `InpBottom` (INT): Height of the input field.
*** `FieldLeft` (INT): X-position of the field label.
*** `FieldTop` (INT): Y-position of the field label.
*** `FieldRight` (INT): Width of the field label in pixels.
*** `FieldBottom` (INT): Height of the field label in pixels.
*** `ToolTip` (INT): Tooltip.
*** `ValuesId` (INT): Reference to list fields.
*** `MaskFieldVal`: Value of the mask field as CDATA.

* `MaskListCtrl` — structure with information about a mask field control:
** `ColPos` (INT): Column position.
** `Name` (STRING): Name.
** `Type` (STRING): Type.
** `Length` (INT): Length.
** `ColWidth` (INT): Column width.
** `Color` (INT): Color.
** `TextAlign` (INT): Text alignment.
** `ValuesId` (STRING): Reference to list fields.
** `MaskListCtrlVal`: Value of the mask field control as CDATA.

* `Page` — structure with information about a page control (contains `MaskFields` again):
** `Id` (STRING): ID of the page control.
** `Name` (STRING): Name of the page control.
** `Number` (INT): Position (page number) of a page.
** `IconId` (INT): ID of the icon (from DB table Osicons) to be displayed on the page control.

### See Also

[wfm.SaveMasks](wfm.md#wfm.SaveMasks)

<a id="wfm.LoadScript"></a>

## wfm.LoadScript

This job returns a script from the database.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization. |
| `WorkflowId` | STRING | Yes | ID of the workflow. |
| `ScriptId` | STRING | Yes | ID of the script. |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `ScriptCode` | STRING | — | The requested script code. |

### Return Value

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

### See Also

[wfm.SaveScript](wfm.md#wfm.SaveScript)

<a id="wfm.SaveEvent"></a>

## wfm.SaveEvent

This job sets up an event for an activity. If the parameter `EventId` is set, the values `Params` and `Description` are reset for an existing event.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `EventId` | STRING | Yes | ID of an event. Must be empty if this is a new event. |
| `WorkflowId` | STRING | Yes | ID of a workflow model. |
| `ActivityId` | STRING | Yes | ID of an activity. |
| `EventType` | INT | Yes | Type of an event (see note). |
| `Params` | STRING | Yes | For event type `ButtonClick`, the ID of the button is passed here. |
| `Description` | STRING | Yes | Description of the event. |
| `OrganisationId` | STRING | Yes | ID of the organization. |
| `ClientTypeId` | STRING | Yes | ID of the client type used. |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `EventId` | STRING | — | ID of the created or updated event. |

### Return Value

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

### Note

Valid values for `EventType`:

* `1` = BeforeForward
* `2` = AfterForward
* `3` = BeforeForwardTo
* `4` = ButtonClick
* `5` = BeforeOpen
* `6` = AfterSignature
* `7` = BeforeCancel
* `8` = SimulateMaskEdit
* `10000` = StartActivity
* `10001` = EndActivity
* `10002` = BeforeStartSubProc
* `10003` = PersonalizeWorkItem
* `10004` = GetWorkItemParams

### See Also

[wfm.GetEvents](wfm.md#wfm.GetEvents),
[wfm.DeleteEvent](wfm.md#wfm.DeleteEvent),
[wfm.SaveScript](wfm.md#wfm.SaveScript),
[wfm.SetEventScriptRelation](wfm.md#wfm.SetEventScriptRelation)

<a id="wfm.SaveMasks"></a>

## wfm.SaveMasks

This job saves changes to one or more masks with substructure (fields, ListCtrlCols, catalogs).

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization. |
| `WorkflowId` | STRING | Yes | ID of the workflow model. |
| `Masks` | BASE64 | Yes | Structure with the masks to be saved in XML format (see note). |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `OrganisationId` | STRING | — | ID of the organization. |
| `WorkflowId` | STRING | — | ID of the workflow model. |
| `MaskIds` | STRING | — | Comma-separated list of mask IDs that could not be saved. |

### Return Value

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

### Note

**Structure of Masks**

```xml
<Masks>
  <Mask Id="" Name="" Flags="" FrameWidth="" FrameHeight="">
    <!-- for 1=MODSTATE_CHANGED, 2=MODSTATE_NEW -->
    <MaskField Id="" ModState=""/>

    <!-- for 0=MODSTATE_UNMODIFIED, 3=MODSTATE_DELETED -->
    <MaskField Id="" ModState="" Name="" InternalName="" FieldName=""
               TabOrder="" DataType="" InpLen="" Init="" Flags="" Flags1=""
               Flags2="" InpLeft="" InpTop="" InpRight="" InpBottom=""
               FieldLeft="" FieldTop="" FieldRight="" FieldBottom=""
               ToolTip="" ValuesId="">
      <!-- for 1=MODSTATE_CHANGED, 2=MODSTATE_NEW -->
      <MaskFieldVal Id="" ModState="">
        <![CDATA[ ]]>
      </MaskFieldVal>
    </MaskField>
  </Mask>
</Masks>
```

### See Also

[wfm.LoadMasks](wfm.md#wfm.LoadMasks)

<a id="wfm.SaveOrganisation"></a>

## wfm.SaveOrganisation

This job saves an organization and notifies all affected clients.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |

### Return Value

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

<a id="wfm.SaveScript"></a>

## wfm.SaveScript

This job saves a script or creates a new script (`Action` = 2).

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization. |
| `WorkflowId` | STRING | Yes | ID of the workflow. |
| `Id` | STRING | Yes | ID of the script. |
| `Name` | STRING | Yes | Name of the script. |
| `Description` | STRING | Yes | Short description of the script. |
| `Action` | INT | Yes | Action to be performed: +<br>`1` = overwrite the existing script; +<br>`2` = create a new script. |
| `ScriptCode` | STRING | Yes | Script code. |
| `Type` | INT | Yes | Type of script: +<br>`1` = event script; +<br>`2` = global server script; +<br>`3` = global client script. |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `ScriptId` | STRING | — | ID of the saved or newly created script. |

### Return Value

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

### See Also

[wfm.SaveEvent](wfm.md#wfm.SaveEvent),
[wfm.SetEventScriptRelation](wfm.md#wfm.SetEventScriptRelation)

<a id="wfm.ServerNotifyClients"></a>

## wfm.ServerNotifyClients

This job sends a message to update the inbox to clients whose users are listed in the user ID list.
If the list is empty, a message is sent to all connected clients.

> **Note:** This job serves communication between different servers and is generally called by another server, not by clients.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| UserGUIDs | STRING | Yes | Comma-separated list of user GUIDs (empty = notify all connected clients) |

### Return Value

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

<a id="wfm.ServerUpdateWorkflowModels"></a>

## wfm.ServerUpdateWorkflowModels

This job removes all workflow models listed in the list from the WorkflowEngine cache and sends a notification to all connected workflow editors.

> **Note:** This job serves communication between different servers and is generally called by another server, not by clients.

### Input Parameters

| Name | Type | Required | Description |  |  |  |  |
|---|---|---|---|---|---|---|---|
| OrganisationId | STRING | Yes | GUID of the organization from which the models come | WorkflowIds | STRING | Yes | Comma-separated list of workflow model GUIDs |

### Return Value

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

<a id="wfm.ServerUserAbsent"></a>

## wfm.ServerUserAbsent

This job notifies all connected workflow editors about which users have changed their presence status.

> **Note:** This job serves communication between different servers and is generally called by another server, not by clients.

### Input Parameters

| Name | Type | Required | Description |  |  |  |  |  |  |  |  |
|---|---|---|---|---|---|---|---|---|---|---|---|
| OrganisationId | STRING | Yes | GUID of the organization from which the users come | AbsentIds | STRING | Yes | Comma-separated list of user GUIDs who are absent | PresentIds | STRING | Yes | Comma-separated list of user GUIDs who are present |

### Return Value

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

<a id="wfm.SetActiveOrganisation"></a>

## wfm.SetActiveOrganisation

This job activates the specified organization.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |

### Return Value

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

<a id="wfm.SetActivityPerformers"></a>

## wfm.SetActivityPerformers

This job sets the participants of any activity. Participants can be users or roles. Note that old settings will be overwritten.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization to which the roles/users belong |
| `UserId` | STRING | Yes | ID of the executing user |
| `RActivityId` | STRING | Yes | Instance ID of the activity |
| `ObjectIds` | STRING | Yes | GUIDs of roles/users, separated by commas |

### Return Value

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

### See Also

[wfm.GetActivityPerformers](wfm.md#wfm.GetActivityPerformers)

<a id="wfm.SetEventScriptRelation"></a>

## wfm.SetEventScriptRelation

This job associates an event with a script.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization. |
| `WorkflowId` | STRING | Yes | ID of the workflow. |
| `EventId` | STRING | Yes | ID of the event. |
| `ScriptId` | STRING | Yes | ID of the script. |
| `Action` | INT | Yes | Action to be performed: +<br>`1` = set association; +<br>`2` = delete association. |

### Return Value

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

### See Also

[wfm.SaveScript](wfm.md#wfm.SaveScript),
[wfm.SaveEvent](wfm.md#wfm.SaveEvent)

<a id="wfm.SetProcessResponsibles"></a>

## wfm.SetProcessResponsibles

This job sets the responsible persons for a process.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `ProcessId` | STRING | Yes | ID of the process |
| `OrganisationId` | STRING | Yes | ID of the organization |
| `Responsibles` | STRING | Yes | Comma-separated list with IDs of process responsibles |

### Return Value

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

<a id="wfm.SetSubstitutes"></a>

## wfm.SetSubstitutes

This job sets substitutes for multiple users or roles.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |
| `Substitutes` | BASE64 | Yes | User-substitute assignments in XML format (see below) |

### Return Value

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

### Example

Structure of `Substitutes`:

```xml
<Substitutes>
  <Substitute Id="12345678901234567890123456789010">
    <SubstituteIds>789012345678901A,123456778901B</SubstituteIds>
  </Substitute>
  <Substitute Id="12345678901234567890123456789011">
    <SubstituteIds>123456789012345,123452345678901C</SubstituteIds>
  </Substitute>
</Substitutes>
```

### Note

`Substitute` structure with all substitute assignments for a specific user:

* `Id` (STRING): Object ID of the user/role
* `SubstituteIds` (STRING): comma-separated list of object IDs of all substitutes for the user/role; can be empty

### See Also

[wfm.GetOrganisations](wfm.md#wfm.GetOrganisations),
[wfm.GetOrganisationObjects](wfm.md#wfm.GetOrganisationObjects),
[wfm.GetSubstitutes](wfm.md#wfm.GetSubstitutes)

<a id="wfm.StartProcess"></a>

## wfm.StartProcess

This job starts a workflow process. It checks if the specified user is authorized to start the process. The start activity of the process is executed. To use this job, a process instance must first be created using the [wfm.CreateProcessInstance](wfm.md#wfm.CreateProcessInstance) job. Documents passed to the process are always placed in the workflow file's workspace.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `UserId` | STRING | Yes | ID of the user |
| `ProcessId` | STRING | Yes | ID of the process |
| `Workspace` | BASE64 | Yes | Contains documents in XML format (see note) |
| `DataFields` | BASE64 | Yes | Contains the structure and values of input variables in XML format (see note) |

### Return Value

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

### See Also

[wfm.GetOrganisationObjects](wfm.md#wfm.GetOrganisationObjects), [wfm.CreateProcessInstance](wfm.md#wfm.CreateProcessInstance)

### Note

**Structure of Workspace**

```xml
<Workspace>
  <Docs>
    <Doc Id="" Type="" Location="" Moveable="" Deleteable="" Workspace=""/>
  </Docs>
</Workspace>
```
`Doc` — Structure that encapsulates information about a document:

* `Id` (INT): ID of the document
* `Type` (INT): Type of the document
* `Location` (INT): indicates whether the document is in the SDREL (`Location='1'`) or system archive (`Location='2'`)
* `Moveable` (INT): indicates whether the document can be moved from the info area to the workspace (and vice versa) (`Moveable=1`), otherwise `0`
* `Deleteable` (INT): indicates whether the document can be deleted from the file (`Deleteable=1`), otherwise `0`
* `Workspace` (INT): indicates whether the object is in the info area (`0`) or workspace (`1`)

**Structure of DataFields**

```xml
<DataFields>
  <DataField Id="iSkonto">
    <![CDATA[<WFVar><String>0</String></WFVar>]]>
  </DataField>
  <DataField Id="iSkontofaehig">
    <![CDATA[<WFVar><String>0</String></WFVar>]]>
  </DataField>
  <DataField Id="lPositionen">
    <![CDATA[
      <List TypeId="920C3899284B424EACBF881EE3A714C0">
        <ListItem Id="00000000000000000000000000000001" Selection="0">
          <Record>
            <Member Name="iPosition"><STRING>1</STRING></Member>
            <Member Name="strBezeichnung"><STRING>Tisch</STRING></Member>
          </Record>
        </ListItem>
      </List>
    ]]>
  </DataField>
</DataFields>
```
`DataField` — Workflow variable:

* `Id` (STRING): Name of the workflow variable
* CDATA: Structure of the workflow variable

<a id="wfm.StartWorkItem"></a>

## wfm.StartWorkItem

This job starts a work item. The work item is personalized for the specified user.

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

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `UserId` | STRING | Yes | ID of the user |
| `WorkItemId` | STRING | Yes | Instance ID of the activity |
| `ClientTypeId` | STRING | Yes | ID of the client type used |

### Return Value

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

### See Also

[wfm.GetWorkItemList](wfm.md#wfm.GetWorkItemList), [wfm.CancelWorkItem](wfm.md#wfm.CancelWorkItem), [wfm.CompleteWorkItem](wfm.md#wfm.CompleteWorkItem)

<a id="wfm.StoreWorkflow"></a>

## wfm.StoreWorkflow

This job modifies/saves a workflow model.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `UserId` | STRING | Yes | ID of the user |
| `WorkflowId` | STRING | Yes | ID of the workflow model |
| `OrganisationId` | STRING | Yes | ID of the organization |
| `FamilyId` | STRING | Yes | ID of the workflow family |
| `Flags` | INT | Yes | `1` = internal; `2` = external (model imported from outside, a new ID will be generated for the model) |

### Input Files

| Name | Description |
|---|---|
| Input File | Path and name of the file with workflow information in XML format |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `WorkflowId` | STRING | — | ID of the workflow |
| `Name` | STRING | — | Name of the workflow |
| `State` | INT | — | Status of the workflow |
| `CreatorId` | STRING | — | ID of the workflow creator |
| `CreationTime` | INT | — | Time of workflow creation |
| `Version` | STRING | — | Version of the workflow |
| `LockId` | STRING | — | ID of the user who locked the workflow |
| `LockName` | STRING | — | Name of the user who locked the workflow |
| `LockTime` | INT | — | Time of workflow lock |
| `Description` | STRING | — | Short description of the workflow |
| `IconId` | INT | — | Icon ID of the workflow model |

### Return Value

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

<a id="wfm.ValidateWorkflow"></a>

## wfm.ValidateWorkflow

This job checks a workflow model for validity.

### Input Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `OrganisationId` | STRING | Yes | ID of the organization |

### Input Files

| Name | Description |
|---|---|
| Input File | Path and name of the file with the workflow model description in XML format |

### Output Parameters

| Name | Type | Dependency | Description |
|---|---|---|---|
| `Valid` | INT | — | Flag indicating whether the model is valid (`1` = Yes, `2` = No) |
| `ErrorCount` | INT | — | Number of errors found in the model |
| `WarningCount` | INT | — | Number of warnings related to the model |
| `Errors` | BASE64 | — | Information about found errors in XML format (see below) |
| `Warnings` | BASE64 | — | Information about warnings in XML format (see below) |

### Return Value

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

### Example: Structure of `Errors`

```xml
<Errors>
  <SchemaValidationError>Error during schema validation!</SchemaValidationError>
  <MissingTypeDeclRecordMembers>
    <MissingTypeDeclRecordMember TypeDeclId="" TypeDeclName="TestList"/>
    <MissingTypeDeclRecordMember TypeDeclId="" TypeDeclName="RecFu"/>
  </MissingTypeDeclRecordMembers>
  <MissingVariableRecordMembers>
    <MissingVariableRecordMember VariableId="" VariableName="TestList1"/>
  </MissingVariableRecordMembers>
  <MissingTypeDeclarations>
    <MissingTypeDeclaration Id="12346798134567891345678900001">
      <ReferencingDataFields>
        <ReferencingDataField Id="1234671345678913456789001" Name="abc"/>
        <ReferencingDataField Id="126789134567890000" Name="xyz"/>
      </ReferencingDataFields>
      <ReferencingTypeDeclarations>
        <ReferencingTypeDeclaration Id="123467981345" Name="TestList"/>
      </ReferencingTypeDeclarations>
    </MissingTypeDeclaration>
    <MissingTypeDeclaration Id="12346798134567891345678900002">
      <ReferencingTypeDeclarations>
        <ReferencingTypeDeclaration Id="" Name="recBla"/>
      </ReferencingTypeDeclarations>
    </MissingTypeDeclaration>
  </MissingTypeDeclarations>
  <MissingActivityParticipants>
    <MissingActivityParticipant Id="12346798134567891345678900006">
      <ReferencingActivities>
        <ReferencingActivity Id="" Name="step1"/>
        <ReferencingActivity Id="" Name="step2"/>
      </ReferencingActivities>
    </MissingActivityParticipant>
    <MissingActivityParticipant Id="12346798134567891345678900007">
      <ReferencingActivities>
        <ReferencingActivity Id="" Name="step1"/>
      </ReferencingActivities>
    </MissingActivityParticipant>
  </MissingActivityParticipants>
  <NoParticipantsInStartActivity/>
  <MissingToolIds>
    <MissingToolId ActivityId="" ActivityName="stepLoop1"/>
    <MissingToolId ActivityId="" ActivityName="stepLoop2"/>
  </MissingToolIds>
  <MissingApplicationMasks>
    <MissingApplicationMask ApplicationId="" ApplicationName="Anwendung Step1"
                            MaskId="12346798134567891345678900008"/>
  </MissingApplicationMasks>
  <MissingApplicationMaskIds>
    <MissingApplicationMaskId ActivityId="" ActivityName="Act Step1"
                              ApplicationId="" ApplicationName="App Step 1"/>
  </MissingApplicationMaskIds>
  <MissingActivityApplications>
    <MissingActivityApplication ActivityId="" ActivityName="step2"
                                ApplicationId="12346798134567891345678900010"/>
  </MissingActivityApplications>
  <InvalidApplicationMaskFieldIds>
    <InvalidApplicationMaskFieldId MaskFieldId="123" ApplicationId=""
                                   ApplicationName="AppTest"/>
  </InvalidApplicationMaskFieldIds>
  <MissingActivityVariables>
    <MissingActivityVariable VariableId="12346798134567891345678900012">
      <ReferencingActivities>
        <ReferencingActivity Id="" Name="step2"/>
      </ReferencingActivities>
    </MissingActivityVariable>
    <MissingActivityVariable VariableId="12346798134567891345678900013">
      <ReferencingActivities>
        <ReferencingActivity Id="" Name="step2"/>
      </ReferencingActivities>
    </MissingActivityVariable>
  </MissingActivityVariables>
  <InvalidParameterListCounts>
    <InvalidParameterListCount ActivityId="" ActivityName="step1"
                               ApplicationId="" ApplicationName="App Step1"/>
    <InvalidParameterListCount ActivityId="" ActivityName="step3"
                               ApplicationId="" ApplicationName="App Step3"/>
  </InvalidParameterListCounts>
  <ParamWithoutVariableActivities>
    <ParamWithoutVariableActivity ActivityId="" ActivityName="step1"
                                  ApplicationId="" ApplicationName="App Step1"/>
    <ParamWithoutVariableActivity ActivityId="" ActivityName="step2"
                                  ApplicationId="" ApplicationName="App Step2"/>
  </ParamWithoutVariableActivities>
  <MissingTakeOverActivities>
    <MissingTakeOverActivity ActivityId="12346798134567891345678900014">
      <ReferencingActivities>
        <ReferencingActivity Id="step1" Name="step1"/>
      </ReferencingActivities>
    </MissingTakeOverActivity>
    <MissingTakeOverActivity ActivityId="12346798134567891345678900015">
      <ReferencingActivities>
        <ReferencingActivity Id="step2" Name="step2"/>
      </ReferencingActivities>
    </MissingTakeOverActivity>
  </MissingTakeOverActivities>
  <MissingTakeOverVariables>
    <MissingTakeOverVariable VariableId="12346798134567891345678900016">
      <ReferencingActivities>
        <ReferencingActivity Id="" Name="step1"/>
      </ReferencingActivities>
    </MissingTakeOverVariable>
  </MissingTakeOverVariables>
  <MissingFromActivities>
    <MissingFromActivity FromActivityId="12346798134567891345678900017"
                         TransitionId="12346798134567891345678900018"/>
    <MissingFromActivity FromActivityId="12346798134567891345678900019"
                         TransitionId="12346798134567891345678900020"/>
  </MissingFromActivities>
  <MissingToActivities>
    <MissingToActivity ToActivityId="12346798134567891345678900021"
                       TransitionId="12346798134567891345678900022"/>
  </MissingToActivities>
  <RedundantTransitions>
    <RedundantTransition FromActivityId="12346798134567891345678900021"
                          FromActivityName="stepX"
                          ToActivityId="12346798134567891345678900021"
                          ToActivityName="stepY"
                          TransitionId="12346798134567891345678900021"/>
  </RedundantTransitions>
  <InvalidFromLoopTransitions>
    <InvalidFromLoopTransition FromActivityId="12346798891345678900021"
                               FromActivityName="stepX"
                               TransitionId="1234679891345678900021"/>
  </InvalidFromLoopTransitions>
  <InvalidToLoopTransitions>
    <InvalidToLoopTransition ToActivityId="12346798134567891345678900021"
                              ToActivityName="stepX"
                              TransitionId="12346798134567891345678900021"/>
  </InvalidToLoopTransitions>
  <InvalidFromOrToLoops>
    <InvalidFromOrToLoop LoopActivityId="12346798134567891345678900021"
                         LoopActivityName="loopX"/>
  </InvalidFromOrToLoops>
  <CycleActivities>
    <CycleActivity Id="12346798134567891345678900021" Name="step58"/>
    <CycleActivity Id="12346798134567891345678900021" Name="step42"/>
  </CycleActivities>
  <InvalidLoopTransitions>
    <InvalidLoopTransition TransitionId="12346798134567891345678900021"
                           FromActivityId="12346798134567891345678900021"
                           FromActivityName="stepX"
                           ToActivityId="12346798134567891345678900021"
                           ToActivityName="stepY"/>
  </InvalidLoopTransitions>
  <InvalidToLoopNumActivities>
    <InvalidToLoopNumActivity Id="12891345678900021" Name="step56"/>
    <InvalidToLoopNumActivity Id="81345678913456789001" Name="step57"/>
  </InvalidToLoopNumActivities>
  <InvalidFromLoopNumActivities>
    <InvalidFromLoopNumActivity Id="1234678900021" Name="step59"/>
    <InvalidFromLoopNumActivity Id="3467981345678" Name="step60"/>
  </InvalidFromLoopNumActivities>
  <MissingLoopConditionActivities>
    <MissingLoopConditionActivity Id="12891345678900021" Name="step61"/>
  </MissingLoopConditionActivities>
  <NoTerminationActivities>
    <NoTerminationActivity Id="" Name="stepBla"/>
    <NoTerminationActivity Id="" Name="stepFoo"/>
  </NoTerminationActivities>
  <NoLoopTerminationActivities>
    <NoLoopTerminationActivity Id="" Name="stepLoop1"/>
    <NoLoopTerminationActivity Id="" Name="stepLoop2"/>
  </NoLoopTerminationActivities>
  <MissingDefActIds>
    <MissingDefActId Id="" Name="stepLoop1"/>
    <MissingDefActId Id="" Name="stepLoop2"/>
  </MissingDefActIds>
  <AllClientTypesActivities>
    <AllClientTypesActivitiy ActivityId="" ActivityName="XX" ApplicationId=""
                             ApplicationName="x1"/>
    <AllClientTypesActivitiy ActivityId="" ActivityName="YY" ApplicationId=""
                             ApplicationName="y1"/>
  </AllClientTypesActivities>
  <AmbiguousActAppClientTypes>
    <AmbiguousActAppClientType ActivityId="" ActivityName="ABC"
                               ClientTypeId="" ClientTypeName="CTX"/>
    <AmbiguousActAppClientType ActivityId="" ActivityName="DEF"
                               ClientTypeId="" ClientTypeName="CTY"/>
  </AmbiguousActAppClientTypes>
  <ActAppInvalidClientTypes>
    <ActAppInvalidClientType ActivityId="" ActivityName="AAB"
                              ApplicationId="" ApplicationName="v1"/>
    <ActAppInvalidClientType ActivityId="" ActivityName="BBX"
                              ApplicationId="" ApplicationName="w2"/>
  </ActAppInvalidClientTypes>
  <ActEvtAllClientTypes>
    <ActEvtAllClientType ActivityId="" ActivityName="ABC"
                         EventTypeId="100" EventTypeName="BeforeBlaEvent"/>
    <ActEvtAllClientType ActivityId="" ActivityName="DEF"
                         EventTypeId="100" EventTypeName="AfterFuEvent"/>
  </ActEvtAllClientTypes>
  <AmbiguousActEvtClientTypes>
    <AmbiguousActEvtClientType ActivityId="" ActivityName="ABCDE"
                               EventTypeId="100" EventTypeName="Before123Event"
                               ClientTypeId="" ClientTypeName="CTX11"/>
    <AmbiguousActEvtClientType ActivityId="" ActivityName="DEFGH"
                               EventTypeId="100" EventTypeName="After456Event"
                               ClientTypeId="" ClientTypeName="CTY22"/>
  </AmbiguousActEvtClientTypes>
  <AmbiguousGlobalEvtClientTypes>
    <AmbiguousGlobalEvtClientType ClientTypeId="" ClientTypeName="CT89"/>
    <AmbiguousGlobalEvtClientType ClientTypeId="" ClientTypeName="CT90"/>
  </AmbiguousGlobalEvtClientTypes>
  <NoProcessStartClientType/>
  <InvalidModParamVarIds>
    <InvalidModParamVarId VarId="12891345678900021"/>
  </InvalidModParamVarIds>
  <AdhocActWithoutDefaultSubActs>
    <AdhocActWithoutDefaultSubAct Id="" Name="AdhocActWithoutDefaultSubAct 1"/>
    <AdhocActWithoutDefaultSubAct Id="" Name="AdhocActWithoutDefaultSubAct 2"/>
  </AdhocActWithoutDefaultSubActs>
  <AdhocActWithUnknownDefaultSubActs>
    <AdhocActWithUnknownDefaultSubAct Id="" Name="AdhocActWithUnknownDefaultSubAct 1"/>
    <AdhocActWithUnknownDefaultSubAct Id="" Name="AdhocActWithUnknownDefaultSubAct 2"/>
  </AdhocActWithUnknownDefaultSubActs>
  <AdhocActDefaultActIsNotAdhocSubActs>
    <AdhocActDefaultActIsNotAdhocSubAct Id="" Name="AdhocActDefaultActIsNotAdhocSubAct 1"/>
    <AdhocActDefaultActIsNotAdhocSubAct Id="" Name="AdhocActDefaultActIsNotAdhocSubAct 2"/>
  </AdhocActDefaultActIsNotAdhocSubActs>
  <AdhocActDefaultActIsNotWorkitems>
    <AdhocActDefaultActIsNotWorkitem Id="" Name="AdhocActDefaultActIsNotWorkitem 1"/>
    <AdhocActDefaultActIsNotWorkitem Id="" Name="AdhocActDefaultActIsNotWorkitem 2"/>
  </AdhocActDefaultActIsNotWorkitems>
</Errors>
```
Description of the `Errors` XML structure:

* `SchemaValidationError`: Schema validation error message

* `MissingTypeDeclRecordMember`: Type declaration that contains a record without members
** `TypeDeclId` (STRING): ID of the type declaration
** `TypeDeclName` (STRING): Name of the type declaration

* `MissingVariableRecordMember`: Variable that contains a record without members
** `VariableId` (STRING): ID of the variable
** `VariableName` (STRING): Name of the variable

* `MissingTypeDeclaration`: Used but undefined type declaration
** `Id` (STRING): ID used to reference non-existent type declaration

* `ReferencingDataField`: DataField (workflow variable) that uses a non-defined type declaration
** `Id` (STRING): ID of the DataField
** `Name` (STRING): Name of the DataField

* `ReferencingTypeDeclaration`: Type declaration that uses a non-defined type declaration
** `Id` (STRING): ID of the type declaration
** `Name` (STRING): Name of the type declaration

* `MissingActivityParticipant`: Activity participant that is not a participant of the workflow
** `Id` (STRING): ID used to reference non-existent workflow participant

* `ReferencingActivity`: Activity that references the parent structure
** `Id` (STRING): ID of the activity
** `Name` (STRING): Name of the activity

* `NoParticipantsInStartActivity`: Tag exists if the start activity has no participants assigned

* `MissingToolId`: Activity that lacks a tool ID
** `ActivityId` (STRING): ID of the activity
** `ActivityName` (STRING): Name of the activity

* `MissingApplicationMask`: Application that references a non-existent mask
** `ApplicationId` (STRING): ID of the application
** `ApplicationName` (STRING): Name of the application
** `MaskId` (STRING): ID used to reference non-existent mask

* `MissingApplicationMaskId`: Activity and associated application that has no mask assigned
** `ActivityId` (STRING): ID of the activity
** `ActivityName` (STRING): Name of the activity
** `ApplicationId` (STRING): ID of the application
** `ApplicationName` (STRING): Name of the application

* `MissingActivityApplication`: Activity that references a non-existent application
** `ActivityId` (STRING): ID of the activity
** `ActivityName` (STRING): Name of the activity
** `ApplicationId` (STRING): ID used to reference non-existent application

* `InvalidApplicationMaskFieldId`: Invalid reference to mask fields
** `MaskFieldId` (STRING): ID of the non-existent mask field
** `ApplicationId` (STRING): ID of the application
** `ApplicationName` (STRING): Name of the application

* `MissingActivityVariable`: Activity variable that does not exist in the workflow as a DataField (workflow variable)
** `VariableId` (STRING): ID used to reference non-existent workflow variable

* `InvalidParameterListCount`: Activity with associated application where the number of parameters does not match
** `ActivityId` (STRING): ID of the activity
** `ActivityName` (STRING): Name of the activity
** `ApplicationId` (STRING): ID of the application
** `ApplicationName` (STRING): Name of the application

* `ParamWithoutVariableActivity`: Activity that contains application parameters without variable assignment
** `ActivityId` (STRING): ID of the activity
** `ActivityName` (STRING): Name of the activity
** `ApplicationId` (STRING): ID of the application
** `ApplicationName` (STRING): Name of the application

* `MissingTakeOverActivity`: Activity from which variables should be taken over, but this activity does not exist in the workflow
** `ActivityId` (STRING): ID used to reference non-existent activity

* `MissingTakeOverVariable`: Variable that should be taken over into an activity, but this variable (DataField) does not exist in the workflow
** `VariableId` (STRING): ID used to reference non-existent variable

* `MissingFromActivity`: Transition that uses a From activity that does not exist in the workflow
** `FromActivityId` (STRING): ID used to reference non-existent activity
** `TransitionId` (STRING): ID of the transition

* `MissingToActivity`: Transition that uses a To activity that does not exist in the workflow
** `ToActivityId` (STRING): ID used to reference non-existent activity
** `TransitionId` (STRING): ID of the transition

* `RedundantTransition`: Transition that is redundant as it already exists with another ID
** `FromActivityId` (STRING): ID of the From activity
** `FromActivityName` (STRING): Name of the From activity
** `ToActivityId` (STRING): ID of the To activity
** `ToActivityName` (STRING): Name of the To activity
** `TransitionId` (STRING): ID of the transition

* `InvalidFromLoopTransition`: Transition of type 'FROM LOOP', where the From activity is not a loop activity
** `FromActivityId` (STRING): ID of the From activity
** `FromActivityName` (STRING): Name of the From activity
** `TransitionId` (STRING): ID of the transition

* `InvalidToLoopTransition`: Transition of type 'TO LOOP', where the To activity is not a loop activity
** `ToActivityId` (STRING): ID of the To activity
** `ToActivityName` (STRING): Name of the To activity
** `TransitionId` (STRING): ID of the transition

* `InvalidFromOrToLoop`: Loop activity whose combination of FROM and TO LOOP transitions is invalid
** `LoopActivityId` (STRING): ID of the loop activity
** `LoopActivityName` (STRING): Name of the loop activity

* `CycleActivity`: Activity where a forbidden cycle occurs in the workflow graph structure
** `Id` (STRING): ID of the activity
** `Name` (STRING): Name of the activity

* `InvalidLoopTransition`: Transition that leads from one loop to another (activity lies in multiple subgraphs/loops)
** `FromActivityId` (STRING): ID of the From activity
** `FromActivityName` (STRING): Name of the From activity
** `ToActivityId` (STRING): ID of the To activity
** `ToActivityName` (STRING): Name of the To activity
** `TransitionId` (STRING): ID of the transition

* `InvalidToLoopNumActivity`: Loop activity that does not have exactly one transition of type 'TO LOOP'
** `Id` (STRING): ID of the loop activity
** `Name` (STRING): Name of the loop activity

* `InvalidFromLoopNumActivity`: Loop activity that does not have exactly one transition of type 'FROM LOOP'
** `Id` (STRING): ID of the loop activity
** `Name` (STRING): Name of the loop activity

* `MissingLoopConditionActivity`: Loop activity for which no condition is defined
** `Id` (STRING): ID of the loop activity
** `Name` (STRING): Name of the loop activity

* `NoTerminationActivity`: Activity from which the end activity cannot be reached
** `Id` (STRING): ID of the activity
** `Name` (STRING): Name of the activity

* `NoLoopTerminationActivity`: Activity within a loop from which there is no way out that leads back to the loop activity via a TO-LOOP transition
** `Id` (STRING): ID of the activity
** `Name` (STRING): Name of the activity

* `MissingDefActId`: Activity that has no default activity assigned for variable takeover
** `Id` (STRING): ID of the activity
** `Name` (STRING): Name of the activity

* `AllClientTypesActivity`: Activity for which the client application assignment is not unique (there is an assignment for all clients)
** `ActivityId` (STRING): ID of the activity
** `ActivityName` (STRING): Name of the activity
** `ApplicationId` (STRING): ID of the application
** `ApplicationName` (STRING): Name of the application

* `AmbiguousActAppClientType`: Activity for which the client application assignment is not unique
** `ActivityId` (STRING): ID of the activity
** `ActivityName` (STRING): Name of the activity
** `ClientTypeId` (STRING): ID of the client type
** `ClientTypeName` (STRING): Name of the client type

* `ActAppInvalidClientType`: Activity that has an application assignment for an invalid client
** `ActivityId` (STRING): ID of the activity
** `ActivityName` (STRING): Name of the activity
** `ApplicationId` (STRING): ID of the application
** `ApplicationName` (STRING): Name of the application

* `ActEvtAllClientType`: Activity for which the client event assignment is not unique (there is an assignment for all clients)
** `ActivityId` (STRING): ID of the activity
** `ActivityName` (STRING): Name of the activity
** `EventTypeId` (STRING): ID of the event type
** `EventTypeName` (STRING): Name of the event type

* `AmbiguousActEvtClientType`: Activity for which the client event assignment is not unique
** `ActivityId` (STRING): ID of the activity
** `ActivityName` (STRING): Name of the activity
** `EventTypeId` (STRING): ID of the event type
** `EventTypeName` (STRING): Name of the event type
** `ClientTypeId` (STRING): ID of the client type
** `ClientTypeName` (STRING): Name of the client type

* `AmbiguousGlobalEvtClientType`: Client type for which the assignment to the global client event is not unique
** `ClientTypeId` (STRING): ID of the client type
** `ClientTypeName` (STRING): Name of the client type

* `AdhocActWithoutDefaultSubAct`: Adhoc activity that has no default activity assigned
** `Id` (STRING): ID of the adhoc activity
** `Name` (STRING): Name of the adhoc activity

* `AdhocActWithUnknownDefaultSubAct`: Adhoc activity whose default activity does not exist in the model
** `Id` (STRING): ID of the adhoc activity
** `Name` (STRING): Name of the adhoc activity

* `AdhocActDefaultActIsNotAdhocSubAct`: Adhoc activity whose default activity is not a valid run list activity for the respective adhoc activity
** `Id` (STRING): ID of the adhoc activity
** `Name` (STRING): Name of the adhoc activity

* `AdhocActDefaultActIsNotWorkitem`: Adhoc activity whose default activity is not a work item
** `Id` (STRING): ID of the adhoc activity
** `Name` (STRING): Name of the adhoc activity

### Example: Structure of `Warnings`

```xml
<Warnings>
  <NoOutVarsInLoopActConditions>
    <NoOutVarsInLoopActCondition Id="12346798134545678900021" Name="loopX"/>
    <NoOutVarsInLoopActCondition Id="12346798134567891345671" Name="loopY"/>
  </NoOutVarsInLoopActConditions>
  <NoOutVarsInLoopActs>
    <NoOutVarsInLoopAct Id="12346798134567891345678900021" Name="loopXA"/>
    <NoOutVarsInLoopAct Id="12346798134567891345678900021" Name="loopYB"/>
  </NoOutVarsInLoopActs>
  <UnknownActAppClientTypes>
    <UnknownActAppClientType ActivityId="" ActivityName="AAA"
                             ClientTypeId="1234679813456789134567890000A"/>
    <UnknownActAppClientType ActivityId="" ActivityName="BBB"
                             ClientTypeId="1234679813456789134567890000B"/>
  </UnknownActAppClientTypes>
  <UnknownActEvtClientTypes>
    <UnknownActEvtClientType ActivityId="" ActivityName="ABCDE" EventTypeId="100"
                             EventTypeName="Before123Event" ClientTypeId="ABC.."/>
    <UnknownActEvtClientType ActivityId="" ActivityName="DEFGH" EventTypeId="100"
                             EventTypeName="After456Event" ClientTypeId="XYZ.."/>
  </UnknownActEvtClientTypes>
  <UnknownGlobalEvtClientTypes>
    <UnknownGlobalEvtClientType ClientTypeId="123456...."/>
    <UnknownGlobalEvtClientType ClientTypeId="1234567..."/>
  </UnknownGlobalEvtClientTypes>
  <AppToolsWithoutClientType>
    <AppToolWithoutClientType ActivityId="" ActivityName="Aktivität 42"
                              ApplicationId="" ApplicationName="Applikation 43"/>
    <AppToolWithoutClientType ActivityId="" ActivityName="Aktivität 44"
                              ApplicationId="" ApplicationName="Applikation 45"/>
    <AppToolWithoutClientType ActivityId="" ActivityName="Aktivität 46"
                              ApplicationId="" ApplicationName="Applikation 47"/>
  </AppToolsWithoutClientType>
  <NoOrInvalidFileResponsibleId/>
  <MasksWithoutFields>
    <MaskWithoutFields MaskId="1234567" MaskName="Maske1"/>
  </MasksWithoutFields>
</Warnings>
```
Description of the `Warnings` XML structure:

* `MissingWFParticipant`: Workflow participant that does not exist in the organization
** `Id` (STRING): ID of the participant
** `Name` (STRING): Name of the participant
** `IsResponsible` (INT): Indicates whether the participant is a process responsible (`1` = yes, `0` = no)
** `IsFileResponsible` (INT): Indicates whether the participant is a file responsible (`1` = yes, `0` = no)

* `ReferencingActivity`: Activity that has users assigned, but these users do not exist in the organization
** `Id` (STRING): ID of the activity
** `Name` (STRING): Name of the activity

* `WFParticipantWithoutASUser`: User not assigned to a DMS user or a non-existing DMS user
** `Id` (STRING): ID of the user
** `Name` (STRING): Name of the user

* `InvalidResponsibleId`: Process responsible of the workflow that does not exist in the participant list
** `Id` (STRING): ID of the process responsible

* `UnconnectedActivity`: Activity that cannot be reached from the start activity
** `Id` (STRING): ID of the activity
** `Name` (STRING): Name of the activity

* `InvalidDefActId`: Activity that has an invalid default activity assigned for variable takeover
** `Id` (STRING): ID of the activity
** `Name` (STRING): Name of the activity

* `ValidDefaultActivity`: Activity that has a valid default activity for the parent `InvalidDefActId`
** `Id` (STRING): ID of the activity
** `Name` (STRING): Name of the activity

* `NoOutVarsInLoopActCondition`: Loop activity for which no variable takeover is defined
** `Id` (STRING): ID of the activity
** `Name` (STRING): Name of the activity

* `UnknownActAppClientType`: Activity that has an application assignment for an unknown client
** `ActivityId` (STRING): ID of the activity
** `ActivityName` (STRING): Name of the activity
** `ClientTypeId` (STRING): ID of the client type

* `UnknownActEvtClientType`: Activity that has an event assignment for an unknown client
** `ActivityId` (STRING): ID of the activity
** `ActivityName` (STRING): Name of the activity
** `EventTypeId` (STRING): ID of the event type
** `EventTypeName` (STRING): Name of the event type
** `ClientTypeId` (STRING): ID of the client type

* `UnknownGlobalEvtClientType`: Unknown client type assigned to a global client event
** `ClientTypeId` (STRING): ID of the client type

* `AppToolWithoutClientType`: Activity that has an application assignment without client type specification
** `ActivityId` (STRING): ID of the activity
** `ActivityName` (STRING): Name of the activity
** `ApplicationId` (STRING): ID of the application
** `ApplicationName` (STRING): Name of the application

* `MaskWithoutFields`: Mask that has no mask fields
** `MaskId` (STRING): ID of the mask
** `MaskName` (STRING): Name of the mask

<a id="wfm.WorkItemNoti"></a>

## wfm.WorkItemNoti

This job sends the server job [wfm.ServerNotifyClients](wfm.md#wfm.ServerNotifyClients). The job [wfm.ServerNotifyClients](wfm.md#wfm.ServerNotifyClients) notifies all connected clients about changes in the inbox.

> **Note:** This job is regularly executed by the workflow engine itself as a batch job.

### Return Value

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

<a id="wfm.WorkerJob"></a>

## wfm.WorkerJob

This job processes the activity queue. Activities are started or ended.

> **Note:** This job is regularly executed by the workflow engine itself as a batch job.

### Return Value

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