Class BTCrewShellTechnicianAllocationCopy
java.lang.Object
overit.geocall.bl.BusinessTask<CrewShellTechnicianAllocationCopyEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<CrewShellTechnicianAllocationCopyEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<CrewShellTechnicianAllocationCopyEvent>
overit.geocallapp.wfm.core.bl.crewshell.composition.draft.task.BTCrewShellTechnicianAllocationCopy
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(CrewShellTechnicianAllocationCopyEvent.class)
public class BTCrewShellTechnicianAllocationCopy
extends ValidPermissionBusinessTask<CrewShellTechnicianAllocationCopyEvent>
Business task to copy the
When the
BOCrewShellDraftComposition objects from the original day to the destination day When the
CrewShellTechnicianAllocationCopyEvent event is launched
the BT notices the call and copy the BOCrewShellDraftComposition . - Since:
- 16.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 voidallocateTechnicians(Long destinationCrewShell, List<BOCrewShellDraftComposition> technicians, Date dayTo, PoolKit pk) Allocates the list ofBOCrewShellDraftCompositionobjects to aBOCrewShellobject.protected voiddeallocateAllTechniciansOnDestinationDay(Long crewShell, Date day, PoolKit pk) Deallocates theBOCrewShellDraftCompositionobjects from aBOCrewShellobject.protected voidexecute(CrewShellTechnicianAllocationCopyEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.booleanDetermines whether the current state is valid for execution.protected List<BOCrewShellDraftComposition> retrieveCrewShellTechnicians(Long crewShell, Date day, PoolKit pk) Retrieves the list ofBOCrewShellDraftCompositionobjects associated with theBOCrewShellobject.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
-
BTCrewShellTechnicianAllocationCopy
public BTCrewShellTechnicianAllocationCopy()
-
-
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(CrewShellTechnicianAllocationCopyEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<CrewShellTechnicianAllocationCopyEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
retrieveCrewShellTechnicians
protected List<BOCrewShellDraftComposition> retrieveCrewShellTechnicians(Long crewShell, Date day, PoolKit pk) throws DAException, DAValidateException Retrieves the list ofBOCrewShellDraftCompositionobjects associated with theBOCrewShellobject. Remember that the composition ofBOCrewShellobject varies according to a specific day.- Parameters:
crewShell- theBOCrewShellDraftCompositionobject's crewShelll fieldday- theBOCrewShellDraftCompositionobject's day fieldpk- thePoolKitpk- Returns:
- the ID of the newly inserted
BOCrewShellDraftCompositionobject - Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
deallocateAllTechniciansOnDestinationDay
protected void deallocateAllTechniciansOnDestinationDay(Long crewShell, Date day, PoolKit pk) throws DAException, DAValidateException Deallocates theBOCrewShellDraftCompositionobjects from aBOCrewShellobject. Remember that the composition ofBOCrewShellobject varies according to a specific day.- Parameters:
crewShell- theBOCrewShellDraftCompositionobject's crewShelll fieldday- theBOCrewShellDraftCompositionobject's day fieldpk- thePoolKitpk- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
allocateTechnicians
protected void allocateTechnicians(Long destinationCrewShell, List<BOCrewShellDraftComposition> technicians, Date dayTo, PoolKit pk) throws DAException, DAValidateException Allocates the list ofBOCrewShellDraftCompositionobjects to aBOCrewShellobject. Remember that the composition ofBOCrewShellobject varies according to a specific day.- Parameters:
destinationCrewShell- theBOCrewShellobject's id fieldtechnicians- the list ofBOCrewShellDraftCompositionobjects to be allocateddayTo- theDatedaypk- thePoolKitpk- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-