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 Details

    • 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:
  • Method Details

    • 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.

      due denotes the last point in the allowed work time has ended or in short it is inclusive.

      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)
      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
    • 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 set
      value - 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 set
      system - of the primaryObjectReference to be set
      systemInstance - of the primaryObjectReference to be set
      type - of the primaryObjectReference to be set
      value - 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
    • getNumberOfComments

      int getNumberOfComments()
      Returns the count of the comments of the current Task.
      Specified by:
      getNumberOfComments in interface TaskSummary
      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:
      copy in interface TaskSummary
      Returns:
      a copy of this Task