Class BTInterventionExecutionDelete
java.lang.Object
overit.geocall.bl.BusinessTask<InterventionExecutionDeleteEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<InterventionExecutionDeleteEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<InterventionExecutionDeleteEvent>
overit.geocallapp.wfm.orchestrator.workorders.bl.outcome.intervention.task.BTInterventionExecutionDelete
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(InterventionExecutionDeleteEvent.class)
public class BTInterventionExecutionDelete
extends ValidPermissionBusinessTask<InterventionExecutionDeleteEvent>
This class represents a business task for deleting interventions currently managed by a user who
is assigned to a new intervention. The status of the interventions that are
BOAgendaStatus.Values.IN_CHARGE
will be set to BOAgendaStatus.Values.SUBMITTED.- 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 voidexecute(InterventionExecutionDeleteEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected WorkOrdersIntegrationServicegetIntegrationService(PoolKit poolKit) booleanDetermines whether the current state is valid for execution.protected voidrecalculateWorkOrderOperationStatus(BOWorkOrderOperation workOrderOperation, PoolKit poolKit) Recalculates the work order operation status.protected voidrecalculateWorkOrderStatus(Long workOrderId, PoolKit poolKit) Recalculates the work order status by calling theWorkOrderHeaderStatusRecalculateEvent.protected voidresetInterventionOutcomeDates(BOIntervention intervention, PoolKit poolKit) Reset the intervention outcome dates for the given intervention.protected voidresetInterventionResource(List<BOIntervention> interventionsList, PoolKit poolKit) Resets the agenda resources for a list of interventions.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
-
BTInterventionExecutionDelete
public BTInterventionExecutionDelete()
-
-
Method Details
-
execute
protected void execute(InterventionExecutionDeleteEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<InterventionExecutionDeleteEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
resetInterventionOutcomeDates
protected void resetInterventionOutcomeDates(BOIntervention intervention, PoolKit poolKit) throws DAException, DAValidateException Reset the intervention outcome dates for the given intervention. This method sets the arrival date, take in charge date, and start date of the intervention outcome to null.- Parameters:
intervention- the intervention for which to reset the outcome datespoolKit- thePoolKit- Throws:
DAException- if an error occurs during the data accessDAValidateException- if there is a validation error
-
getIntegrationService
protected WorkOrdersIntegrationService getIntegrationService(PoolKit poolKit) throws DAValidateException - Throws:
DAValidateException
-
recalculateWorkOrderOperationStatus
protected void recalculateWorkOrderOperationStatus(BOWorkOrderOperation workOrderOperation, PoolKit poolKit) throws DAValidateException, DAException Recalculates the work order operation status.- Parameters:
poolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
recalculateWorkOrderStatus
protected void recalculateWorkOrderStatus(Long workOrderId, PoolKit poolKit) throws DAValidateException, DAException Recalculates the work order status by calling theWorkOrderHeaderStatusRecalculateEvent.- Parameters:
workOrderId- the id of the work order to recalculate the statuspoolKit- thePoolKitto use for the data access- Throws:
DAValidateException- if any validation error occurs during the processDAException- if any error occurs during the data access
-
resetInterventionResource
protected void resetInterventionResource(List<BOIntervention> interventionsList, PoolKit poolKit) throws DAException, DAValidateException Resets the agenda resources for a list of interventions. It will set takeInChargeDate, arrivalDate and OutcomeStartDate to null- Parameters:
interventionsList- the list of interventions to reset the agenda resourcespoolKit- thePoolKit- Throws:
DAException- if an error occurs during the data accessDAValidateException- if there is a validation error
-
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
-