Class BTUpdateStatusRemovalScheduling
java.lang.Object
overit.geocall.bl.BusinessTask<UpdateStatusRemovalSchedulingEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<UpdateStatusRemovalSchedulingEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<UpdateStatusRemovalSchedulingEvent>
overit.geocallapp.wfm.orchestrator.scheduling.bl.activityremoval.task.BTUpdateStatusRemovalScheduling
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(UpdateStatusRemovalSchedulingEvent.class)
public class BTUpdateStatusRemovalScheduling
extends ValidPermissionBusinessTask<UpdateStatusRemovalSchedulingEvent>
Business task that updates the status of a
This task performs the following actions: 1. Validates the input, loading the
Error Code:
BOAppointment, BOAgenda,
BOWorkOrderOperation and BOWorkOrderHeader
when the UpdateStatusRemovalSchedulingEvent is triggered. This task performs the following actions: 1. Validates the input, loading the
BOAppointment
2. Processes the update, which may involve closing the appointment, cancelling the agenda, or updating the status of the appointment and agenda.
3. Notifies the work order module of the updated work order operation status.
Error Code:
- Since:
- 18.0
- See Also:
- GCApi:
- task
-
Field Summary
Fields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcancelAgenda(BOAgenda agenda, PoolKit poolKit) Cancels the specified agenda by setting its status to CANCELLED, clearing the start and end dates, and removing any associated foreman, team resources, foreman scheduling, and team shift.protected voidexecute(UpdateStatusRemovalSchedulingEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected SchedulingIntegrationServicegetIntegrationService(PoolKit poolKit) booleanDetermines whether the current state is valid for execution.protected voidnotifyWorkOrderOperationRemoved(Long operationId, PoolKit poolKit) Notify the work order operation scheduled eventprotected voidupdateAppointmentStatus(PoolKit poolKit, Long status) Updates the status of the appointment to closed.protected voidupdateStatus(PoolKit poolKit) This method updates the status of the appointment and the related agendas.Methods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
checkValidExecution, getException, throwExceptionIfInvalidMethods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask
body, getEventMethods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTUpdateStatusRemovalScheduling
public BTUpdateStatusRemovalScheduling()
-
-
Method Details
-
execute
protected void execute(UpdateStatusRemovalSchedulingEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<UpdateStatusRemovalSchedulingEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
updateStatus
This method updates the status of the appointment and the related agendas. It first loads the agenda related to the appointment that are in the cancelled status. If it finds any and the status of the appointment is not closed it will close the appointment and cancel the agenda. If not, the appointment and the agenda will be updated with the new status(open)- Parameters:
poolKit- thePoolKit- Throws:
DAException- If there is a data access exception.DAValidateException- If there is a data validation exception.
-
updateAppointmentStatus
protected void updateAppointmentStatus(PoolKit poolKit, Long status) throws DAException, DAValidateException Updates the status of the appointment to closed.- Parameters:
poolKit- thePoolKit- Throws:
DAException- If there is a data access exception.DAValidateException- If there is a data validation exception.
-
cancelAgenda
protected void cancelAgenda(BOAgenda agenda, PoolKit poolKit) throws DAException, DAValidateException Cancels the specified agenda by setting its status to CANCELLED, clearing the start and end dates, and removing any associated foreman, team resources, foreman scheduling, and team shift.- Parameters:
agenda- the BOAgenda to cancelpoolKit- thePoolKit- Throws:
DAException- if a data access exception occursDAValidateException- if a data validation exception occurs
-
notifyWorkOrderOperationRemoved
protected void notifyWorkOrderOperationRemoved(Long operationId, PoolKit poolKit) throws DAValidateException, DAException Notify the work order operation scheduled event- Parameters:
operationId- operation idpoolKit- thePoolKit- Throws:
DAValidateException- if the input is not validDAException- if an error occurs
-
getIntegrationService
protected SchedulingIntegrationService getIntegrationService(PoolKit poolKit) throws DAValidateException - Throws:
DAValidateException
-
isValidExecution
public boolean isValidExecution()Description copied from interface:ValidExecutionDetermines whether the current state is valid for execution.- Returns:
- true if execution is valid, false otherwise
-