bpm/tasks
Documentation
- source: bpm/tasks.ts
Overview
Classes
Tasks
list()
tsstatic list(): void;Returns
- Type:
void- Description:
getVariable()
tsstatic getVariable(taskId: string, variableName: string): any;
Parameter Type Description taskIdstringvariableNamestringReturns
- Type:
any- Description:
getVariables()
Returns all variables. This will include all variables of parent scopes too.
tsstatic getVariables(taskId: string): Map;
Parameter Type Description taskIdstringReturns
- Type:
Map- Description:
setVariable()
tsstatic setVariable(taskId: string, variableName: string, value: any): void;
Parameter Type Description taskIdstringvariableNamestringvalueanyReturns
- Type:
void- Description:
setVariables()
tsstatic setVariables(taskId: string, variables: Map): void;
Parameter Type Description taskIdstringvariablesMapReturns
- Type:
void- Description:
complete()
tsstatic complete(taskId: string, variables: any): void;
Parameter Type Description taskIdstringvariablesanyReturns
- Type:
void- Description:
getTaskService()
tsstatic getTaskService(): TaskService;Returns
- Type:
TaskService- Description:
TaskService
newTask()
Creates a new task that is not related to any process instance.
The returned task is transient and must be saved with #saveTask(Task) 'manually'.
tsnewTask(taskId: string): Task;
Parameter Type Description taskIdstringReturns
- Type:
Task- Description:
createTaskBuilder()
Create a builder for the task
tscreateTaskBuilder(): TaskBuilder;Returns
- Type:
TaskBuilder- Description: task builder
saveTask()
Saves the given task to the persistent data store. If the task is already present in the persistent store, it is updated. After a new task has been saved, the task instance passed into this method is updated with the id of the newly created task.
tssaveTask(task: Task): void;
Parameter Type Description taskTaskthe task, cannot be null. Returns
- Type:
void- Description:
bulkSaveTasks()
Saves the given tasks to the persistent data store. If the tasks are already present in the persistent store, it is updated. After a new task has been saved, the task instance passed into this method is updated with the id of the newly created task.
tsbulkSaveTasks(taskList: any): void;
Parameter Type Description taskListanythe list of task instances, cannot be null. Returns
- Type:
void- Description:
deleteTask()
Deletes the given task, not deleting historic information that is related to this task.
tsdeleteTask(taskId: string, cascade: boolean): void;
Parameter Type Description taskIdstringThe id of the task that will be deleted, cannot be null. If no task exists with the given taskId, the operation is ignored. cascadebooleanIf cascade is true, also the historic information related to this task is deleted. Returns
- Type:
void- Description:
deleteTasks()
Deletes all tasks of the given collection, not deleting historic information that is related to these tasks.
tsdeleteTasks(taskIds: any, cascade: boolean): void;
Parameter Type Description taskIdsanyThe id's of the tasks that will be deleted, cannot be null. All id's in the list that don't have an existing task will be ignored. cascadebooleanIf cascade is true, also the historic information related to this task is deleted. Returns
- Type:
void- Description:
deleteTaskWithReason()
Deletes the given task, not deleting historic information that is related to this task..
tsdeleteTaskWithReason(taskId: string, deleteReason: string): void;
Parameter Type Description taskIdstringThe id of the task that will be deleted, cannot be null. If no task exists with the given taskId, the operation is ignored. deleteReasonstringreason the task is deleted. Is recorded in history, if enabled. Returns
- Type:
void- Description:
deleteTasksWithReason()
Deletes all tasks of the given collection, not deleting historic information that is related to these tasks.
tsdeleteTasksWithReason(taskIds: any, deleteReason: string): void;
Parameter Type Description taskIdsanyThe id's of the tasks that will be deleted, cannot be null. All id's in the list that don't have an existing task will be ignored. deleteReasonstringreason the task is deleted. Is recorded in history, if enabled. Returns
- Type:
void- Description:
claim()
Claim responsibility for a task: the given user is made assignee for the task. The difference with #setAssignee(String, String) is that here a check is done if the task already has a user assigned to it. No check is done whether the user is known by the identity component.
tsclaim(taskId: string, userId: string): void;
Parameter Type Description taskIdstringtask to claim, cannot be null. userIdstringuser that claims the task. When userId is null the task is unclaimed, assigned to no one. Returns
- Type:
void- Description:
unclaim()
A shortcut to #claim with null user in order to unclaim the task
tsunclaim(taskId: string): void;
Parameter Type Description taskIdstringtask to unclaim, cannot be null. Returns
- Type:
void- Description:
startProgress()
Set the task state to in progress. No check is done whether the user is known by the identity component.
tsstartProgress(taskId: string, userId: string): void;
Parameter Type Description taskIdstringtask to change the state, cannot be null. userIdstringuser that puts the task in progress. Returns
- Type:
void- Description:
suspendTask()
Suspends the task. No check is done whether the user is known by the identity component.
tssuspendTask(taskId: string, userId: string): void;
Parameter Type Description taskIdstringtask to suspend, cannot be null. userIdstringuser that suspends the task. Returns
- Type:
void- Description:
activateTask()
Activates the task. No check is done whether the user is known by the identity component.
tsactivateTask(taskId: string, userId: string): void;
Parameter Type Description taskIdstringtask to activate, cannot be null. userIdstringuser that activates the task. Returns
- Type:
void- Description:
delegateTask()
Delegates the task to another user. This means that the assignee is set and the delegation state is set to DelegationState#PENDING. If no owner is set on the task, the owner is set to the current assignee of the task.
tsdelegateTask(taskId: string, userId: string): void;
Parameter Type Description taskIdstringThe id of the task that will be delegated. userIdstringThe id of the user that will be set as assignee. Returns
- Type:
void- Description:
resolveTask()
Marks that the assignee is done with this task and that it can be send back to the owner. Can only be called when this task is DelegationState#PENDING delegation. After this method returns, the () delegationState is set to DelegationState#RESOLVED.
tsresolveTask(taskId: string, variables: Map, transientVariables: Map): void;
Parameter Type Description taskIdstringthe id of the task to resolve, cannot be null. variablesMaptransientVariablesMapReturns
- Type:
void- Description:
complete()
Called when the task is successfully executed.
tscomplete(taskId: string, userId: string, variables: Map, transientVariables: Map, localScope: boolean): void;
Parameter Type Description taskIdstringthe id of the task to complete, cannot be null. userIdstringuser that completes the task. variablesMaptask parameters. May be null or empty. transientVariablesMaptask parameters. May be null or empty. localScopebooleanIf true, the provided variables will be stored task-local, instead of process instance wide (which is the default behaviour). Returns
- Type:
void- Description:
completeTaskWithForm()
Called when the task is successfully executed, and the task form has been submitted.
tscompleteTaskWithForm(taskId: string, formDefinitionId: string, outcome: string, variables: Map, userId: string, transientVariables: Map, localScope: boolean): void;
Parameter Type Description taskIdstringthe id of the task to complete, cannot be null. formDefinitionIdstringthe id of the form definition that is filled-in to complete the task, cannot be null. outcomestringthe outcome of the completed form, can be null. variablesMapvalues of the completed form. May be null or empty. userIdstringuser that completes the task. transientVariablesMapadditional transient values that need to added to the process instance transient variables. May be null or empty. localScopebooleanIf true, the provided variables will be stored task-local, instead of process instance wide (which is the default for #complete(String, Map)). Returns
- Type:
void- Description:
getTaskFormModel()
Gets a Form model instance of the task form of a specific task
tsgetTaskFormModel(taskId: string, ignoreVariables: boolean): FormInfo;
Parameter Type Description taskIdstringid of the task, cannot be null. ignoreVariablesbooleanshould the variables be ignored when fetching the form model? Returns
- Type:
FormInfo- Description:
setAssignee()
Changes the assignee of the given task to the given userId. No check is done whether the user is known by the identity component.
tssetAssignee(taskId: string, userId: string): void;
Parameter Type Description taskIdstringid of the task, cannot be null. userIdstringid of the user to use as assignee. Returns
- Type:
void- Description:
setOwner()
Transfers ownership of this task to another user. No check is done whether the user is known by the identity component.
tssetOwner(taskId: string, userId: string): void;
Parameter Type Description taskIdstringid of the task, cannot be null. userIdstringof the person that is receiving ownership. Returns
- Type:
void- Description:
getIdentityLinksForTask()
Retrieves the IdentityLinks associated with the given task. Such an IdentityLink informs how a certain identity (eg. group or user) is associated with a certain task (eg. as candidate, assignee, etc.)
tsgetIdentityLinksForTask(taskId: string): void;
Parameter Type Description taskIdstringReturns
- Type:
void- Description:
addCandidateUser()
Convenience shorthand for #addUserIdentityLink(String, String, String); with type IdentityLinkType#CANDIDATE
tsaddCandidateUser(taskId: string, userId: string): void;
Parameter Type Description taskIdstringid of the task, cannot be null. userIdstringid of the user to use as candidate, cannot be null. Returns
- Type:
void- Description:
addCandidateGroup()
Convenience shorthand for #addGroupIdentityLink(String, String, String); with type IdentityLinkType#CANDIDATE
tsaddCandidateGroup(taskId: string, groupId: string): void;
Parameter Type Description taskIdstringid of the task, cannot be null. groupIdstringid of the group to use as candidate, cannot be null. Returns
- Type:
void- Description:
addUserIdentityLink()
Involves a user with a task. The type of identity link is defined by the given identityLinkType.
tsaddUserIdentityLink(taskId: string, userId: string, identityLinkType: string): void;
Parameter Type Description taskIdstringid of the task, cannot be null. userIdstringid of the user involve, cannot be null. identityLinkTypestringtype of identityLink, cannot be null (@see IdentityLinkType). Returns
- Type:
void- Description:
addGroupIdentityLink()
Involves a group with a task. The type of identityLink is defined by the given identityLink.
tsaddGroupIdentityLink(taskId: string, groupId: string, identityLinkType: string): void;
Parameter Type Description taskIdstringid of the task, cannot be null. groupIdstringid of the group to involve, cannot be null. identityLinkTypestringtype of identity, cannot be null (@see IdentityLinkType). Returns
- Type:
void- Description:
deleteCandidateUser()
Convenience shorthand for #deleteUserIdentityLink(String, String, String); with type IdentityLinkType#CANDIDATE
tsdeleteCandidateUser(taskId: string, userId: string): void;
Parameter Type Description taskIdstringid of the task, cannot be null. userIdstringid of the user to use as candidate, cannot be null. Returns
- Type:
void- Description:
deleteCandidateGroup()
Convenience shorthand for #deleteGroupIdentityLink(String, String, String); with type IdentityLinkType#CANDIDATE
tsdeleteCandidateGroup(taskId: string, groupId: string): void;
Parameter Type Description taskIdstringid of the task, cannot be null. groupIdstringid of the group to use as candidate, cannot be null. Returns
- Type:
void- Description:
deleteUserIdentityLink()
Removes the association between a user and a task for the given identityLinkType.
tsdeleteUserIdentityLink(taskId: string, userId: string, identityLinkType: string): void;
Parameter Type Description taskIdstringid of the task, cannot be null. userIdstringid of the user involve, cannot be null. identityLinkTypestringtype of identityLink, cannot be null (@see IdentityLinkType). Returns
- Type:
void- Description:
deleteGroupIdentityLink()
Removes the association between a group and a task for the given identityLinkType.
tsdeleteGroupIdentityLink(taskId: string, groupId: string, identityLinkType: string): void;
Parameter Type Description taskIdstringid of the task, cannot be null. groupIdstringid of the group to involve, cannot be null. identityLinkTypestringtype of identity, cannot be null (@see IdentityLinkType). Returns
- Type:
void- Description:
setPriority()
Changes the priority of the task.
Authorization: actual owner / business admin
tssetPriority(taskId: string, priority: number): void;
Parameter Type Description taskIdstringid of the task, cannot be null. prioritynumberthe new priority for the task. Returns
- Type:
void- Description:
setDueDate()
Changes the due date of the task
tssetDueDate(taskId: string, dueDate: Date): void;
Parameter Type Description taskIdstringid of the task, cannot be null. dueDateDatethe new due date for the task Returns
- Type:
void- Description:
setVariable()
set variable on a task. If the variable is not already existing, it will be created in the most outer scope. This means the process instance in case this task is related to an execution.
tssetVariable(taskId: string, variableName: string, value: any): void;
Parameter Type Description taskIdstringvariableNamestringvalueanyReturns
- Type:
void- Description:
setVariables()
set variables on a task. If the variable is not already existing, it will be created in the most outer scope. This means the process instance in case this task is related to an execution.
tssetVariables(taskId: string, variables: Map): void;
Parameter Type Description taskIdstringvariablesMapReturns
- Type:
void- Description:
setVariableLocal()
set variable on a task. If the variable is not already existing, it will be created in the task.
tssetVariableLocal(taskId: string, variableName: string, value: any): void;
Parameter Type Description taskIdstringvariableNamestringvalueanyReturns
- Type:
void- Description:
setVariablesLocal()
set variables on a task. If the variable is not already existing, it will be created in the task.
tssetVariablesLocal(taskId: string, variables: Map): void;
Parameter Type Description taskIdstringvariablesMapReturns
- Type:
void- Description:
getVariable()
get a variables and search in the task scope and if available also the execution scopes.
tsgetVariable(taskId: string, variableName: string): any;
Parameter Type Description taskIdstringvariableNamestringReturns
- Type:
any- Description:
getVariableInstance()
The variable. Searching for the variable is done in all scopes that are visible to the given task (including parent scopes). Returns null when no variable value is found with the given name.
tsgetVariableInstance(taskId: string, variableName: string): VariableInstance;
Parameter Type Description taskIdstringid of task, cannot be null. variableNamestringname of variable, cannot be null. Returns
- Type:
VariableInstance- Description: the variable or null if the variable is undefined.
hasVariable()
checks whether or not the task has a variable defined with the given name, in the task scope and if available also the execution scopes.
tshasVariable(taskId: string, variableName: string): boolean;
Parameter Type Description taskIdstringvariableNamestringReturns
- Type:
boolean- Description:
getVariableLocal()
checks whether or not the task has a variable defined with the given name.
tsgetVariableLocal(taskId: string, variableName: string): any;
Parameter Type Description taskIdstringvariableNamestringReturns
- Type:
any- Description:
getVariableInstanceLocal()
The variable for a task. Returns the variable when it is set for the task (and not searching parent scopes). Returns null when no variable is found with the given name.
tsgetVariableInstanceLocal(taskId: string, variableName: string): VariableInstance;
Parameter Type Description taskIdstringid of task, cannot be null. variableNamestringname of variable, cannot be null. Returns
- Type:
VariableInstance- Description: the variable or null if the variable is undefined.
hasVariableLocal()
checks whether or not the task has a variable defined with the given name, local task scope only.
tshasVariableLocal(taskId: string, variableName: string): boolean;
Parameter Type Description taskIdstringvariableNamestringReturns
- Type:
boolean- Description:
getVariables()
get all variables and search in the task scope and if available also the execution scopes. If you have many variables and you only need a few, consider using #getVariables(String, Collection) for better performance.
tsgetVariables(taskId: string, variableNames: any): Map;
Parameter Type Description taskIdstringvariableNamesanyReturns
- Type:
Map- Description:
getVariableInstances()
All variables visible from the given task scope (including parent scopes).
tsgetVariableInstances(taskId: string, variableNames: any): Map;
Parameter Type Description taskIdstringid of task, cannot be null. variableNamesanythe collection of variable names that should be retrieved. Returns
- Type:
Map- Description: the variable instances or an empty map if no such variables are found.
getVariablesLocal()
get all variables and search only in the task scope. If you have many task local variables and you only need a few, consider using #getVariablesLocal(String, Collection) for better performance.
tsgetVariablesLocal(taskId: string, variableNames: any): Map;
Parameter Type Description taskIdstringvariableNamesanyReturns
- Type:
Map- Description:
getVariableInstancesLocalByTaskIds()
get all variables and search only in the task scope.
tsgetVariableInstancesLocalByTaskIds(taskIds: Set): void;
Parameter Type Description taskIdsSetReturns
- Type:
void- Description:
getVariableInstancesLocal()
All variable values that are defined in the task scope, without taking outer scopes into account. If you have many task local variables and you only need a few, consider using #getVariableInstancesLocal(String, Collection) for better performance.
tsgetVariableInstancesLocal(taskId: string, variableNames: any): Map;
Parameter Type Description taskIdstringid of task, cannot be null. variableNamesanyReturns
- Type:
Map- Description: the variables or an empty map if no such variables are found.
removeVariable()
Removes the variable from the task. When the variable does not exist, nothing happens.
tsremoveVariable(taskId: string, variableName: string): void;
Parameter Type Description taskIdstringvariableNamestringReturns
- Type:
void- Description:
removeVariableLocal()
Removes the variable from the task (not considering parent scopes). When the variable does not exist, nothing happens.
tsremoveVariableLocal(taskId: string, variableName: string): void;
Parameter Type Description taskIdstringvariableNamestringReturns
- Type:
void- Description:
removeVariables()
Removes all variables in the given collection from the task. Non existing variable names are simply ignored.
tsremoveVariables(taskId: string, variableNames: any): void;
Parameter Type Description taskIdstringvariableNamesanyReturns
- Type:
void- Description:
removeVariablesLocal()
Removes all variables in the given collection from the task (not considering parent scopes). Non existing variable names are simply ignored.
tsremoveVariablesLocal(taskId: string, variableNames: any): void;
Parameter Type Description taskIdstringvariableNamesanyReturns
- Type:
void- Description:
getDataObjects()
All DataObjects visible from the given execution scope (including parent scopes).
tsgetDataObjects(taskId: string, dataObjectNames: any, locale: string, withLocalizationFallback: boolean): Map;
Parameter Type Description taskIdstringid of task, cannot be null. dataObjectNamesanythe collection of DataObject names that should be retrieved. localestringlocale the DataObject name and description should be returned in (if available). withLocalizationFallbackbooleanWhen true localization will fallback to more general locales if the specified locale is not found. Returns
- Type:
Map- Description: the DataObjects or an empty map if no such variables are found.
getDataObject()
The DataObject. Searching for the DataObject is done in all scopes that are visible to the given task (including parent scopes). Returns null when no DataObject value is found with the given name.
tsgetDataObject(taskId: string, dataObject: string, locale: string, withLocalizationFallback: boolean): DataObject;
Parameter Type Description taskIdstringid of task, cannot be null. dataObjectstringname of DataObject, cannot be null. localestringlocale the DataObject name and description should be returned in (if available). withLocalizationFallbackbooleanWhen true localization will fallback to more general locales including the default locale of the JVM if the specified locale is not found. Returns
- Type:
DataObject- Description: the DataObject or null if the variable is undefined.
addComment()
Add a comment to a task and/or process instance.
tsaddComment(taskId: string, processInstanceId: string, message: string, type: string): Comment;
Parameter Type Description taskIdstringprocessInstanceIdstringmessagestringtypestringReturns
- Type:
Comment- Description:
saveComment()
Update a comment to a task and/or process instance.
tssaveComment(comment: Comment): void;
Parameter Type Description commentCommentReturns
- Type:
void- Description:
getComment()
Returns an individual comment with the given id. Returns null if no comment exists with the given id.
tsgetComment(commentId: string): Comment;
Parameter Type Description commentIdstringReturns
- Type:
Comment- Description:
deleteComments()
Removes all comments from the provided task and/or process instance
tsdeleteComments(taskId: string, processInstanceId: string): void;
Parameter Type Description taskIdstringprocessInstanceIdstringReturns
- Type:
void- Description:
deleteComment()
Removes an individual comment with the given id.
tsdeleteComment(commentId: string): void;
Parameter Type Description commentIdstringReturns
- Type:
void- Description:
getTaskComments()
The comments related to the given task.
tsgetTaskComments(taskId: string, type: string): void;
Parameter Type Description taskIdstringtypestringReturns
- Type:
void- Description:
getCommentsByType()
All comments of a given type.
tsgetCommentsByType(type: string): void;
Parameter Type Description typestringReturns
- Type:
void- Description:
getTaskEvents()
The all events related to the given task.
tsgetTaskEvents(taskId: string): void;
Parameter Type Description taskIdstringReturns
- Type:
void- Description:
getEvent()
Returns an individual event with the given id. Returns null if no event exists with the given id.
tsgetEvent(eventId: string): TaskEvent;
Parameter Type Description eventIdstringReturns
- Type:
TaskEvent- Description:
getProcessInstanceComments()
The comments related to the given process instance.
tsgetProcessInstanceComments(processInstanceId: string, type: string): void;
Parameter Type Description processInstanceIdstringtypestringReturns
- Type:
void- Description:
createAttachment()
Add a new attachment to a task and/or a process instance and use an input stream to provide the content
tscreateAttachment(attachmentType: string, taskId: string, processInstanceId: string, attachmentName: string, attachmentDescription: string, content: any, url: string): Attachment;
Parameter Type Description attachmentTypestringtaskIdstringprocessInstanceIdstringattachmentNamestringattachmentDescriptionstringcontentanyurlstringReturns
- Type:
Attachment- Description:
saveAttachment()
Update the name and description of an attachment
tssaveAttachment(attachment: Attachment): void;
Parameter Type Description attachmentAttachmentReturns
- Type:
void- Description:
getAttachment()
Retrieve a particular attachment
tsgetAttachment(attachmentId: string): Attachment;
Parameter Type Description attachmentIdstringReturns
- Type:
Attachment- Description:
getAttachmentContent()
Retrieve stream content of a particular attachment
tsgetAttachmentContent(attachmentId: string): void;
Parameter Type Description attachmentIdstringReturns
- Type:
void- Description:
getTaskAttachments()
The list of attachments associated to a task
tsgetTaskAttachments(taskId: string): void;
Parameter Type Description taskIdstringReturns
- Type:
void- Description:
getProcessInstanceAttachments()
The list of attachments associated to a process instance
tsgetProcessInstanceAttachments(processInstanceId: string): void;
Parameter Type Description processInstanceIdstringReturns
- Type:
void- Description:
deleteAttachment()
Delete an attachment
tsdeleteAttachment(attachmentId: string): void;
Parameter Type Description attachmentIdstringReturns
- Type:
void- Description:
getSubTasks()
The list of subtasks for this parent task
tsgetSubTasks(parentTaskId: string): void;
Parameter Type Description parentTaskIdstringReturns
- Type:
void- Description:
