Interface InternalWorklist<T extends InternalWorklistItem>

  • Type Parameters:
    T - the InternalWorklist only holds InternalWorklistItems and subtypes thereof.
    All Superinterfaces:
    UserAttributeContainer, Worklist<T>

    public interface InternalWorklist<T extends InternalWorklistItem>
    extends Worklist<T>
    The internal, server-side representation of a worklist. For each pair of agent ID und orgPosition ID there's only one InternalWorklist, but there may be an indefinite number of associated client-side representations.

    It offers methods to manipulate the list (i.e. add, change and remove items) and manage references to client worklists that were registered for push updates. Changes to the items of this list are recorded and can be retrieved through getUpdates(long, Filter). The references to client worklists are only managed; none of their methods are called by the internal worklist.

    See Worklist for more information about the relationship between InternalWorklist and ClientWorklist.

    Author:
    Kevin Goeser, Ulrich Kreher
    • Method Detail

      • addWorklistItem

        boolean addWorklistItem​(T item)
        Adds a worklist item (subtype of InternalWorklistItem) to this worklist. The revision will be increased by 1 and the change will be recorded in order to make it available through getUpdates(long, Filter).

        Make sure to add grouping worklist items before items of the corresponding group.

        Note to implementors:
        If this worklist already contains the given item, the item should be updated instead and this incident be properly logged, so it doesn't go unnoticed.

        Parameters:
        item - The worklist item to add.
        Returns:
        Whether the worklist item has been really added to this worklist. It will not be added (again) if it is already on this worklist.
      • updateWorklistItem

        void updateWorklistItem​(T item)
        Updates a worklist item (subtype of InternalWorklistItem) already managed by this worklist. The revision will be increased by 1 and the change will be recorded in order to make it available through getUpdates(long, Filter).

        Note to implementors:
        If this worklist doesn't contain the given item, the item should be added instead and this incident be properly logged, so it doesn't go unnoticed.

        Parameters:
        item - The worklist item to update.
      • removeWorklistItem

        void removeWorklistItem​(T item)
        Removes a worklist item (subtype of InternalWorklistItem) that is no longer in this worklist. The revision will be increased by 1 and the change will be recorded in order to make it available through getUpdates(long, Filter).

        Make sure to remove grouping worklist items after items of the corresponding group.

        Note to implementors:
        If this worklist doesn't contain the given item, it should be ignored and this incident be properly logged, so it doesn't go unnoticed.

        Parameters:
        item - The worklist item to remove.
      • updateIndividualSettings

        void updateIndividualSettings​(ClientWorklistItem clientWorklistItem)
        Updates the individual item settings by taking them from the given client worklist item.
        Parameters:
        clientWorklistItem - the client worklist item to read the individual settings from
      • getNextClientWorklistId

        long getNextClientWorklistId()
        Gets the next ID for the client worklist of this internal worklist.
        Returns:
        The next ID for the client worklist of this internal worklist.
      • getNextClientWorklistId

        long getNextClientWorklistId​(boolean inc)
        Gets the next ID for the client worklist of this internal worklist only optionally increasing the internal count. Only use this for storing the internal worklist but not for creating new client worklists!
        Parameters:
        inc - Whether to increase the internal count for client worklist IDs.
        Returns:
        The next ID for the client worklist of this internal worklist.
      • addUpdateableClientWorklist

        void addUpdateableClientWorklist​(ClientWorklist clientWorklist)
        Adds the given client worklist as recipient for push updates.
        Parameters:
        clientWorklist - The client worklist as recipient for push updates.
      • removeUpdateableClientWorklist

        void removeUpdateableClientWorklist​(ClientWorklist clientWorklist)
        Removes the given client worklist as recipient for push updates
        Parameters:
        clientWorklist - The client worklist to be removed.
      • removeUpdateableClientWorklist

        void removeUpdateableClientWorklist​(long clientWorklistID)
        Removes the given client worklist as recipient for push updates
        Parameters:
        clientWorklistID - The client worklist to be removed.
      • getUpdateableClientWorklists

        Map<Long,​ClientWorklist> getUpdateableClientWorklists()
        Returns all client worklists that are registered as recipient for push updates.
        Returns:
        All client worklists that are registered as recipient for push updates.
      • getUpdates

        WorklistUpdate getUpdates​(long sinceRevision,
                                  Filter worklistFilter)
        Returns all updates since the given revision of this worklist.
        If no updates have been made (i.e. the given revision equals this worklist's current revision (update count)) an empty WorklistUpdate-instance is returned.
        If the "since" revision is no longer available, a WorklistUpdate with the source revision 0 is returned, containing all worklist items with the WorklistItemUpdateState WorklistConstants.WorklistItemUpdateType.ADDED.

        See WorklistUpdate.getAll() for more information on how to determine the contents of a worklist update.

        Whether the returned update also reflects changes while executing this method is determined by the implementation. In any case the update may never contain any inconsistent data, like incomplete revisions.

        Optionally a filter on the worklist items may be specified. If the revision is greater than 0, this filter must be the same that has been used to retrieve previous updates. Otherwise this might result in an inconsistent state of ClientWorklists.

        Parameters:
        sinceRevision - The revision from which all updates until the current revision are to be retrieved.
        worklistFilter - the filter used on the worklist items; may be {code null}; if the revision is greater than 0, this filter must be the same that has been used to retrieve previous updates; otherwise this might result in the inconsistent state of ClientWorklists
        Returns:
        A WorklistUpdate containing all update information since the designated revision or a full update with source revision 0 in case that information is no longer available.
        See Also:
        ClientWorklist.updateWorklist(WorklistUpdate)
      • getSubstitutionRule

        String getSubstitutionRule()
        If absence information is set for this worklist, this method will return either a valid substitution rule or null for an absence without substitution. The empty string will be returned if no absence is set. Do not use this property to determine whether the agent is currently present. Use isPresentNow() instead.
        Returns:
        A valid substitution rule if absence information is set, null if absence is set without substitution and an empty string otherwise if no absence is set.
        See Also:
        setAbsent(long, long, String)
      • setAbsent

        void setAbsent​(long from,
                       long to,
                       String substitutionRule)
        Sets the absence of the agent of this internal worklist for the designated time. If a worklist item is to be added to worklists which are all absent, the corresponding substitution rules apply and add the item accordingly. Use null for the rule indicates no substitutes. This is useful for longterm absence.
        Parameters:
        from - The absolute date from which on the agent is absent. 0 means from now on.
        to - The absolute date until the agent is absent. 0 means the end date is not known and it will last until setPresent().
        substitutionRule - The rule which qualifies the substituting agents. If this is null or the empty string, the agent will not have a substitute for this absence.
      • getAbsenceFromDate

        long getAbsenceFromDate()
        Gets the date (as long) from which on the agent of this internal worklist is absent. 0 means the agent is already / with immediate effect absent, a negative number indicates that the absence is not set, that is, the agent is present. To determine whether the agent is currently present call isPresentNow().
        Returns:
        The date as long from which the agent of this internal worklist is absent, 0 for "already absent", a negative number for a present agent.
      • getAbsenceToDate

        long getAbsenceToDate()
        Gets the date (as long) until the agent of this internal worklist is absent. 0 means the agent is absent indefinitely, a negative number indicates that the absence is not set, that is, the agent is present. To determine whether the agent is currently present call isPresentNow().
        Returns:
        The date as long until the agent of this internal worklist is absent, 0 for indefinitely, a negative number for a present agent.
      • setPresent

        void setPresent()
        Disables the absence of the agent of this internal worklist.
      • isPresentNow

        boolean isPresentNow()
        Returns whether the owning agent of this worklist is present at this moment, based on the current time and the provided absence information.
        Returns:
        whether the owning agent of this worklist is present at this moment