Package pro.taskana.task.api.models
Interface Task
-
- All Superinterfaces:
TaskSummary
- All Known Implementing Classes:
TaskImpl
public interface Task extends TaskSummary
Task-Interface to specify the model of a Task.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCALLBACK_STATEThe 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
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddAttachment(Attachment attachment)Add an Attachment.
NULL will be ignored and an Attachment with the same id will be replaced by the newer one.TaskSummaryasSummary()Returns a summary of the current Task.Taskcopy()Duplicates this Task without the internal and external id.List<Attachment>getAttachments()Return the attachment for the Task.Map<String,String>getCallbackInfo()Returns the callbackInfo.StringgetClassificationCategory()Returns the category of the current Classification.Map<String,String>getCustomAttributeMap()Returns a Map of customAttributes.StringgetWorkbasketKey()Returns the key of the Workbasket where the Task is stored in.AttachmentremoveAttachment(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.voidsetDue(Instant due)Sets 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.voidsetName(String name)Sets the name of the current Task.voidsetNote(String note)Sets/Changing the custom note for this Task.voidsetOwner(String taskOwnerId)Sets 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.voidsetPrimaryObjRef(String company, String system, String systemInstance, String type, String value)Initializes 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, getId, getManualPriority, getModified, getName, getNote, getOwner, getOwnerLongName, getParentBusinessProcessId, getPlanned, getPrimaryObjRef, getPriority, getReceived, getSecondaryObjectReferences, getState, getWorkbasketSummary, isManualPriorityActive, isRead, isTransferred, removeSecondaryObjectReference
-
-
-
-
Field Detail
-
CALLBACK_STATE
static final String 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:
- Constant Field Values
-
-
Method Detail
-
setExternalId
void setExternalId(String externalId)
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
void setPlanned(Instant planned)
Sets the time when the work on this Task should be started.- Parameters:
planned- as exact Instant
-
setReceived
void setReceived(Instant received)
Sets the time when the surrounding process started.- Parameters:
received- as exact Instant
-
setDue
void setDue(Instant due)
Sets the time when the work on this Task should be finished.- Parameters:
due- as exact Instant
-
setName
void setName(String name)
Sets the name of the current Task.- Parameters:
name- the name of the Task
-
setDescription
void setDescription(String description)
Sets the description of the Task.- Parameters:
description- the description of the Task
-
setClassificationKey
void setClassificationKey(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.- 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
Map<String,String> getCustomAttributeMap()
Returns a Map of customAttributes.- Returns:
- customAttributes as Map
-
setCustomAttributeMap
void setCustomAttributeMap(Map<String,String> customAttributes)
Sets a Map of custom attributes.- Parameters:
customAttributes- a Map that contains the custom attributes
-
getCallbackInfo
Map<String,String> getCallbackInfo()
Returns the callbackInfo.- Returns:
- callbackInfo as Map
-
setCallbackInfo
void setCallbackInfo(Map<String,String> callbackInfo)
Sets the callbackInfo.- Parameters:
callbackInfo- a Map that contains the callback information
-
setCustomAttribute
@Deprecated void setCustomAttribute(TaskCustomField customField, String value)
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
void setCustomField(TaskCustomField customField, String value)
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
void setCustomIntField(TaskCustomIntField customIntField, Integer value)
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
void addAttachment(Attachment attachment)
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
void setBusinessProcessId(String businessProcessId)
Sets the associated businessProcessId.- Parameters:
businessProcessId- Sets the businessProcessId the Task belongs to.
-
setParentBusinessProcessId
void setParentBusinessProcessId(String parentBusinessProcessId)
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
void setOwner(String taskOwnerId)
Sets the id of the owner of the Task.- Parameters:
taskOwnerId- the id of the owner of the Task
-
setPrimaryObjRef
void setPrimaryObjRef(ObjectReference primaryObjRef)
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
void setNote(String note)
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
Attachment 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).- 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
-
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
-
-