Class DefaultTicketUpdateStrategy
java.lang.Object
de.hybris.platform.ticket.strategies.impl.DefaultTicketUpdateStrategy
- All Implemented Interfaces:
TicketUpdateStrategy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassignTicketToAgent(CsTicketModel ticket, EmployeeModel agent) Assign the ticket to a new agent, or null to make the ticket unassigned.assignTicketToGroup(CsTicketModel ticket, CsAgentGroupModel group) Assign the ticket to a new group, or null to make the ticket unassigned.protected CsTicketEventModelcreateAssignTicketEvent(CsTicketModel ticket, Set<CsTicketChangeEventEntryModel> changedValues) protected CsTicketEventModelcreateChangeEvent(CsTicketModel ticket, Set<CsTicketChangeEventEntryModel> changedValues) protected CsTicketEventModelcreateChangeEvent(CsTicketModel ticket, Set<CsTicketChangeEventEntryModel> changedValues, String note) protected ItemModelContextImplgetContext(AbstractItemModel model) protected ModelServicegetTicketNextStates(CsTicketState currentState) Get a list of legal states that a ticket can move into.protected booleanisValidStateTransition(CsTicketState oldState, CsTicketState newState) protected voidpreChangeTicketAssignment(CsTicketModel ticket, EmployeeModel agent) protected voidpreChangeTicketGroup(CsTicketModel ticket, CsAgentGroupModel group) protected voidpreSetTicketState(CsTicketModel ticket, CsTicketState newState) voidsetAvailableNextStates(Map<CsTicketState, List<CsTicketState>> availableNextStates) voidsetModelService(ModelService modelService) voidsetTicketAssigndEventType(String ticketAssigndEventType) voidsetTicketAttributeChangeEventStrategy(TicketAttributeChangeEventStrategy ticketAttributeChangeEventStrategy) voidsetTicketChangeEventType(String ticketChangeEventType) voidsetTicketEventFactory(TicketEventFactory ticketEventFactory) voidsetTicketState(CsTicketModel ticket, CsTicketState newState) Set the state of the ticket.voidsetTicketState(CsTicketModel ticket, CsTicketState newState, String note) Set the state of the ticket.updateTicket(CsTicketModel ticket) Store all updated attributes on a ticket.updateTicket(CsTicketModel ticket, String note) Store all updated attributes on a ticket.
-
Constructor Details
-
DefaultTicketUpdateStrategy
public DefaultTicketUpdateStrategy()
-
-
Method Details
-
updateTicket
Description copied from interface:TicketUpdateStrategyStore all updated attributes on a ticket. This method should run business rules to confirm that the changes made are legal. If the update is not permitted an exception is thrown.- Specified by:
updateTicketin interfaceTicketUpdateStrategy- Parameters:
ticket- The ticket to be updated- Returns:
- The updated ticket
- Throws:
TicketException- If the update is not permitted
-
updateTicket
Description copied from interface:TicketUpdateStrategyStore all updated attributes on a ticket. This method also allows a note to be added to the ticket with the update. This method should run business rules to confirm that the changes made are legal. If the update is not permitted an exception is thrown.- Specified by:
updateTicketin interfaceTicketUpdateStrategy- Parameters:
ticket- The ticket to be updatednote- The text of the note to add along with the update- Returns:
- The updated ticket
- Throws:
TicketException- If the update is not permitted
-
setTicketState
Description copied from interface:TicketUpdateStrategySet the state of the ticket. This method should run any business rules associated with state change. This method should also guarantee that it won't have the side effect of storing any other changes to the ticket and should throw an exception if the ticket has been otherwise updated.- Specified by:
setTicketStatein interfaceTicketUpdateStrategy- Parameters:
ticket- The ticket to update the state ofnewState- The state to set the ticket to- Throws:
TicketException- If the ticket has been modified or the state transition is illegal- See Also:
-
setTicketState
public void setTicketState(CsTicketModel ticket, CsTicketState newState, String note) throws TicketException Description copied from interface:TicketUpdateStrategySet the state of the ticket. This method should run any business rules associated with state change. This method should also guarantee that it won't have the side effect of storing any other changes to the ticket and should throw an exception if the ticket has been otherwise updated.- Specified by:
setTicketStatein interfaceTicketUpdateStrategy- Parameters:
ticket- The ticket to update the state ofnewState- The state to set the ticket tonote- The text of the note to add along with the state change- Throws:
TicketException- If the ticket has been modified or the state transition is illegal- See Also:
-
getTicketNextStates
Description copied from interface:TicketUpdateStrategyGet a list of legal states that a ticket can move into.- Specified by:
getTicketNextStatesin interfaceTicketUpdateStrategy- Parameters:
currentState- The starting state- Returns:
- a list of states that the ticket can move to next.
-
isValidStateTransition
-
preSetTicketState
protected void preSetTicketState(CsTicketModel ticket, CsTicketState newState) throws TicketException - Throws:
TicketException
-
assignTicketToAgent
public CsTicketEventModel assignTicketToAgent(CsTicketModel ticket, EmployeeModel agent) throws TicketException Description copied from interface:TicketUpdateStrategyAssign the ticket to a new agent, or null to make the ticket unassigned. This method should run any business rules associated with the assignment change. This method should also guarantee that it won't have the side effect of storing any other changes to the ticket and should throw an exception if the ticket has been otherwise updated.- Specified by:
assignTicketToAgentin interfaceTicketUpdateStrategy- Parameters:
ticket- The ticket to update the state ofagent- The agent to assign the ticket to or null to mark the ticket as unassigned.- Returns:
- CsTicketEventModel
- Throws:
TicketException- If the ticket has been modified or the assignment is illegal
-
preChangeTicketAssignment
protected void preChangeTicketAssignment(CsTicketModel ticket, EmployeeModel agent) throws TicketException - Throws:
TicketException
-
assignTicketToGroup
public CsTicketEventModel assignTicketToGroup(CsTicketModel ticket, CsAgentGroupModel group) throws TicketException Description copied from interface:TicketUpdateStrategyAssign the ticket to a new group, or null to make the ticket unassigned. This method should run any business rules associated with the assignment change. This method should also guarantee that it won't have the side effect of storing any other changes to the ticket and should throw an exception if the ticket has been otherwise updated.- Specified by:
assignTicketToGroupin interfaceTicketUpdateStrategy- Parameters:
ticket- The ticket to update the state ofgroup- The agent group to assign the ticket to or null to mark the ticket as unassigned.- Returns:
- CsTicketEventModel
- Throws:
TicketException- If the ticket has been modified or the assignment is illegal
-
preChangeTicketGroup
protected void preChangeTicketGroup(CsTicketModel ticket, CsAgentGroupModel group) throws TicketException - Throws:
TicketException
-
createAssignTicketEvent
protected CsTicketEventModel createAssignTicketEvent(CsTicketModel ticket, Set<CsTicketChangeEventEntryModel> changedValues) -
createChangeEvent
protected CsTicketEventModel createChangeEvent(CsTicketModel ticket, Set<CsTicketChangeEventEntryModel> changedValues) -
createChangeEvent
protected CsTicketEventModel createChangeEvent(CsTicketModel ticket, Set<CsTicketChangeEventEntryModel> changedValues, String note) -
setTicketAttributeChangeEventStrategy
public void setTicketAttributeChangeEventStrategy(TicketAttributeChangeEventStrategy ticketAttributeChangeEventStrategy) -
setAvailableNextStates
-
setTicketEventFactory
-
setTicketChangeEventType
-
getContext
-
getTicketAssigndEventType
-
setTicketAssigndEventType
-
getModelService
-
setModelService
-