Class DefaultTicketBusinessService

    • Constructor Detail

      • DefaultTicketBusinessService

        public DefaultTicketBusinessService()
    • Method Detail

      • createTicket

        @Deprecated(since="6.0",
                    forRemoval=true)
        public CsTicketModel createTicket​(CsTicketModel ticket,
                                          CsCustomerEventModel creationEvent)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 6.0 use createTicket(CsTicketParameter) instead
        Create a new ticket with the given ticket model and creation event. The ticket will get validated and assigned a ticket id and stored in the DB. The creation event will get associated with the ticket.
        Specified by:
        createTicket in interface TicketBusinessService
        Parameters:
        ticket - The new ticket
        creationEvent - The creation event to associate with the new ticket
        Returns:
        The newly created ticket
      • updateTicket

        public CsTicketModel updateTicket​(CsTicketModel ticket)
                                   throws TicketException
        Description copied from interface: TicketBusinessService
        Update the details of a ticket. This will generate an event to capture all changed fields on the ticket and attach it to the ticket. Business rules for changes to specific fields (state, assignment etc.) must also be run by the implementation of this method.
        Specified by:
        updateTicket in interface TicketBusinessService
        Parameters:
        ticket - The ticket to update the details of
        Returns:
        The updated ticket
        Throws:
        TicketException - If the ticket is null or the update is not permitted
      • updateTicket

        public CsTicketModel updateTicket​(CsTicketModel ticket,
                                          java.lang.String note)
                                   throws TicketException
        Description copied from interface: TicketBusinessService
        Update the details of a ticket. This will generate an event to capture all changed fields on the ticket and attached to the ticket. A note can also be passed which will be added as a separate event to the ticket. Business rules for changes to specific fields (state, assignment etc.) must also be run by the implementation of this method.
        Specified by:
        updateTicket in interface TicketBusinessService
        Parameters:
        ticket - The ticket to update the details of
        note - The note to associate with the update
        Returns:
        The updated ticket
        Throws:
        TicketException - TicketException In case if: 1)the ticket is null 2)the note is null or empty 3)the update is not permitted
      • setTicketState

        public CsTicketModel setTicketState​(CsTicketModel ticket,
                                            CsTicketState newState,
                                            java.lang.String note)
                                     throws TicketException
        Description copied from interface: TicketBusinessService
        Set the state of a ticket. Note that this is a separate method to updateTicket and will throw an exception if the ticket is in any other way changed.
        Specified by:
        setTicketState in interface TicketBusinessService
        Parameters:
        ticket - The ticket to change the state of
        newState - The new state of the ticket
        note - The note to associate with the state change
        Returns:
        The updated ticket
        Throws:
        TicketException - If the ticket has been modified
      • getTicketNextStates

        public java.util.List<CsTicketState> getTicketNextStates​(CsTicketModel ticket)
        Description copied from interface: TicketBusinessService
        Returns a list of states that the passed ticket can move to according to configured rules.
        Specified by:
        getTicketNextStates in interface TicketBusinessService
        Parameters:
        ticket - The current state of the ticket
        Returns:
        The list of available states that the ticket can move to
      • addNoteToTicket

        public CsCustomerEventModel addNoteToTicket​(CsTicketModel ticket,
                                                    CsInterventionType intervention,
                                                    CsEventReason reason,
                                                    java.lang.String note,
                                                    java.util.Collection<MediaModel> attachments)
        Description copied from interface: TicketBusinessService
        Add a note to the specified ticket. This will initiate all business rules around adding a note to a ticket. Note that any changes to the ticket itself will be ignored and should be saved using updateTicket.
        Specified by:
        addNoteToTicket in interface TicketBusinessService
        Parameters:
        ticket - The ticket to add the note to
        intervention - The interventionType of the note
        reason - The reason for the intervention
        note - The note to add
        attachments - The attachments to add to the note
        Returns:
        The note created and attached to the ticket.
      • addCustomerEmailToTicket

        public CsCustomerEventModel addCustomerEmailToTicket​(CsTicketModel ticket,
                                                             CsEventReason reason,
                                                             java.lang.String subject,
                                                             java.lang.String emailBody,
                                                             java.util.Collection<MediaModel> attachments)
        Description copied from interface: TicketBusinessService
        Add a customer email to the specified ticket. This will add the email to the ticket and send it via email to the customer using the business rules specified. Note that this is for sending an email to a customer and not for adding an email received from the customer.
        Specified by:
        addCustomerEmailToTicket in interface TicketBusinessService
        Parameters:
        ticket - The ticket to add the email to
        reason - The reason for the email
        subject - The subject of the email
        emailBody - The body of the email
        attachments - The attachments to add to the email
        Returns:
        The note created and attached to the ticket.
      • resolveTicket

        public CsTicketResolutionEventModel resolveTicket​(CsTicketModel ticket,
                                                          CsInterventionType intervention,
                                                          CsResolutionType resolutionType,
                                                          java.lang.String note)
                                                   throws TicketException
        Description copied from interface: TicketBusinessService
        Resolve a ticket and add the associated resolution event. The ticket will be validated to check it is in an appropriate state for resolution and will then be resolved if the state check passes
        Specified by:
        resolveTicket in interface TicketBusinessService
        Parameters:
        ticket - The ticket to be resolved
        intervention - Intervention Type
        resolutionType - The resolution reason for the ticket
        note - message
        Returns:
        The resolution event created and attached to the ticket.
        Throws:
        TicketException - if the ticket is null or missing arguments required to resolve ticket
      • resolveTicket

        public CsTicketResolutionEventModel resolveTicket​(CsTicketModel ticket,
                                                          CsInterventionType intervention,
                                                          CsResolutionType resolutionType,
                                                          java.lang.String note,
                                                          java.util.Collection<MediaModel> attachments)
                                                   throws TicketException
        Description copied from interface: TicketBusinessService
        Resolve a ticket and add the associated resolution event. The ticket will be validated to check it is in an appropriate state for resolution and will then be resolved if the state check passes
        Specified by:
        resolveTicket in interface TicketBusinessService
        Parameters:
        ticket - The ticket to be resolved
        intervention - Intervention Type
        resolutionType - The resolution reason for the ticket
        note - message
        attachments - as attachments
        Returns:
        The resolution event created and attached to the ticket.
        Throws:
        TicketException - if the ticket is null or missing arguments required to resolve ticket
      • isTicketClosed

        public boolean isTicketClosed​(CsTicketModel ticket)
        Description copied from interface: TicketBusinessService
        Find out whether a ticket is closed. This is dependent on the business rules of when a ticket is open or closed.
        Specified by:
        isTicketClosed in interface TicketBusinessService
        Parameters:
        ticket - The ticket to check
        Returns:
        true if the ticket is closed, false otherwise
      • isTicketResolvable

        public boolean isTicketResolvable​(CsTicketModel ticket)
        Description copied from interface: TicketBusinessService
        Find out whether a ticket is resolvable. This is dependent on the business rules.
        Specified by:
        isTicketResolvable in interface TicketBusinessService
        Parameters:
        ticket - The ticket to check
        Returns:
        true if the ticket is resolvable, false otherwise
      • setTicketUpdateStrategy

        public void setTicketUpdateStrategy​(TicketUpdateStrategy ticketUpdateStrategy)
      • setTicketEventStrategy

        public void setTicketEventStrategy​(TicketEventStrategy ticketEventStrategy)
      • setTicketEventEmailStrategy

        public void setTicketEventEmailStrategy​(TicketEventEmailStrategy ticketEventEmailStrategy)
      • setTicketResolutionStrategy

        public void setTicketResolutionStrategy​(TicketResolutionStrategy ticketResolutionStrategy)
      • setTicketRenderStrategy

        public void setTicketRenderStrategy​(TicketRenderStrategy ticketRenderStrategy)
      • getBaseSiteService

        public BaseSiteService getBaseSiteService()
        Returns:
        the baseSiteService
      • setBaseSiteService

        public void setBaseSiteService​(BaseSiteService baseSiteService)
        Parameters:
        baseSiteService - the baseSiteService to set
      • getUserService

        protected UserService getUserService()
      • setUserService

        public void setUserService​(UserService userService)
      • setTicketAttachmentsService

        public void setTicketAttachmentsService​(TicketAttachmentsService ticketAttachmentsService)
      • getTimeService

        protected TimeService getTimeService()
      • setTimeService

        public void setTimeService​(TimeService timeService)
      • getModelService

        protected ModelService getModelService()
      • setModelService

        public void setModelService​(ModelService modelService)