Class ToDoTask

    • Field Detail

      • TYPE_SIMPLE

        public static final int TYPE_SIMPLE
        This is a "normal" task (value=0).
        See Also:
        Constant Field Values
      • TYPE_POLL

        public static final int TYPE_POLL
        This is a poll (message) (value=1).
        See Also:
        Constant Field Values
      • STATE_OPEN

        public static final int STATE_OPEN
        The state if a task is created (value=0). In this state it is offered to all addressees.
        See Also:
        Constant Field Values
      • STATE_LOCKED

        public static final int STATE_LOCKED
        The state if the task is accepted by one addressee (value=1). From now on it can only be seen by the owner and the agent.
        See Also:
        Constant Field Values
      • STATE_REJECTED

        public static final int STATE_REJECTED
        The state if the task is rejected the agent, e.g. due to wrong addressing (value=2). The owner can reopen it.
        See Also:
        Constant Field Values
      • STATE_CLOSED

        public static final int STATE_CLOSED
        The state if the task was successfully processed by the agent (value=3).
        See Also:
        Constant Field Values
      • PRIO_LOW

        public static final int PRIO_LOW
        Low priority (one star, value=0).
        See Also:
        Constant Field Values
      • PRIO_MEDIUM

        public static final int PRIO_MEDIUM
        Medium priority (two stars, value=1).
        See Also:
        Constant Field Values
      • PRIO_HIGH

        public static final int PRIO_HIGH
        High priority (three stars, value=2).
        See Also:
        Constant Field Values
      • PRIO_VERY_HIGH

        public static final int PRIO_VERY_HIGH
        Even higher priority (four stars, value=3).
        See Also:
        Constant Field Values
      • PRIO_ULTRA

        public static final int PRIO_ULTRA
        Highest priority (five stars, value=4).
        See Also:
        Constant Field Values
      • PROPERTY_EMAILSUBJECT

        public static final java.lang.String PROPERTY_EMAILSUBJECT
        Property key used to store the subject string of incoming emails
        See Also:
        Constant Field Values
      • PROPERTY_EMAILREPLYTO

        public static final java.lang.String PROPERTY_EMAILREPLYTO
        Property key used to store the reply to address of incoming emails
        See Also:
        Constant Field Values
      • TODO_REPLY_MAILBOX_ID

        public static final java.lang.String TODO_REPLY_MAILBOX_ID
        See Also:
        Constant Field Values
    • Constructor Detail

      • ToDoTask

        public ToDoTask()
        Default constructor that creates a new task with state STATE_OPEN (0) and prio PRIO_LOW (0) and creation date now.
      • ToDoTask

        public ToDoTask​(java.lang.String description,
                        java.lang.String title,
                        java.lang.String email,
                        java.lang.String phone,
                        ToDoUser owner,
                        ToDoUser user)
        Create a new task with state STATE_OPEN (0) and prio PRIO_LOW (0) and creation date now.
        Parameters:
        description - the description of the task.
        title - the title of the task (max length 128!)
        email - the email of the task (max length 128!)
        phone - the phone of the task (max length 32!)
        owner - the owner of the task
        user - the addressee of the task
      • ToDoTask

        public ToDoTask​(ToDoTask task)
        The copy constructor of the task.
        Parameters:
        task - the task to be copied
    • Method Detail

      • startWorking

        public void startWorking()
                          throws ToDoBomException
        Set the task to state com.proxemo.todo.bom.ToDoTask#STATE_LOCKED and the startDate to current timestamp.
        Throws:
        ToDoBomException - if invoked on an archived task
      • isOpen

        public boolean isOpen()
        Is the task in state STATE_OPEN ?
        Returns:
        whether the task is open
      • isLocked

        public boolean isLocked()
        Is the task in state STATE_LOCKED ?
        Returns:
        whether the task is locked
      • isDone

        public boolean isDone()
        Is the task in state STATE_REJECTED or STATE_CLOSED?
        Returns:
        whether the task is closed or rejected
      • isRejected

        public boolean isRejected()
        Is the task in state STATE_REJECTED?
        Returns:
        whether the task is rejected
      • isClosed

        public boolean isClosed()
        Is the task in state STATE_CLOSED?
        Returns:
        whether the task is closed
      • getKind

        public int getKind()
        Returns the kind of task.
        Returns:
        either TYPE_SIMPLE or TYPE_POLL?
      • setUltraPrio

        public void setUltraPrio()
        Sets the task to prio PRIO_ULTRA
      • setVeryHighPrio

        public void setVeryHighPrio()
        Sets the task to prio PRIO_VERY_HIGH
      • setHighPrio

        public void setHighPrio()
        Sets the task to prio PRIO_HIGH
      • setMediumPrio

        public void setMediumPrio()
        Sets the task to prio PRIO_MEDIUM
      • setLowPrio

        public void setLowPrio()
        Sets the task to prio PRIO_LOW
      • getCreationDate

        public java.util.Date getCreationDate()
        Returns:
        the date the task was created
      • setCreationDate

        public void setCreationDate​(java.util.Date creationDate)
        Parameters:
        creationDate - the creationDate to set
      • getDescription

        public java.lang.String getDescription()
        Returns:
        Returns the description.
      • setDescription

        public void setDescription​(java.lang.String description)
        Parameters:
        description - the description to set.
      • getEmail

        public java.lang.String getEmail()
        Returns:
        If this task was created from a received email this method returns the sender's address, else null.
      • setEmail

        public void setEmail​(java.lang.String email)
        Parameters:
        email - The email to set.
      • getEndDate

        public java.util.Date getEndDate()
        Returns:
        Returns the endDate.
      • setEndDate

        public void setEndDate​(java.util.Date endDate)
        Parameters:
        endDate - The endDate to set.
      • getPhone

        public java.lang.String getPhone()
        Returns:
        Returns the phone.
      • setPhone

        public void setPhone​(java.lang.String phone)
        Parameters:
        phone - The phone to set.
      • getScheduledEndDate

        public java.util.Date getScheduledEndDate()
        Returns:
        Returns the scheduledEndDate.
      • setScheduledEndDate

        public void setScheduledEndDate​(java.util.Date scheduledEndDate)
        Parameters:
        scheduledEndDate - The scheduledEndDate to set.
      • getStartDate

        public java.util.Date getStartDate()
        Returns:
        Returns the startDate.
      • setStartDate

        public void setStartDate​(java.util.Date startDate)
        Parameters:
        startDate - The startDate to set.
      • getState

        public int getState()
        Returns:
        Returns the state.
      • setState

        public void setState​(int state)
        Parameters:
        state - The state to set.
      • getTitle

        public java.lang.String getTitle()
        Returns:
        Returns the title.
      • setTitle

        public void setTitle​(java.lang.String title)
        Parameters:
        title - The title to set.
      • getAssignedUser

        public ToDoUser getAssignedUser()
        Returns:
        Returns the assignedUser.
      • setAssignedUser

        public void setAssignedUser​(ToDoUser assignedUser)
        Parameters:
        assignedUser - the assignedUser to set.
      • getOwner

        public ToDoUser getOwner()
        Returns:
        Returns the owner.
      • setOwner

        public void setOwner​(ToDoUser owner)
        Parameters:
        owner - The owner to set.
      • getSource

        public ToDoTaskSource getSource()
        Source of this task, i.e. what instance created this task (an agent, incoming sms or email)
        Returns:
        Returns the source.
      • getPrio

        public int getPrio()
        The priority of this task. It can be low medium or high.
        Returns:
        Returns the priority.
      • setSource

        public void setSource​(ToDoTaskSource source)
        Parameters:
        source - The source to set.
      • setAdressee

        public void setAdressee​(java.lang.Object o)
      • setAddressee

        public void setAddressee​(ToDoAddressee adressee)
      • isArchived

        public boolean isArchived()
        The activation of this task. It corresponds to a non physical delete.
        Returns:
        Returns the priority.
      • setArchived

        public void setArchived​(boolean archived)
      • setPrio

        public void setPrio​(int prio)
        This method set the prio of the task.
        Parameters:
        prio - the priority from PRIO_LOW to PRIO_ULTRA
      • getAttachments

        public java.util.Set<ToDoAttachmentProxy> getAttachments()
        This method returns the attachments of the task
        Returns:
        a set of com.proxemo.todo.bom.ToDoAttachmentProxy
      • setAttachments

        public void setAttachments​(java.util.Set<ToDoAttachmentProxy> attachments)
        This method set the attachments of the task.
        Parameters:
        attachments - a set of com.proxemo.todo.bom.ToDoAttachmentProxy
      • addAttachmentProxy

        public void addAttachmentProxy​(ToDoAttachmentProxy ap)
        This method adds an attachment to the task.
        Parameters:
        ap - com.proxemo.todo.bom.ToDoAttachmentProxy
      • removeAttachmentProxy

        public void removeAttachmentProxy​(ToDoAttachmentProxy ap)
        This method removes an attachment from the task.
        Parameters:
        ap - com.proxemo.todo.bom.ToDoAttachmentProxy
      • getDoneComment

        public java.lang.String getDoneComment()
        This method returns the done comment of the task.
        Returns:
        the done comment
      • setDoneComment

        public void setDoneComment​(java.lang.String doneComment)
        This method sets the done comment of the task.
        Parameters:
        doneComment - the done comment
      • lockClientTransaction

        public void lockClientTransaction()
        This method locks the task for a client transaction.
      • unlockClientTransaction

        public void unlockClientTransaction()
        This method unlocks the task from a client transaction.
      • isClientTransactionLock

        public boolean isClientTransactionLock()
        This method returns whether a client transaction is in progress - or not.
        Returns:
        is client transaction active ?
      • setClientTransactionLock

        public void setClientTransactionLock​(boolean clientTransactionLock)
        This method activates the client transaction lock
        Parameters:
        clientTransactionLock - the boolean describing whether to lock or unlock the task in the client
      • isBillable

        public boolean isBillable()
        This method returns whether a task can be billed - or not.
        Returns:
        can the task be billed ?
      • setBillable

        public void setBillable​(boolean billable)
        This method marks the task as billable
        Parameters:
        billable - boolean setting a task billable or not
      • getFormerlyAssignedUser

        public java.lang.Long getFormerlyAssignedUser()
        This method returns the id of formerly assigned user, if the task was modified by the owner
        Returns:
        the id of the formerly assigned user
      • isMetadataInitialized

        public boolean isMetadataInitialized()
        The task is a proxy concerning the forms (metadata). This flag indicates on the client whether the metadata have to be fetched or not.
        Returns:
        boolean whether or not the matadata where already lazily initialized
      • setMetadataInitialized

        public void setMetadataInitialized​(boolean metadataInitialized)
        Marks the task as complete concerning the forms.
      • updateMetaContent

        public void updateMetaContent()
        Updates the internal XML-representation ("metaContent") from the collection of metaData.
      • updateMetaData

        public void updateMetaData()
        Updates the collection of metaData from the internal XML-representation ("metaContent")
      • getMetaDataAsText

        public java.lang.String getMetaDataAsText()
        Returns the XML-Representation of the collection of metaData.
      • getMetaContent

        public java.lang.String getMetaContent()
        Returns the metaContent.
        Returns:
        metaContent the XML-representation of the collection of metaData (forms) attached to this task
      • setMetaContent

        public void setMetaContent​(java.lang.String metaContent)
        Sets the metaContent. Be careful: metaData are not synchronized!
      • getMetaData

        public java.util.List<ToDoForm> getMetaData()
        Returns the metaData.
        Returns:
        metaData the List of metaData attached to this task
      • setMetaData

        public void setMetaData​(java.util.List<ToDoForm> metaData)
        Sets the metaData. Be careful: metaContent is not synchronized!
      • getOutgoingMails

        public java.util.Set<ToDoOutgoingMail> getOutgoingMails()
        Returns the outgoing mails attached to this task.
        Returns:
        the set of outgoing mails attached to this task
      • setOutgoingMails

        public void setOutgoingMails​(java.util.Set<ToDoOutgoingMail> outgoingMails)
        Sets outgoing mails attached to this task.
        Parameters:
        outgoingMails - the set of outgoing mails to be attached to this task
      • getMaster

        public ToDoTask getMaster()
        Returns the predecessor of the task
        Returns:
        the predecessor of the task. May be null if no predecessor exists.
      • setMaster

        public void setMaster​(ToDoTask master)
        Sets the predecessor of the task
        Parameters:
        master - the predecessor of the task
      • getCostcentre

        public java.lang.String getCostcentre()
        returns the cost center of the task
        Returns:
        the cost center of the task
      • setCostcentre

        public void setCostcentre​(java.lang.String costcentre)
        Sets the cost center of the task
        Parameters:
        costcentre - - the cost center
      • hasMaster

        public boolean hasMaster()
        Sets the predecessor of the task
        Returns:
        true or false if the task has a predecessor
      • setTransient

        public void setTransient()
        Marks the task as transient
      • copyAsNew

        public ToDoTask copyAsNew​(ToDoUser owner)
        Certain kind of copy constructor. The predecessor is set to this task. So we create a follow up task of this task.
        Returns:
        the new created task
      • getMetaDataByName

        public ToDoForm getMetaDataByName​(java.lang.String name)
        This method searches a form (metaData) attached to this task by its name
        Parameters:
        name - the name of the metaData searched
        Returns:
        the found metaData or null if nothing found
      • getMetaDataById

        public ToDoForm getMetaDataById​(java.lang.Long id)
        This method searches a form (metaData) attached to this task by its id
        Parameters:
        name - the name of the metaData searched
        Returns:
        the found metaData or null if nothing found
      • getMetaDatasByName

        public java.util.List<ToDoForm> getMetaDatasByName​(java.lang.String name)
        This method searches a form (metaData) attached to this task by its name
        Parameters:
        name - the name of the metaData searched
        Returns:
        the found metaData or null if nothing found
      • getMetaDatasById

        public java.util.List<ToDoForm> getMetaDatasById​(java.lang.Long id)
        This method searches a form (metaData) attached to this task by its id
        Parameters:
        name - the name of the metaData searched
        Returns:
        the found metaData or null if nothing found
      • getMetaAttributeByName

        public ToDoFormField getMetaAttributeByName​(java.lang.String formName,
                                                    java.lang.String name)
        This method searches a field in a form (metaData) attached to this task by its name and the name of the form
        Parameters:
        formName - the name of the metaData which contains the attribute
        name - the name of the field to be searched
        Returns:
        the field (attribute) or null if nothing found
      • getMetaAttributesByName

        public java.util.List<ToDoFormField> getMetaAttributesByName​(java.lang.Long formId,
                                                                     java.lang.String name)
        This method searches a field in all forms (metaData) attached to this task by its name and the id of the form
        Parameters:
        formId - the id of the metaDatas which contain the attribute
        name - the name of the field to be searched
        Returns:
        the list of fields (attribute) or list with length 0 if nothing found
      • getChainId

        public java.lang.Long getChainId()
      • addProperty

        public void addProperty​(java.lang.String key,
                                java.lang.String value)
        This method adds a custom property to the task.
        Parameters:
        key - key of the property
        value - of the property
        Throws:
        JsonProcessingException
        JsonMappingException
      • removeProperty

        public void removeProperty​(java.lang.String key)
        This method removes a custom property from the task.
        Parameters:
        key - key of the property
      • getProperty

        public java.lang.String getProperty​(java.lang.String key)
        This method returns the value of a property associated to key. If no property id found, null is returned.
        Parameters:
        key - key of the property
        value - of the property
        Returns:
        the value of the property or null if the property is not found.
      • getPropertiesMap

        public java.util.HashMap<java.lang.String,​java.lang.String> getPropertiesMap()
        This method returns the key value pairs of a task as a HashMap.
        Returns:
        a HashMap with all properties of the task. Possibly empty.
      • getProperties

        public java.lang.String getProperties()
      • setProperties

        public void setProperties​(java.lang.String properties)
      • setReplySource

        public void setReplySource​(ToDoTaskSource replySource)
      • setReplyMailboxId

        public void setReplyMailboxId​(java.lang.Long id)
                               throws JsonMappingException,
                                      JsonProcessingException
        Set the mailbox used to send a reply email from when the task is finished.
        Parameters:
        id - mailbox id
        Throws:
        JsonProcessingException
        JsonMappingException
      • setReplyMailbox

        public void setReplyMailbox​(ToDoMailbox box)
                             throws JsonMappingException,
                                    JsonProcessingException
        Set the mailbox used to send a reply email from when the task is finished.
        Parameters:
        box - the mailbox
        Throws:
        JsonProcessingException
        JsonMappingException
      • getId

        public java.lang.Long getId()
        Description copied from class: ToDoVersionedIdentifiable
        Method returning a canonical id of the object. Transient objects return -1;
        Specified by:
        getId in class ToDoVersionedIdentifiable
        Returns:
        id the id of the object. Id is canonical for all instances of a class.
      • setId

        public void setId​(java.lang.Long id)
        Description copied from class: ToDoVersionedIdentifiable
        Method setting the canonical id of the object. Should under normal circumstances not be manually invoked.
        Specified by:
        setId in class ToDoVersionedIdentifiable
        Parameters:
        id - id of the object
      • setVersion

        public void setVersion​(java.lang.Integer version)
        Description copied from class: ToDoVersionedIdentifiable
        Method setting the version of the instance, Should under normal circumstances not be manually invoked.
        Specified by:
        setVersion in class ToDoVersionedIdentifiable
        Parameters:
        version - of the object
      • isActive

        public java.lang.Boolean isActive()
        Description copied from class: ToDoVersionedIdentifiable
        Method that returns whether the instance is active or not (means: logically deleted)
        Specified by:
        isActive in class ToDoVersionedIdentifiable
        Returns:
        boolean whether the object is active
      • setActive

        public void setActive​(java.lang.Boolean active)
        Description copied from class: ToDoVersionedIdentifiable
        Method setting the active flag. Invoking this method with false logically deletes the instance in the database.
        Specified by:
        setActive in class ToDoVersionedIdentifiable
        Parameters:
        active - is the object active or not
      • getSourceuser

        public ToDoUser getSourceuser()
      • setSourceuser

        public void setSourceuser​(ToDoUser sourceuser)
      • getSourcemailbox

        public ToDoMailbox getSourcemailbox()
      • setSourcemailbox

        public void setSourcemailbox​(ToDoMailbox sourcemailbox)
      • setSmsfetcher

        public void setSmsfetcher​(ToDoSmsFetcher smsfetcher)
      • setRpcbackend

        public void setRpcbackend​(ToDoRPCBackend rpcbackend)
      • getAddressedUser

        public ToDoUser getAddressedUser()
      • setAddressedUser

        public void setAddressedUser​(ToDoUser addressedUser)
      • getAddressedWorkgroup

        public ToDoWorkGroup getAddressedWorkgroup()
      • setAddressedWorkgroup

        public void setAddressedWorkgroup​(ToDoWorkGroup addressedWorkgroup)
      • getInquiries

        public java.util.Set<ToDoInquiry> getInquiries()
      • setInquiries

        public void setInquiries​(java.util.Set<ToDoInquiry> inquiries)
      • rejectInquiry

        public void rejectInquiry​(ToDoInquiry iq)
        Rejects an inquiry.
        Parameters:
        iq - the inquiry to be rejected
      • getAddressedWorkgroupId

        public java.lang.Long getAddressedWorkgroupId()
      • setAddressedWorkgroupId

        public void setAddressedWorkgroupId​(long addressedWorkgroupId)
      • getOwnerId

        public java.lang.Long getOwnerId()
      • setOwnerId

        public void setOwnerId​(long ownerId)
      • getAssignedUserId

        public java.lang.Long getAssignedUserId()
      • setAssignedUserId

        public void setAssignedUserId​(long assignedUserId)
      • getSourceUserId

        public java.lang.Long getSourceUserId()
      • setSourceUserId

        public void setSourceUserId​(java.lang.Long sourceUserId)
      • getSourceMailboxId

        public java.lang.Long getSourceMailboxId()
      • setSourceMailboxId

        public void setSourceMailboxId​(java.lang.Long sourceMailboxId)
      • getSmsfetcherId

        public java.lang.Long getSmsfetcherId()
      • setSmsfetcherId

        public void setSmsfetcherId​(java.lang.Long smsfetcherId)
      • getRpcbackendId

        public java.lang.Long getRpcbackendId()
      • setRpcbackendId

        public void setRpcbackendId​(java.lang.Long rpcbackendId)
      • getAddressedUserId

        public java.lang.Long getAddressedUserId()
      • setAddressedUserId

        public void setAddressedUserId​(long addressedUserId)
      • getStateAsString

        public java.lang.String getStateAsString()
      • getPrioAsString

        public java.lang.String getPrioAsString()
      • initializeLazyCollections

        public void initializeLazyCollections()
      • getChildren

        public java.util.List<ToDoTask> getChildren()
      • getIndexState

        public java.lang.Integer getIndexState()
      • getRemainingTime

        public java.time.Duration getRemainingTime()
      • getSortState

        public java.lang.Integer getSortState()
      • hasForms

        public boolean hasForms()
      • getFormerlyAddressedToWorkGroupId

        public java.lang.Long getFormerlyAddressedToWorkGroupId()
      • setFormerlyAddressedToWorkGroupId

        public void setFormerlyAddressedToWorkGroupId​(java.lang.Long formerlyAddressedToWorkGroupId)
      • getFormerlyAddressedToUserId

        public java.lang.Long getFormerlyAddressedToUserId()
      • setFormerlyAddressedToUserId

        public void setFormerlyAddressedToUserId​(java.lang.Long formerlyAddressedToUserId)
      • hasReplyMailbox

        public boolean hasReplyMailbox()
      • setIndexState

        public void setIndexState​(java.lang.Integer indexState)