workflow
JDITO-Funktionen für die ProcessEngine
Methods
addTaskCandidateGroup
addTaskCandidateGroup(
pTaskId,pCandidateGroup):void
Adds a candidate group to a task.
Parameters
string | number | booleanthe id of the task
string | number | booleanthe name of the candidate group
Returns
voidThrows
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
string | number | booleanThe id of the task
string | number | booleanThe id of the user
Returns
voidThrows
AditoException
completeTask
completeTask(
pTaskId,pVariables):void
Sets a task as completed.
Parameters
string | number | booleanThe id of the task
anyVariables that should be set for the process instance.
Returns
voidThrows
AditoException
completeTaskWithFormData
completeTaskWithFormData(
pTaskId,pProperties):void
Completes a task with the user data that was entered in the form.
Parameters
string | number | booleanthe id of the task
Map<string, any>the form data that was entered
Returns
voidThrows
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
string | number | booleanThe key to set for the deployment
Returns
voidThrows
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
string | number | booleanThe id of the process instance
string | number | booleanReason why the instance was deleted
Returns
voidThrows
AditoException
deleteTaskCandidateGroup
deleteTaskCandidateGroup(
pTaskId,pCandidateGroup):void
Removes a candidate group from a task.
Parameters
string | number | booleanthe id of the task
string | number | booleanthe name of the candidate group
Returns
voidThrows
AditoException
deployProcess
deployProcess(
pDeploymentKey,pProcessXML):string
Deploys the given process definition into the system
Parameters
string | number | booleanThe key to set for the deployment
string | number | booleanXML-String containing the process definition(s), BPMN2.0
Returns
stringThe deployment id, or null if the deploy failed
Throws
AditoException
getFinishedActivities
getFinishedActivities(
pProcessInstanceId):string
Loads all finished activities of one process instance
Parameters
string | number | booleanThe id of the process instance
Returns
stringJSON-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
string | number | booleanthe task id
Returns
stringthe 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
string | number | booleanthe id of the task
Map<string, any>the current values of the form, required if some fields use a visibility expression
Returns
stringEither 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
Configuration object created by workflow.createConfigForLoadingHistoricInstances
Returns
stringJSON-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
Configuration object created by workflow.createConfigForLoadingHistoricTasks
Returns
stringJSON-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
string | number | booleanthe key of the process definition
Returns
stringthe id of the latest process definition
Throws
AditoException
getMessageDefinitions
getMessageDefinitions(
pProcessDefinitionId):string
Loads all message definitions of a process definition.
Parameters
string | number | booleanThe id of the process definition
Returns
stringArray 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
Configuration object created by workflow.createConfigForLoadingProcessDefinition
Returns
stringJSON-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
Configuration object created by workflow.createConfigForLoadingProcessDefinitions
Returns
stringJSON-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
string | number | booleanThe id of the process definition
Returns
stringBase64-String containing the diagram as an image
Throws
AditoException
getProcessIds
getProcessIds(
pProcessXML):string
Extracts all process ids from the given XML-String
Parameters
string | number | booleanBPMN2.0-XML containing the processes
Returns
stringArray with all process ids as JSON-String
Throws
AditoException
getProcessInstance
getProcessInstance(
pLoadProcessInstanceConfig):string
Loads a single process instance depending on the given config.
Parameters
Configuration object created by workflow.createConfigForLoadingProcessInstance
Returns
stringJSON-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
Configuration object created by workflow.createConfigForLoadingProcessInstances
Returns
stringJSON-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
string | number | booleanthe id of the process instance
Returns
stringJSON containing the variable names and their values
Throws
AditoException
getProcessXML
getProcessXML(
pProcessDefinitionId):string
Gets the BPMN model of the process definition as XML.
Parameters
string | number | booleanThe id of the process definition
Returns
stringProcess-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
string | number | booleanthe name of the service task
string | number | booleanadditional data that will be available in the serviceTaskParameterProcess as "$local.value"
Returns
stringJSON with the parameter definitions
getSignalDefinitions
getSignalDefinitions(
pProcessDefinitionId):string
Loads all signal definitions of a process definition.
Parameters
string | number | booleanThe id of the process definition
Returns
stringArray 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
string | number | booleanthe id of the process definition
Returns
stringEither 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
Returns
stringJSON-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
Returns
stringJSON-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
string | number | booleanthe id of the task
Returns
stringJSON 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
string | number | booleanThe name of the message event
string | number | booleanThe id of the process instance waiting for the message
Map<string, any>Variables to set for the given process instance
Returns
voidThrows
AditoException
saveFormData
saveFormData(
pTaskId,pProperties):void
Saves the data that was entered in a task form.
Parameters
string | number | booleanthe id of the task
Map<string, any>the form data that was entered
Returns
voidThrows
AditoException
setProcessActive
setProcessActive(
pProcessDefinitionId,pActive):void
Sets whether the process definition is active or not.
Parameters
string | number | booleanthe id of the process definition
booleantrue to set it active, false to set it inactive
Returns
voidThrows
AditoException
setProcessDefinitionCategory
setProcessDefinitionCategory(
pProcessDefinitionId,pCategory):void
Changes the category of a process definition
Parameters
string | number | booleanThe id of the process definition
string | number | booleanThe new category
Returns
voidThrows
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
string | number | booleanThe id of the process instance
booleantrue to activate the instance, false to suspend it
Returns
voidThrows
AditoException
setProcessInstanceName
setProcessInstanceName(
pProcessInstanceId,pName):void
Changes the name of a process instance
Parameters
string | number | booleanThe id of the process instance
string | number | booleanThe new name
Returns
voidThrows
AditoException
setProcessInstanceVariables
setProcessInstanceVariables(
pProcessInstanceId,pVariables):void
Sets variables of one process instance.
Parameters
string | number | booleanThe id of the process instance
Map<string, any>Variables to set
Returns
voidThrows
AditoException
setTaskAssignee
setTaskAssignee(
pTaskId,pUserId):void
Sets the assignee of a task.
Parameters
string | number | booleanThe id of the task
string | number | booleanThe id of the user
Returns
voidThrows
AditoException
signalEventReceived
signalEventReceived(
pName,pVariables?,pProcessInstanceId?):void
Notifies a single process instance that a signal event has been received.
Parameters
string | number | booleanThe name of the signal
Map<string, any>Variables to set for the instance
string | number | booleanThe id of the process instance
Returns
voidThrows
AditoException
startProcessByKey
startProcessByKey(
pProcessKey,pVariables):string
Starts a new process by a process key
Parameters
string | number | booleanThe key of the process definition
anyVariables that will be set for the process instance
Returns
stringThe 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
string | number | booleanThe id of the waiting process instance
string | number | booleanThe id of the receive task
Map<string, any>Variables to set for the process instance
Returns
voidThrows
AditoException