Interface Task

  • All Superinterfaces:
    TaskSummary
    All Known Implementing Classes:
    TaskImpl

    public interface Task
    extends TaskSummary
    task-Interface to specify attribute interactions.
    • 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 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 Classification key that - together with the Domain from this task's work basket - selects the appropriate Classification for 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 - a Map that 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 - a Map that 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 - the attachment to 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 list of attachments for 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
      • 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 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 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 referenced Attachments are copied as well.
        Specified by:
        copy in interface TaskSummary
        Returns:
        a copy of this Task