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 attribute interactions.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCALLBACK_STATEThe key that is used to supply Callback_state within the CallbackInfo map.
-
Method Summary
All Methods Instance Methods Abstract 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()Return a summary of the current Task.Taskcopy()Duplicates this Task without the internal and external id.List<Attachment>getAttachments()Return the attachments for this task.Map<String,String>getCallbackInfo()Returns a Map of Callback info.StringgetClassificationCategory()Returns the category of the current classification.Map<String,String>getCustomAttributeMap()Returns a Map of custom Attributes.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 theTaskService.updateTask(Task).voidsetBusinessProcessId(String businessProcessId)Sets the external business process id.voidsetCallbackInfo(Map<String,String> callbackInfo)Sets a Map of callback info.voidsetClassificationKey(String classificationKey)Sets the Classification key that - together with the Domain from this task's work basket - selects the appropriateClassificationfor this task.voidsetCustomAttribute(TaskCustomField customField, String value)Sets the value for custom Attribute.voidsetCustomAttributeMap(Map<String,String> customAttributes)Sets a Map of custom Attributes.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.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 ownerId of this task.voidsetParentBusinessProcessId(String parentBusinessProcessId)Sets the parent business process id to group associated processes.voidsetPlanned(Instant planned)Sets the time when the work on this task should be started.voidsetPrimaryObjRef(ObjectReference primaryObjRef)Sets theprimaryObjectReferenceof the task.-
Methods inherited from interface pro.taskana.task.api.models.TaskSummary
getAttachmentSummaries, getBusinessProcessId, getClaimed, getClassificationSummary, getCompleted, getCreated, getCreator, getCustomAttribute, getDescription, getDomain, getDue, getExternalId, getId, getModified, getName, getNote, getOwner, getParentBusinessProcessId, getPlanned, getPrimaryObjRef, getPriority, getState, getWorkbasketSummary, isRead, isTransferred
-
-
-
-
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 external Id
-
setPlanned
void setPlanned(Instant planned)
Sets the time when the work on this task should be started.- Parameters:
planned- as exactInstant
-
setDue
void setDue(Instant due)
Sets the time when the work on this task should be finished.- Parameters:
due- as exactInstant
-
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 Classification key that - together with the Domain from this task's work basket - selects the appropriateClassificationfor this task.- Parameters:
classificationKey- the classification key for 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 custom Attributes.- Returns:
- customAttributes as
Map
-
setCustomAttributeMap
void setCustomAttributeMap(Map<String,String> customAttributes)
Sets a Map of custom Attributes.- Parameters:
customAttributes- aMapthat contains the custom attributes
-
getCallbackInfo
Map<String,String> getCallbackInfo()
Returns a Map of Callback info.- Returns:
- callbackInfo as
Map
-
setCallbackInfo
void setCallbackInfo(Map<String,String> callbackInfo)
Sets a Map of callback info.- Parameters:
callbackInfo- aMapthat contains the callback info
-
setCustomAttribute
void setCustomAttribute(TaskCustomField customField, String value)
Sets the value for custom Attribute.- Parameters:
customField- identifies which custom attribute is to be set.value- the value of the custom attribute 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- theattachmentto be added to the task
-
getAttachments
List<Attachment> getAttachments()
Return the attachments for this 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
listofattachmentsfor this task
-
setBusinessProcessId
void setBusinessProcessId(String businessProcessId)
Sets the external business process id.- Parameters:
businessProcessId- Sets the business process id the task belongs to.
-
setParentBusinessProcessId
void setParentBusinessProcessId(String parentBusinessProcessId)
Sets the parent business process id to group associated processes.- Parameters:
parentBusinessProcessId- Sets the parent business process id the task belongs to
-
setOwner
void setOwner(String taskOwnerId)
Sets the ownerId of this task.- Parameters:
taskOwnerId- the user id of the task's owner
-
setPrimaryObjRef
void setPrimaryObjRef(ObjectReference primaryObjRef)
Sets theprimaryObjectReferenceof the task.- Parameters:
primaryObjRef- to task main-subject
-
setNote
void setNote(String note)
Sets/Changing the custom note for this Task.- Parameters:
note- the custom note for this Task.
-
asSummary
TaskSummary asSummary()
Return 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 theTaskService.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 matching attachment
-
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 referencedAttachments are copied as well.- Specified by:
copyin interfaceTaskSummary- Returns:
- a copy of this Task
-
-