Interface TicketBusinessService
-
- All Known Implementing Classes:
DefaultTicketBusinessService
public interface TicketBusinessServiceService to support the business processes used for creating and managing tickets.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description CsCustomerEventModeladdCustomerEmailToTicket(CsTicketModel ticket, CsEventReason reason, java.lang.String subject, java.lang.String emailBody, java.util.Collection<MediaModel> attachments)Add a customer email to the specified ticket.CsCustomerEventModeladdNoteToTicket(CsTicketModel ticket, CsInterventionType intervention, CsEventReason reason, java.lang.String note, java.util.Collection<MediaModel> attachments)Add a note to the specified ticket.CsTicketModelassignTicketToAgent(CsTicketModel ticket, EmployeeModel agent)Sets the assignedAgent of the Ticket, i.e.CsTicketModelassignTicketToGroup(CsTicketModel ticket, CsAgentGroupModel group)Sets the assignedGroup of the Ticket, i.e.CsTicketModelcreateTicket(CsTicketModel ticket, CsCustomerEventModel creationEvent)Deprecated, for removal: This API element is subject to removal in a future version.since 6.0 usecreateTicket(CsTicketParameter)insteadCsTicketModelcreateTicket(CsTicketParameter ticketParameter)Create a new ticket with the parameters defined inCsTicketParameterCsTicketEventModelgetLastEvent(CsTicketModel ticket)Returns the last event on the ticket.java.util.List<CsTicketState>getTicketNextStates(CsTicketState state)Get the list of states which can come after the passed onjava.util.List<CsTicketState>getTicketNextStates(CsTicketModel ticket)Returns a list of states that the passed ticket can move to according to configured rules.booleanisTicketClosed(CsTicketModel ticket)Find out whether a ticket is closed.booleanisTicketResolvable(CsTicketModel ticket)Find out whether a ticket is resolvable.java.lang.StringrenderTicketEventText(CsTicketEventModel ticket)Get a description of a ticket for rendering on front endsCsTicketResolutionEventModelresolveTicket(CsTicketModel ticket, CsInterventionType intervention, CsResolutionType resolutionType, java.lang.String note)Resolve a ticket and add the associated resolution event.CsTicketResolutionEventModelresolveTicket(CsTicketModel ticket, CsInterventionType intervention, CsResolutionType resolutionType, java.lang.String note, java.util.Collection<MediaModel> attachments)Resolve a ticket and add the associated resolution event.CsTicketModelsetTicketState(CsTicketModel ticket, CsTicketState newState)Set the state of a ticket.CsTicketModelsetTicketState(CsTicketModel ticket, CsTicketState newState, java.lang.String note)Set the state of a ticket.CsCustomerEventModelunResolveTicket(CsTicketModel ticket, CsInterventionType intervention, CsEventReason reason, java.lang.String note)Reverse the resolution of a ticket and add a note to it.CsCustomerEventModelunResolveTicket(CsTicketModel ticket, CsInterventionType intervention, CsEventReason reason, java.lang.String note, java.util.Collection<MediaModel> attachments)Reverse the resolution of a ticket and add a note to it.CsTicketModelupdateTicket(CsTicketModel ticket)Update the details of a ticket.CsTicketModelupdateTicket(CsTicketModel ticket, java.lang.String note)Update the details of a ticket.
-
-
-
Method Detail
-
createTicket
CsTicketModel createTicket(CsTicketParameter ticketParameter)
Create a new ticket with the parameters defined inCsTicketParameter- 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 usecreateTicket(CsTicketParameter)insteadCreate 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 ticketcreationEvent- 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, java.lang.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 ofnote- 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 ofnewState- 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, java.lang.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 ofnewState- The new state of the ticketnote- 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 assignagent- 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 assigngroup- 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, java.lang.String note, java.util.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 tointervention- The interventionType of the notereason- The reason for the interventionnote- The note to addattachments- The attachments to add to the note- Returns:
- The note created and attached to the ticket.
-
addCustomerEmailToTicket
CsCustomerEventModel addCustomerEmailToTicket(CsTicketModel ticket, CsEventReason reason, java.lang.String subject, java.lang.String emailBody, java.util.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 toreason- The reason for the emailsubject- The subject of the emailemailBody- The body of the emailattachments- 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, java.lang.String note, java.util.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 resolvedintervention- Intervention TyperesolutionType- The resolution reason for the ticketnote- messageattachments- 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, java.lang.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 resolvedintervention- Intervention TyperesolutionType- The resolution reason for the ticketnote- 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, java.lang.String note, java.util.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 eventreason- The reason for the eventnote- The content of the note to add to the ticketattachments- 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, java.lang.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 eventreason- The reason for the eventnote- 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
java.util.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
java.util.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
java.lang.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
-
-