Class BTCrewShellOperationCenterDelete
java.lang.Object
overit.geocall.bl.BusinessTask<CrewShellOperationCenterDeleteEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<CrewShellOperationCenterDeleteEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<CrewShellOperationCenterDeleteEvent>
overit.geocallapp.wfm.core.bl.crewshell.configuration.operationcenter.task.BTCrewShellOperationCenterDelete
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(CrewShellOperationCenterDeleteEvent.class)
public class BTCrewShellOperationCenterDelete
extends ValidPermissionBusinessTask<CrewShellOperationCenterDeleteEvent>
Business task to delete a
When the
The deletion of a
BOCrewShellOperationCenter object. When the
CrewShellOperationCenterDeleteEvent event is launched the BT notices the
call and deletes the BOCrewShellOperationCenter object basing on the event's input. The deletion of a
BOCrewShellOperationCenter object indicates the deactivation of
the BOCrewShell objects that were previously activated for the associated BOOperationCenter object.
The deactivation of the BOCrewShell objects for the associated BOOperationCenter object implies that
the crew shells' compositions, skills, addresses, calendars and schedulings are no longer updatable.- Since:
- 16.0
- See Also:
- GCApi:
- task
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BOCache<BOCrewShellOperationCenter> protected BOCache<BOOperationCenter> protected BOCache<BOWorkOrderOperation> Fields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddeactivateCrewShells(BOCrewShellOperationCenter input, PoolKit poolKit) Deactivates all theBOCrewShellobjects (i.e., crew shells) associated to theBOCrewShellOperationCenterinput to be deleted by launching aCrewShellUpdateEventevent.protected voidexecute(CrewShellOperationCenterDeleteEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected voidInitializes theBOCacheobject for each business object.booleanDetermines whether the current state is valid for execution.protected List<BOCrewShell> retrieveCrewShellsByOC(BOCrewShellOperationCenter input, PoolKit poolKit) Retrieves theBOCrewShellobjects (i.e., crew shells) associated with the givenBOOperationCenterobject (i.e., operation center).protected List<BOOperationCenter> retrieveOperationCenters(PoolKit poolKit) Retrieves the list of all theBOOperationCenterobjects (i.e., operation centers).retrieveOperationCentersIDs(PoolKit poolKit) Retrieves the list of all theBOOperationCenterobjects' IDs (i.e., the IDs of the operation centers).protected List<BOScheduling> retrieveSchedulings(BOWorkShift workShift, PoolKit poolKit) Retrieves theBOSchedulingobjects (i.e., schedulings) related to eachBOCrewShellobject (i.e., crew shell).protected BOWorkOrderHeaderretrieveWorkOrder(Long workOrderOperationID, PoolKit poolKit) Retrieves theBOWorkOrderHeaderobject related to eachBOCrewShellobject (i.e., crew shell).protected voidValidates the deletion of aBOCrewShellOperationCenterobject.protected voidvalidateExistingDeactivation(BOCrewShellOperationCenter input, PoolKit poolKit) Validates whether theBOCrewShellobjects (i.e., crew shells) have not already been deactivated for the associatedBOOperationCenterobject (i.e., operation center).protected voidvalidateOperationCenter(BOCrewShellOperationCenter input, PoolKit poolKit) Validates whether the associatedBOOperationCenterobject is not null.protected voidValidates whether theBOCrewShellobjects (i.e., crew shells) to be deactivated for the associatedBOOperationCenterobject (i.e., operation center), both present and future, do not have anyBOWorkOrderHeaderobject that is not TECHNICALLY_CLOSED, CLOSED or CANCELLED (i.e., open or pending work orders).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
-
operationCenterBOCache
-
workOrderBOCache
-
workOrderOperationBOCache
-
crewShellOperationCenterBOCache
-
-
Constructor Details
-
BTCrewShellOperationCenterDelete
public BTCrewShellOperationCenterDelete()
-
-
Method Details
-
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
-
execute
protected void execute(CrewShellOperationCenterDeleteEvent event, PoolKit poolKit) throws DAValidateException, DAException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<CrewShellOperationCenterDeleteEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAValidateException- if validation fails during executionDAException- if a data access error occurs during execution
-
validateCrewShellsDeactivationForOperationCenter
protected void validateCrewShellsDeactivationForOperationCenter(BOCrewShellOperationCenter input, PoolKit poolKit) throws DAValidateException, DAException Validates the deletion of aBOCrewShellOperationCenterobject. Remember that the deletion of aBOCrewShellOperationCenterobject implies the deactivation of theBOCrewShellobjects for the relatedBOOperationCenterobject. The deactivation is possible if and only if: the givenBOOperationCenterobject is not null; theBOCrewShellobjects have not been already deactivated for the givenBOOperationCenterobject; theBOCrewShellobjects, both present and future, do not have anyBOWorkOrderHeaderobject which status is not TECHNICALLY_CLOSED, CLOSED or CANCELLED.- Parameters:
input- theBOCrewShellOperationCenterobject to be validatedpoolKit- thePoolKitpoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
validateOperationCenter
protected void validateOperationCenter(BOCrewShellOperationCenter input, PoolKit poolKit) throws DAValidateException, DAException Validates whether the associatedBOOperationCenterobject is not null. If the associatedBOOperationCenterobject is null, it throws aDAValidateExceptionobject (i.e., CREW_SHELLS_CANNOT_BE_DEACTIVATED_FOR_UNEXISTING_OC).- Parameters:
input- theBOCrewShellOperationCenterexistspoolKit- thePoolKitpoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
validateExistingDeactivation
protected void validateExistingDeactivation(BOCrewShellOperationCenter input, PoolKit poolKit) throws DAValidateException, DAException Validates whether theBOCrewShellobjects (i.e., crew shells) have not already been deactivated for the associatedBOOperationCenterobject (i.e., operation center). If the crew shells have already been deactivated for the associated operation center, it throws aDAValidateExceptionobject (i.e., CREW_SHELLS_ALREADY_DEACTIVATED_FOR_OC).- Parameters:
input- theBOCrewShellOperationCenterobject to be deletedpoolKit- thePoolKitpoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
validateScheduledActivitiesToBePerformed
protected void validateScheduledActivitiesToBePerformed(BOCrewShellOperationCenter input, PoolKit poolKit) throws DAException, DAValidateException Validates whether theBOCrewShellobjects (i.e., crew shells) to be deactivated for the associatedBOOperationCenterobject (i.e., operation center), both present and future, do not have anyBOWorkOrderHeaderobject that is not TECHNICALLY_CLOSED, CLOSED or CANCELLED (i.e., open or pending work orders). If the crew shells to be deactivated for the associated operation center have open or pending work orders, it throws aDAValidateExceptionobject (i.e., CREW_SHELL_CANNOT_BE_DEACTIVATED_FOR_PENDING_WORK_ORDERS).- Parameters:
input- theBOCrewShellOperationCenterobject to be deletedpoolKit- thePoolKitpoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
retrieveOperationCenters
protected List<BOOperationCenter> retrieveOperationCenters(PoolKit poolKit) throws DAValidateException, DAException Retrieves the list of all theBOOperationCenterobjects (i.e., operation centers).- Parameters:
poolKit- thePoolKit- Returns:
- the list of all the operation centers
- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
retrieveOperationCentersIDs
protected List<Long> retrieveOperationCentersIDs(PoolKit poolKit) throws DAException, DAValidateException Retrieves the list of all theBOOperationCenterobjects' IDs (i.e., the IDs of the operation centers).- Parameters:
poolKit- thePoolKit- Returns:
- the list of the operation centers' IDs
- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
retrieveCrewShellsByOC
protected List<BOCrewShell> retrieveCrewShellsByOC(BOCrewShellOperationCenter input, PoolKit poolKit) throws DAValidateException, DAException Retrieves theBOCrewShellobjects (i.e., crew shells) associated with the givenBOOperationCenterobject (i.e., operation center).- Parameters:
input- theBOCrewShellOperationCenterobjectpoolKit- thePoolKitpoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
retrieveSchedulings
protected List<BOScheduling> retrieveSchedulings(BOWorkShift workShift, PoolKit poolKit) throws DAException, DAValidateException Retrieves theBOSchedulingobjects (i.e., schedulings) related to eachBOCrewShellobject (i.e., crew shell).- Parameters:
workShift- theBOWorkShiftobjectpoolKit- thePoolKitpoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
retrieveWorkOrder
protected BOWorkOrderHeader retrieveWorkOrder(Long workOrderOperationID, PoolKit poolKit) throws DAValidateException, DAException Retrieves theBOWorkOrderHeaderobject related to eachBOCrewShellobject (i.e., crew shell).- Parameters:
workOrderOperationID- the ID of theBOWorkOrderOperationobjectpoolKit- thePoolKitpoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
deactivateCrewShells
protected void deactivateCrewShells(BOCrewShellOperationCenter input, PoolKit poolKit) throws DAException, DAValidateException Deactivates all theBOCrewShellobjects (i.e., crew shells) associated to theBOCrewShellOperationCenterinput to be deleted by launching aCrewShellUpdateEventevent.- Parameters:
input- theBOCrewShellOperationCenterobject to be insertedpoolKit- thePoolKitpoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
initCache
protected void initCache()Initializes theBOCacheobject for each business object.
-