Class BTInterventionResourceDelete
java.lang.Object
overit.geocall.bl.BusinessTask<InterventionResourceDeleteEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<InterventionResourceDeleteEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<InterventionResourceDeleteEvent>
overit.geocallapp.wfm.orchestrator.workorders.bl.intervention.resource.task.BTInterventionResourceDelete
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(InterventionResourceDeleteEvent.class)
public class BTInterventionResourceDelete
extends ValidPermissionBusinessTask<InterventionResourceDeleteEvent>
Business task to remove a intervention resource.
Permission:
Error Code:
- Since:
- 18.0
- See Also:
- GCApi:
- task
-
Field Summary
FieldsFields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckWorkOrderStatus(BOInterventionResource interventionResource, PoolKit poolKit) Checks the status of the work order associated with the providedBOInterventionResource.protected voiddeleteInterventionResource(BOInterventionResource interventionResource, PoolKit poolKit) Deletes anBOInterventionResource.protected voidexecute(InterventionResourceDeleteEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected WorkOrdersIntegrationServicegetIntegrationService(PoolKit poolKit) Retrieves the WorkOrdersIntegrationService instance.protected BOInterventionResourcegetInterventionResource(InterventionResourceDeleteInput interventionResourceDeleteInput, PoolKit poolKit) Retrieves a list ofBOInterventionResourceobjects based on the providedBOInterventionResource.protected BOWorkOrderOperationgetWorkOrderOperation(BOInterventionResource interventionResource, PoolKit poolKit) Retrieves theBOWorkOrderOperationassociated with the providedBOInterventionResource.booleanDetermines whether the current state is valid for execution.protected voidmanageWorkOrderOperationResource(BOInterventionResource interventionResource, PoolKit poolKit) Manages the work order operation resource associated with the providedBOInterventionResource.protected voidnotifyInterventionResource(BOInterventionResource interventionResource, PoolKit poolKit) Sends an intervention resource notification.protected voidnotifyWorkOrderOperationResource(BOWorkOrderOperationResource workOrderOperationResource, PoolKit poolKit) Sends a work order operation resource notification.protected voidremoveWorkOrderOperationResource(BOWorkOrderOperationResource workOrderOperationResource, PoolKit poolKit) Remove an existingBOWorkOrderOperationResource.protected List<BOWorkOrderOperationResource> searchWorkOrderOperationResources(BOInterventionResource interventionResource, PoolKit poolKit) Searches forBOWorkOrderOperationResourceentities based on the providedBOInterventionResource.protected voidupdateValidationStatus(PoolKit poolKit) Updates the validation status by calling theInterventionOutcomeValidationStatusUpdateEventprotected voidupdateWorkOrder(PoolKit poolKit) Updates the work order header after an intervention resource has been inserted.protected voidupdateWorkOrderOperationResource(BOWorkOrderOperationResource workOrderOperationResource, PoolKit poolKit) Updates an existingBOWorkOrderOperationResource.protected voidvalidate(BOInterventionResource interventionResource, PoolKit poolKit) Check on mandatory fields and visibility of properties.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
-
Field Details
-
intervention
-
workOrderOperation
-
-
Constructor Details
-
BTInterventionResourceDelete
public BTInterventionResourceDelete()
-
-
Method Details
-
execute
protected void execute(InterventionResourceDeleteEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<InterventionResourceDeleteEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
getInterventionResource
protected BOInterventionResource getInterventionResource(InterventionResourceDeleteInput interventionResourceDeleteInput, PoolKit poolKit) throws DAValidateException, DAException Retrieves a list ofBOInterventionResourceobjects based on the providedBOInterventionResource.- Parameters:
interventionResourceDeleteInput- theInterventionResourceDeleteInputto use as a filterpoolKit- thePoolKitto use for the search- Returns:
- a
BOInterventionResourcethat must be removed - Throws:
DAValidateException- if any required properties are missing in theBOInterventionResourceDAException- if an error occurs during the search
-
validate
protected void validate(BOInterventionResource interventionResource, PoolKit poolKit) throws DAValidateException, DAException Check on mandatory fields and visibility of properties.- Parameters:
interventionResource- theBOInterventionResourcepoolKit- thePoolKit- Throws:
DAValidateException- If there is a validation error.DAException- If an error occurs during the data access.
-
manageWorkOrderOperationResource
protected void manageWorkOrderOperationResource(BOInterventionResource interventionResource, PoolKit poolKit) throws DAException, DAValidateException Manages the work order operation resource associated with the providedBOInterventionResource.- Parameters:
interventionResource- theBOInterventionResourceto use for managing the work order operation resourcepoolKit- thePoolKitto use for the operation- Throws:
DAValidateException- If there is a validation error.DAException- If an error occurs during the data access.
-
searchWorkOrderOperationResources
protected List<BOWorkOrderOperationResource> searchWorkOrderOperationResources(BOInterventionResource interventionResource, PoolKit poolKit) throws DAValidateException, DAException Searches forBOWorkOrderOperationResourceentities based on the providedBOInterventionResource.- Parameters:
interventionResource- theBOInterventionResourceto use for the searchpoolKit- thePoolKitto use for the search- Returns:
- a list of
BOWorkOrderOperationResourceentities matching the search criteria - Throws:
DAValidateException- If there is a validation error.DAException- If an error occurs during the data access.
-
updateWorkOrderOperationResource
protected void updateWorkOrderOperationResource(BOWorkOrderOperationResource workOrderOperationResource, PoolKit poolKit) throws DAValidateException, DAException Updates an existingBOWorkOrderOperationResource.- Parameters:
workOrderOperationResource- theBOWorkOrderOperationResourcepoolKit- thePoolKit- Throws:
DAValidateException- If there is a validation error.DAException- If an error occurs during the data access.
-
removeWorkOrderOperationResource
protected void removeWorkOrderOperationResource(BOWorkOrderOperationResource workOrderOperationResource, PoolKit poolKit) throws DAValidateException, DAException Remove an existingBOWorkOrderOperationResource.- Parameters:
workOrderOperationResource- theBOWorkOrderOperationResourcepoolKit- thePoolKit- Throws:
DAValidateException- If there is a validation error.DAException- If an error occurs during the data access.
-
deleteInterventionResource
protected void deleteInterventionResource(BOInterventionResource interventionResource, PoolKit poolKit) throws DAException, DAValidateException Deletes anBOInterventionResource.- Parameters:
interventionResource- theBOInterventionResourceto deletepoolKit- thePoolKit- Throws:
DAValidateException- If there is a validation error.DAException- If an error occurs during the data access.
-
getWorkOrderOperation
protected BOWorkOrderOperation getWorkOrderOperation(BOInterventionResource interventionResource, PoolKit poolKit) throws DAValidateException, DAException Retrieves theBOWorkOrderOperationassociated with the providedBOInterventionResource.- Parameters:
interventionResource- theBOInterventionResourceto use for retrieving theBOWorkOrderOperationpoolKit- thePoolKitto use for the retrieval- Returns:
- the
BOWorkOrderOperationassociated with the providedBOInterventionResource - Throws:
DAValidateException- If there is a validation error.DAException- If an error occurs during the data access.
-
notifyInterventionResource
protected void notifyInterventionResource(BOInterventionResource interventionResource, PoolKit poolKit) throws DAValidateException, DAException Sends an intervention resource notification.- Parameters:
interventionResource- TheBOInterventionResourceobject representing the agenda resource.poolKit- ThePoolKit- Throws:
DAValidateException- If there is a validation error.DAException- If an error occurs during the data access.
-
notifyWorkOrderOperationResource
protected void notifyWorkOrderOperationResource(BOWorkOrderOperationResource workOrderOperationResource, PoolKit poolKit) throws DAValidateException, DAException Sends a work order operation resource notification.- Parameters:
workOrderOperationResource- TheBOWorkOrderOperationResourceobject representing the work order operation resource.poolKit- ThePoolKit- Throws:
DAValidateException- If there is a validation error.DAException- If an error occurs during the data access.
-
updateValidationStatus
Updates the validation status by calling theInterventionOutcomeValidationStatusUpdateEvent- Parameters:
poolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
updateWorkOrder
Updates the work order header after an intervention resource has been inserted.- Parameters:
poolKit- thePoolKit- Throws:
DAValidateException- if there is a validation errorDAException- if there is a data access exception
-
checkWorkOrderStatus
protected void checkWorkOrderStatus(BOInterventionResource interventionResource, PoolKit poolKit) throws DAValidateException, DAException Checks the status of the work order associated with the providedBOInterventionResource.- Parameters:
interventionResource- theBOInterventionResourceto check the work order status forpoolKit- thePoolKit- Throws:
DAValidateException- if the work order is in a closed, aligned, or cancelled stateDAException- if an error occurs during the check
-
getIntegrationService
protected WorkOrdersIntegrationService getIntegrationService(PoolKit poolKit) throws DAValidateException Retrieves the WorkOrdersIntegrationService instance. If the instance hasn't been created yet, it will be created and stored for future use.- Parameters:
poolKit- ThePoolKit.- Returns:
- The
WorkOrdersIntegrationServiceinstance. - Throws:
DAValidateException- 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
-