Interface TicketBusinessService

All Known Implementing Classes:
DefaultTicketBusinessService

public interface TicketBusinessService
Service to support the business processes used for creating and managing tickets.
  • Method Details

    • createTicket

      CsTicketModel createTicket(CsTicketParameter ticketParameter)
      Create a new ticket with the parameters defined in CsTicketParameter
      Parameters:
      ticketParameter - Ticker creation parameters
      Returns:
      The newly created ticket
    • createTicket

      @Deprecated(since="6.0", forRemoval=true) 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.
      Parameters:
      ticket - The new ticket
      creationEvent - The creation event to associate with the new ticket
      Returns:
      The newly created ticket
    • updateTicket

      CsTicketModel updateTicket(CsTicketModel ticket) throws TicketException
      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.
      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

      CsTicketModel updateTicket(CsTicketModel ticket, String note) throws TicketException
      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.
      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

      CsTicketModel setTicketState(CsTicketModel ticket, CsTicketState newState) throws TicketException
      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.
      Parameters:
      ticket - The ticket to change the state of
      newState - The new state of the ticket
      Returns:
      The updated ticket
      Throws:
      TicketException - If the ticket has been modified
    • setTicketState

      CsTicketModel setTicketState(CsTicketModel ticket, CsTicketState newState, String note) throws TicketException
      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.
      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
    • assignTicketToAgent

      CsTicketModel assignTicketToAgent(CsTicketModel ticket, EmployeeModel agent) throws TicketException
      Sets the assignedAgent of the Ticket, i.e. assigns the ticket to the specified agent. Note that this is a separate method to updateTicket and will throw an exception if the ticket is in any other way changed.
      Parameters:
      ticket - The Ticket to assign
      agent - The Agent to assign the ticket to
      Returns:
      The updated ticket
      Throws:
      TicketException - If the ticket has been modified
    • assignTicketToGroup

      CsTicketModel assignTicketToGroup(CsTicketModel ticket, CsAgentGroupModel group) throws TicketException
      Sets the assignedGroup of the Ticket, i.e. assigns the ticket to the specified group. Note that this is a separate method to updateTicket and will throw an exception if the ticket is in any other way changed.
      Parameters:
      ticket - The Ticket to assign
      group - The Group to assign the ticket to
      Returns:
      The updated ticket
      Throws:
      TicketException - If the ticket has been modified
    • addNoteToTicket

      CsCustomerEventModel addNoteToTicket(CsTicketModel ticket, CsInterventionType intervention, CsEventReason reason, String note, Collection<MediaModel> attachments)
      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.
      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

      CsCustomerEventModel addCustomerEmailToTicket(CsTicketModel ticket, CsEventReason reason, String subject, String emailBody, Collection<MediaModel> attachments)
      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.
      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

      CsTicketResolutionEventModel resolveTicket(CsTicketModel ticket, CsInterventionType intervention, CsResolutionType resolutionType, String note, Collection<MediaModel> attachments) throws TicketException
      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
      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
    • resolveTicket

      CsTicketResolutionEventModel resolveTicket(CsTicketModel ticket, CsInterventionType intervention, CsResolutionType resolutionType, String note) throws TicketException
      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
      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
    • unResolveTicket

      CsCustomerEventModel unResolveTicket(CsTicketModel ticket, CsInterventionType intervention, CsEventReason reason, String note, Collection<MediaModel> attachments) throws TicketException
      Reverse the resolution of a ticket and add a note to it.
      Parameters:
      ticket - The ticket to 'unresolve'
      intervention - The interventionType for the event
      reason - The reason for the event
      note - The content of the note to add to the ticket
      attachments - as ticket attachments
      Returns:
      The note created and attached to the ticket.
      Throws:
      TicketException - if the ticket is null or missing arguments required to resolve ticket
    • unResolveTicket

      CsCustomerEventModel unResolveTicket(CsTicketModel ticket, CsInterventionType intervention, CsEventReason reason, String note) throws TicketException
      Reverse the resolution of a ticket and add a note to it.
      Parameters:
      ticket - The ticket to 'unresolve'
      intervention - The interventionType for the event
      reason - The reason for the event
      note - The content of the note to add to the ticket
      Returns:
      The note created and attached to the ticket.
      Throws:
      TicketException - if the ticket is null or missing arguments required to unresolve ticket
    • isTicketClosed

      boolean isTicketClosed(CsTicketModel ticket)
      Find out whether a ticket is closed. This is dependent on the business rules of when a ticket is open or closed.
      Parameters:
      ticket - The ticket to check
      Returns:
      true if the ticket is closed, false otherwise
    • isTicketResolvable

      boolean isTicketResolvable(CsTicketModel ticket)
      Find out whether a ticket is resolvable. This is dependent on the business rules.
      Parameters:
      ticket - The ticket to check
      Returns:
      true if the ticket is resolvable, false otherwise
    • getTicketNextStates

      List<CsTicketState> getTicketNextStates(CsTicketModel ticket)
      Returns a list of states that the passed ticket can move to according to configured rules.
      Parameters:
      ticket - The current state of the ticket
      Returns:
      The list of available states that the ticket can move to
    • getTicketNextStates

      List<CsTicketState> getTicketNextStates(CsTicketState state)
      Get the list of states which can come after the passed on
      Parameters:
      state - The state to get the next states from
      Returns:
      A list of states that at ticket in the specified state can move into
    • getLastEvent

      CsTicketEventModel getLastEvent(CsTicketModel ticket)
      Returns the last event on the ticket.
      Parameters:
      ticket - The ticket to retrieve the last event for
      Returns:
      The last event on the ticket
    • renderTicketEventText

      String renderTicketEventText(CsTicketEventModel ticket)
      Get a description of a ticket for rendering on front ends
      Parameters:
      ticket - The ticket to get the description of
      Returns:
      A string description of the ticket