Skip to main content
Version: 2025.1

workflow

JDITO-Funktionen für die ProcessEngine

Methods​

addTaskCandidateGroup​

addTaskCandidateGroup(pTaskId, pCandidateGroup): void

Adds a candidate group to a task.

Parameters​

pTaskId
string | number | boolean

the id of the task

pCandidateGroup
string | number | boolean

the name of the candidate group

Returns​

void

Throws​

AditoException


claimTask​

claimTask(pTaskId, pUserId): void

Claims a task for the given user. This will only set the assignee if nobody is assigned to the task already, otherwise an exception is thrown.

Parameters​

pTaskId
string | number | boolean

The id of the task

pUserId
string | number | boolean

The id of the user

Returns​

void

Throws​

AditoException


completeTask​

completeTask(pTaskId, pVariables): void

Sets a task as completed.

Parameters​

pTaskId
string | number | boolean

The id of the task

pVariables
any

Variables that should be set for the process instance.

Returns​

void

Throws​

AditoException


completeTaskWithFormData​

completeTaskWithFormData(pTaskId, pProperties): void

Completes a task with the user data that was entered in the form.

Parameters​

pTaskId
string | number | boolean

the id of the task

pProperties
Map<string, any>

the form data that was entered

Returns​

void

Throws​

AditoException


createConfigForLoadingHistoricInstances​

createConfigForLoadingHistoricInstances(): LoadHistoricProcessInstancesConfig

Creates a configuration object that is used for loading historic process instances, the methods of the object can be used to set filters for the result.

Returns​

a new LoadHistoricProcessInstancesConfig object


createConfigForLoadingHistoricTasks​

createConfigForLoadingHistoricTasks(): LoadHistoricTasksConfig

Creates a configuration object that is used for loading historic tasks, the methods of the object can be used to set filters for the result. Historic tasks also include completed tasks.

Returns​

a new LoadHistoricTasksConfig object


createConfigForLoadingProcessDefinition​

createConfigForLoadingProcessDefinition(): LoadProcessDefinitionConfig

Creates a configuration object that is used for loading one process definition, the methods of the object can be used to set filters for the result.

Returns​

a new LoadProcessDefinitionConfig object


createConfigForLoadingProcessDefinitions​

createConfigForLoadingProcessDefinitions(): LoadProcessDefinitionsConfig

Creates a configuration object that is used for loading process definitions, the methods of the object can be used to set filters for the result.

Returns​

a new LoadProcessDefinitionsConfig object


createConfigForLoadingProcessInstance​

createConfigForLoadingProcessInstance(): LoadProcessInstanceConfig

Creates a configuration object that is used for loading one process instance, the methods of the object can be used to set filters for the result.

Returns​

a new LoadProcessInstanceConfig object


createConfigForLoadingProcessInstances​

createConfigForLoadingProcessInstances(): LoadProcessInstancesConfig

Creates a configuration object that is used for loading running process instances, the methods of the object can be used to set filters for the result.

Returns​

a new LoadProcessInstancesConfig object


createConfigForLoadingTask​

createConfigForLoadingTask(): LoadTaskConfig

Creates a configuration object that is used for getting a single task, the methods of the object can be used to set filters for the result.

Returns​

a new LoadTaskConfig object


createConfigForLoadingTasks​

createConfigForLoadingTasks(): LoadTasksConfig

Creates a configuration object that is used for loading tasks, the methods of the object can be used to set filters for the result.

Returns​

a new LoadTasksConfig object


deleteDeploymentsByKey​

deleteDeploymentsByKey(pKey): void

Removes a deployment from the system

Parameters​

pKey
string | number | boolean

The key to set for the deployment

Returns​

void

Throws​

AditoException


deleteProcessInstance​

deleteProcessInstance(pProcessInstanceId, pReason): void

Deletes a process instance. This won't delete the historic process instance, so that deleted process instances are still available via the history.

Parameters​

pProcessInstanceId
string | number | boolean

The id of the process instance

pReason
string | number | boolean

Reason why the instance was deleted

Returns​

void

Throws​

AditoException


deleteTaskCandidateGroup​

deleteTaskCandidateGroup(pTaskId, pCandidateGroup): void

Removes a candidate group from a task.

Parameters​

pTaskId
string | number | boolean

the id of the task

pCandidateGroup
string | number | boolean

the name of the candidate group

Returns​

void

Throws​

AditoException


deployProcess​

deployProcess(pDeploymentKey, pProcessXML): string

Deploys the given process definition into the system

Parameters​

pDeploymentKey
string | number | boolean

The key to set for the deployment

pProcessXML
string | number | boolean

XML-String containing the process definition(s), BPMN2.0

Returns​

string

The deployment id, or null if the deploy failed

Throws​

AditoException


getFinishedActivities​

getFinishedActivities(pProcessInstanceId): string

Loads all finished activities of one process instance

Parameters​

pProcessInstanceId
string | number | boolean

The id of the process instance

Returns​

string

JSON-String containing the activities as an array of objects that can contain the following properties:

  • id

  • activityName

  • assignee

  • endTime

  • startTime

  • processDefinitionId

  • processInstanceId

  • deleteReason

  • durationInMillis

  • calledProcessInstanceId

  • taskId

  • activityType

Throws​

AditoException


getFormFieldListeners​

getFormFieldListeners(pTaskId): string

Gets all form fields that are used inside any visibility expression

Parameters​

pTaskId
string | number | boolean

the task id

Returns​

string

the form field ids

Throws​

AditoException


getFormProperties​

getFormProperties(pTaskId, pFieldValues?): string

Gets the form properties of a task if a form is defined for it. The JSON that this method returns can be directly used for a DynamicForm-ViewTemplate, because it already has the correct structure for that purpose.

Parameters​

pTaskId
string | number | boolean

the id of the task

pFieldValues?
Map<string, any>

the current values of the form, required if some fields use a visibility expression

Returns​

string

Either a JSON String with the form properties or null if there is no form. The JSON is an array consisting of objects, these can have the following properties:

  • id

  • name

  • contentType

  • isReadable

  • isWritable

  • isRequired

  • value

  • possibleItems

Throws​

AditoException


getHistoricProcessInstances​

getHistoricProcessInstances(pLoadConfig): string

Loads historic process instances depending on the given config. Historic process instances also include finished instances.

Parameters​

pLoadConfig

Configuration object created by workflow.createConfigForLoadingHistoricInstances

Returns​

string

JSON-String containing the instances as an array of objects that can contain the following properties:

  • id

  • name

  • key

  • processDefinitionId

  • processDefinitionName

  • startTime

  • active

  • startUserId

  • description

  • processVariables

  • processDefinitionVersion

Throws​

AditoException


getHistoricTasks​

getHistoricTasks(pLoadHistoricTasksConfig): string

Loads multiple historic tasks, filtered by the given LoadHistoricTasksConfig. This can be used for getting already finished tasks.

Parameters​

pLoadHistoricTasksConfig

Configuration object created by workflow.createConfigForLoadingHistoricTasks

Returns​

string

JSON-String containing the tasks as an array of objects that can contain the following properties:

  • id

  • name

  • processDefinitionId

  • dueDate

  • category

  • assignee

  • description

  • processInstanceId

  • owner

  • createTime

  • priority

  • active

  • claimTime

Throws​

AditoException


getLatestProcessDefinitionId​

getLatestProcessDefinitionId(pProcessKey): string

Gets the id of the most recent process definition with the given key

Parameters​

pProcessKey
string | number | boolean

the key of the process definition

Returns​

string

the id of the latest process definition

Throws​

AditoException


getMessageDefinitions​

getMessageDefinitions(pProcessDefinitionId): string

Loads all message definitions of a process definition.

Parameters​

pProcessDefinitionId
string | number | boolean

The id of the process definition

Returns​

string

Array of objects as JSON-String, the properties of the objects are:

  • id

  • name

Throws​

AditoException


getProcessDefinition​

getProcessDefinition(pLoadProcessDefinitionConfig): string

Loads one single process definition depending on the given config.

Parameters​

pLoadProcessDefinitionConfig

Configuration object created by workflow.createConfigForLoadingProcessDefinition

Returns​

string

JSON-String containing the process definitions as an object that can contain the following properties:

  • id

  • name

  • category

  • description

  • key

  • version

  • active

Throws​

AditoException


getProcessDefinitions​

getProcessDefinitions(pLoadProcessDefinitionsConfig): string

Loads process definitions depending on the given config.

Parameters​

pLoadProcessDefinitionsConfig

Configuration object created by workflow.createConfigForLoadingProcessDefinitions

Returns​

string

JSON-String containing the process definitions as an array of objects that can contain the following properties:

  • id

  • name

  • category

  • description

  • key

  • version

  • active

Throws​

AditoException


getProcessDiagram​

getProcessDiagram(pProcessDefinitionId): string

Returns a diagram of the process as an image.

Parameters​

pProcessDefinitionId
string | number | boolean

The id of the process definition

Returns​

string

Base64-String containing the diagram as an image

Throws​

AditoException


getProcessIds​

getProcessIds(pProcessXML): string

Extracts all process ids from the given XML-String

Parameters​

pProcessXML
string | number | boolean

BPMN2.0-XML containing the processes

Returns​

string

Array with all process ids as JSON-String

Throws​

AditoException


getProcessInstance​

getProcessInstance(pLoadProcessInstanceConfig): string

Loads a single process instance depending on the given config.

Parameters​

pLoadProcessInstanceConfig

Configuration object created by workflow.createConfigForLoadingProcessInstance

Returns​

string

JSON-String with the instance as object that can contain the following properties:

  • id

  • name

  • key

  • processDefinitionId

  • processDefinitionName

  • startTime

  • active

  • startUserId

  • description

  • processVariables

  • processDefinitionVersion

Throws​

AditoException


getProcessInstances​

getProcessInstances(pLoadProcessInstancesConfig): string

Loads process instances depending on the given config. This only includes running instances that have not ended.

Parameters​

pLoadProcessInstancesConfig

Configuration object created by workflow.createConfigForLoadingProcessInstances

Returns​

string

JSON-String containing the instances as an array of objects that can contain the following properties:

  • id

  • name

  • key

  • processDefinitionId

  • processDefinitionName

  • startTime

  • active

  • startUserId

  • description

  • processVariables

  • processDefinitionVersion

Throws​

AditoException


getProcessInstanceVariables​

getProcessInstanceVariables(pProcessInstanceId): string

Gets all variables of a process instance.

Parameters​

pProcessInstanceId
string | number | boolean

the id of the process instance

Returns​

string

JSON containing the variable names and their values

Throws​

AditoException


getProcessXML​

getProcessXML(pProcessDefinitionId): string

Gets the BPMN model of the process definition as XML.

Parameters​

pProcessDefinitionId
string | number | boolean

The id of the process definition

Returns​

string

Process-XML, Base64-encoded

Throws​

AditoException


getServiceTaskParameters​

getServiceTaskParameters(pServiceTaskName, pParameterData): string

Loads the parameter definitions of the specified service task. It is the result of the serviceTaskParameterProcess of that service task process.

Parameters​

pServiceTaskName
string | number | boolean

the name of the service task

pParameterData
string | number | boolean

additional data that will be available in the serviceTaskParameterProcess as "$local.value"

Returns​

string

JSON with the parameter definitions


getSignalDefinitions​

getSignalDefinitions(pProcessDefinitionId): string

Loads all signal definitions of a process definition.

Parameters​

pProcessDefinitionId
string | number | boolean

The id of the process definition

Returns​

string

Array of objects as JSON-String, the properties of the objects are:

  • id

  • name

  • scope

Throws​

AditoException


getStartFormProperties​

getStartFormProperties(pProcessDefinitionId): string

Gets the form properties required for starting the given process

Parameters​

pProcessDefinitionId
string | number | boolean

the id of the process definition

Returns​

string

Either a JSON String with the form properties or null if there is no form. The JSON is an array consisting of objects, these can have the following properties:

  • id

  • name

  • contentType

  • isReadable

  • isWritable

  • isRequired

  • value

  • possibleItems

Throws​

AditoException


getTask​

getTask(pLoadTaskConfig): string

Loads a single task using the given LoadTaskConfig

Parameters​

pLoadTaskConfig

Configuration object created by workflow.createConfigForLoadingTask

Returns​

string

JSON-String containing the task as an object that can contain the following properties:

  • id

  • name

  • processDefinitionId

  • dueDate

  • category

  • assignee

  • description

  • processInstanceId

  • owner

  • createTime

  • priority

  • active

  • claimTime

Throws​

AditoException


getTasks​

getTasks(pLoadTasksConfig): string

Loads multiple tasks, filtered by the given LoadTasksConfig

Parameters​

pLoadTasksConfig

Configuration object created by workflow.createConfigForLoadingTasks

Returns​

string

JSON-String containing the tasks as an array of objects that can contain the following properties:

  • id

  • name

  • processDefinitionId

  • dueDate

  • category

  • assignee

  • description

  • processInstanceId

  • owner

  • createTime

  • priority

  • active

  • claimTime

Throws​

AditoException


getTaskVariables​

getTaskVariables(pTaskId): string

Gets all variables of a task, this also includes the variables of the process instance.

Parameters​

pTaskId
string | number | boolean

the id of the task

Returns​

string

JSON containing the variable names and their values

Throws​

AditoException


messageEventReceived​

messageEventReceived(pName, pProcessInstanceId, pVariables?): void

Notifies the process engine that a message event has been received. A message is addressed to a single target.

Parameters​

pName
string | number | boolean

The name of the message event

pProcessInstanceId
string | number | boolean

The id of the process instance waiting for the message

pVariables?
Map<string, any>

Variables to set for the given process instance

Returns​

void

Throws​

AditoException


saveFormData​

saveFormData(pTaskId, pProperties): void

Saves the data that was entered in a task form.

Parameters​

pTaskId
string | number | boolean

the id of the task

pProperties
Map<string, any>

the form data that was entered

Returns​

void

Throws​

AditoException


setProcessActive​

setProcessActive(pProcessDefinitionId, pActive): void

Sets whether the process definition is active or not.

Parameters​

pProcessDefinitionId
string | number | boolean

the id of the process definition

pActive
boolean

true to set it active, false to set it inactive

Returns​

void

Throws​

AditoException


setProcessDefinitionCategory​

setProcessDefinitionCategory(pProcessDefinitionId, pCategory): void

Changes the category of a process definition

Parameters​

pProcessDefinitionId
string | number | boolean

The id of the process definition

pCategory
string | number | boolean

The new category

Returns​

void

Throws​

AditoException


setProcessInstanceActive​

setProcessInstanceActive(pProcessInstanceId, pActive): void

Activates or suspends a process instance. If a process instance is in state suspended, the process engine will not execute jobs (timers, messages) associated with this instance.

Parameters​

pProcessInstanceId
string | number | boolean

The id of the process instance

pActive
boolean

true to activate the instance, false to suspend it

Returns​

void

Throws​

AditoException


setProcessInstanceName​

setProcessInstanceName(pProcessInstanceId, pName): void

Changes the name of a process instance

Parameters​

pProcessInstanceId
string | number | boolean

The id of the process instance

pName
string | number | boolean

The new name

Returns​

void

Throws​

AditoException


setProcessInstanceVariables​

setProcessInstanceVariables(pProcessInstanceId, pVariables): void

Sets variables of one process instance.

Parameters​

pProcessInstanceId
string | number | boolean

The id of the process instance

pVariables
Map<string, any>

Variables to set

Returns​

void

Throws​

AditoException


setTaskAssignee​

setTaskAssignee(pTaskId, pUserId): void

Sets the assignee of a task.

Parameters​

pTaskId
string | number | boolean

The id of the task

pUserId
string | number | boolean

The id of the user

Returns​

void

Throws​

AditoException


signalEventReceived​

signalEventReceived(pName, pVariables?, pProcessInstanceId?): void

Notifies a single process instance that a signal event has been received.

Parameters​

pName
string | number | boolean

The name of the signal

pVariables?
Map<string, any>

Variables to set for the instance

pProcessInstanceId?
string | number | boolean

The id of the process instance

Returns​

void

Throws​

AditoException


startProcessByKey​

startProcessByKey(pProcessKey, pVariables): string

Starts a new process by a process key

Parameters​

pProcessKey
string | number | boolean

The key of the process definition

pVariables
any

Variables that will be set for the process instance

Returns​

string

The id of the process instance that was created.

Throws​

AditoException


triggerReceiveTask​

triggerReceiveTask(pProcessInstanceId, pReceiveTaskId?, pVariables?): void

Triggers a receive task so that a process instance can continue its execution.

Parameters​

pProcessInstanceId
string | number | boolean

The id of the waiting process instance

pReceiveTaskId?
string | number | boolean

The id of the receive task

pVariables?
Map<string, any>

Variables to set for the process instance

Returns​

void

Throws​

AditoException