Package pro.taskana.task.api.models
Interface Task
- All Superinterfaces:
TaskSummary
- All Known Implementing Classes:
TaskImpl
Task-Interface to specify the model of a Task.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe key that is used to supply Callback_state within the CallbackInfo map.Fields inherited from interface pro.taskana.task.api.models.TaskSummary
DEFAULT_MANUAL_PRIORITY -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttachment(Attachment attachment) Add an Attachment.
NULL will be ignored and an Attachment with the same id will be replaced by the newer one.Returns a summary of the current Task.copy()Duplicates this Task without the internal and external id.Return the attachment for the Task.Returns the callbackInfo.Returns the category of the current Classification.Returns a Map of customAttributes.intReturns the count of the comments of the current Task.Returns the key of the Workbasket where the Task is stored in.removeAttachment(String attachmentID) Removes an attachment of the current Task locally, when the ID is represented and does return the removed attachment or null if there was no match.
The changed Task need to be updated calling the TaskService.updateTask(Task).voidsetBusinessProcessId(String businessProcessId) Sets the associated businessProcessId.voidsetCallbackInfo(Map<String, String> callbackInfo) Sets the callbackInfo.voidsetClassificationKey(String classificationKey) Sets the key of the Classification that - together with the domain from the Workbasket of the Task - selects the appropriate Classification for this Task.voidsetCustomAttribute(TaskCustomField customField, String value) Deprecated.Use setCustomField(TaskCustomField, String) insteadvoidsetCustomAttributeMap(Map<String, String> customAttributes) Sets a Map of custom attributes.voidsetCustomField(TaskCustomField customField, String value) Sets the value for the specified customField.voidsetCustomIntField(TaskCustomIntField customIntField, Integer value) Sets the value for the specified custoIntField.voidsetDescription(String description) Sets the description of the Task.voidSets the time when the work on this Task should be finished.voidsetExternalId(String externalId) Sets the external Id.voidsetManualPriority(int manualPriority) Sets the manualPriority of the Task.voidSets the name of the current Task.voidSets/Changing the custom note for this Task.voidSets the id of the owner of the Task.voidsetParentBusinessProcessId(String parentBusinessProcessId) Sets the parentBusinessProcessId.voidsetPlanned(Instant planned) Sets the time when the work on this Task should be started.voidInitializes and sets the primaryObjectReference of the Task.voidsetPrimaryObjRef(ObjectReference primaryObjRef) Sets the primaryObjectReference of the Task.voidsetReceived(Instant received) Sets the time when the surrounding process started.Methods inherited from interface pro.taskana.task.api.models.TaskSummary
addSecondaryObjectReference, addSecondaryObjectReference, getAttachmentSummaries, getBusinessProcessId, getClaimed, getClassificationSummary, getCompleted, getCreated, getCreator, getCustomAttribute, getCustomField, getCustomIntField, getDescription, getDomain, getDue, getExternalId, getGroupByCount, getId, getManualPriority, getModified, getName, getNote, getOwner, getOwnerLongName, getParentBusinessProcessId, getPlanned, getPrimaryObjRef, getPriority, getReceived, getSecondaryObjectReferences, getState, getWorkbasketSummary, isManualPriorityActive, isRead, isTransferred, removeSecondaryObjectReference
-
Field Details
-
CALLBACK_STATE
The key that is used to supply Callback_state within the CallbackInfo map. The Callback_state is used predominantly by the taskana adapter. It controls synchronization between taskana and the external system.- See Also:
-
-
Method Details
-
setExternalId
Sets the external Id. It can be used to correlate the Task to a Task in an external system. The external Id is enforced to be unique. An attempt to create a Task with an existing external Id will be rejected. So, this Id can be used to enforce idempotency of Task creation. The externalId can only be set before the Task is inserted. Taskana rejects attempts to modify externalId.- Parameters:
externalId- the externalId
-
setPlanned
Sets the time when the work on this Task should be started.- Parameters:
planned- as exact Instant
-
setReceived
Sets the time when the surrounding process started.- Parameters:
received- as exact Instant
-
setDue
Sets the time when the work on this Task should be finished.duedenotes the last point in the allowed work time has ended or in short it is inclusive.- Parameters:
due- as exact Instant
-
setName
Sets the name of the current Task.- Parameters:
name- the name of the Task
-
setDescription
Sets the description of the Task.- Parameters:
description- the description of the Task
-
setClassificationKey
Sets the key of the Classification that - together with the domain from the Workbasket of the Task - selects the appropriate Classification for this Task.- Parameters:
classificationKey- the key of the Classification for the Task
-
setManualPriority
void setManualPriority(int manualPriority) Sets the manualPriority of the Task. If the value of manualPriority is zero or greater, the priority is automatically set to manualPriority. In this case, all computations of priority are disabled. If the value of manualPriority is negative, Tasks are not prioritized manually.- Parameters:
manualPriority- the value for manualPriority of the Task
-
getWorkbasketKey
String getWorkbasketKey()Returns the key of the Workbasket where the Task is stored in.- Returns:
- workbasketKey
-
getCustomAttributeMap
Returns a Map of customAttributes.- Returns:
- customAttributes as Map
-
setCustomAttributeMap
Sets a Map of custom attributes.- Parameters:
customAttributes- a Map that contains the custom attributes
-
getCallbackInfo
Returns the callbackInfo.- Returns:
- callbackInfo as Map
-
setCallbackInfo
Sets the callbackInfo.- Parameters:
callbackInfo- a Map that contains the callback information
-
setCustomAttribute
Deprecated.Use setCustomField(TaskCustomField, String) insteadSets the value for the specified customField.- Parameters:
customField- identifies which customField is to be setvalue- the value of the customField to be set
-
setCustomField
Sets the value for the specified customField.- Parameters:
customField- identifies which customField is to be set.value- the value of the customField to be set
-
setCustomIntField
Sets the value for the specified custoIntField.- Parameters:
customIntField- identifies which customIntField is to be setvalue- the value of the customIntField to be set
-
addAttachment
Add an Attachment.
NULL will be ignored and an Attachment with the same id will be replaced by the newer one.- Parameters:
attachment- the attachment to be added to the Task
-
getAttachments
List<Attachment> getAttachments()Return the attachment for the Task.
Do not use List.add()/addAll() for adding elements, because it can cause redundant data. Use addAttachment(). Clear() and remove() can be used, because it's a controllable change.- Returns:
- the List of attachments for this Task
-
setBusinessProcessId
Sets the associated businessProcessId.- Parameters:
businessProcessId- Sets the businessProcessId the Task belongs to.
-
setParentBusinessProcessId
Sets the parentBusinessProcessId. ParentBusinessProcessId is needed to group associated processes and to identify the main process.- Parameters:
parentBusinessProcessId- the business process id of the parent the Task belongs to
-
setOwner
Sets the id of the owner of the Task.- Parameters:
taskOwnerId- the id of the owner of the Task
-
setPrimaryObjRef
Sets the primaryObjectReference of the Task.- Parameters:
primaryObjRef- to Task main-subject
-
setPrimaryObjRef
void setPrimaryObjRef(String company, String system, String systemInstance, String type, String value) Initializes and sets the primaryObjectReference of the Task.- Parameters:
company- of the primaryObjectReference to be setsystem- of the primaryObjectReference to be setsystemInstance- of the primaryObjectReference to be settype- of the primaryObjectReference to be setvalue- of the primaryObjectReference to be set
-
setNote
Sets/Changing the custom note for this Task.- Parameters:
note- the custom note for this Task.
-
asSummary
TaskSummary asSummary()Returns a summary of the current Task.- Returns:
- the TaskSummary object for the current Task
-
removeAttachment
Removes an attachment of the current Task locally, when the ID is represented and does return the removed attachment or null if there was no match.
The changed Task need to be updated calling the TaskService.updateTask(Task).- Parameters:
attachmentID- ID of the attachment which should be removed.- Returns:
- attachment which will be removed after updating OR null if there was no match.
-
getClassificationCategory
String getClassificationCategory()Returns the category of the current Classification.- Returns:
- classificationCategory
-
getNumberOfComments
int getNumberOfComments()Returns the count of the comments of the current Task.- Specified by:
getNumberOfCommentsin interfaceTaskSummary- Returns:
- numberOfComments
-
copy
Task copy()Duplicates this Task without the internal and external id. All referenced Attachments and ObjectReferences are copied as well.- Specified by:
copyin interfaceTaskSummary- Returns:
- a copy of this Task
-