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 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
      • 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
      • 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
      • 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:
        copy in interface TaskSummary
        Returns:
        a copy of this Task