Class BTCrewShellTechnicianInsert
java.lang.Object
overit.geocall.bl.BusinessTask<CrewShellTechnicianInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<CrewShellTechnicianInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<CrewShellTechnicianInsertEvent>
overit.geocallapp.wfm.core.bl.crewshell.composition.draft.task.BTCrewShellTechnicianInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(CrewShellTechnicianInsertEvent.class)
public class BTCrewShellTechnicianInsert
extends ValidPermissionBusinessTask<CrewShellTechnicianInsertEvent>
Business task to insert a
When the
BOCrewShellDraftComposition object. When the
CrewShellTechnicianInsertEvent event is launched the BT notices the
call and inserts the BOCrewShellDraftComposition object basing on the event's input. - 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 voidalignCrewShellComposition(Long crewShellID, Date day, PoolKit pk) Aligns the composition of aBOCrewShellobject (i.e., crew shell) for the selectedDateday (i.e., composition day) if its composition changes.protected voidexecute(CrewShellTechnicianInsertEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected voidInitializes theBOCacheobject to load aBOCrewShellobject.booleanDetermines whether the current state is valid for execution.protected List<BOCrewShellDraftComposition> retrieveTechniciansByCrewShellAndDay(BOCrewShellDraftComposition input, PoolKit poolKit) Retrieves the draft composition of aBOCrewShellobject for the selected day, i.e., the list of associatedBOSchedulingUserobjects.protected voidvalidateAllocation(BOCrewShellDraftComposition input, PoolKit poolKit) Validates the data of theBOCrewShellDraftCompositionobject to be inserted.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
-
BTCrewShellTechnicianInsert
public BTCrewShellTechnicianInsert()
-
-
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(CrewShellTechnicianInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<CrewShellTechnicianInsertEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
validateAllocation
protected void validateAllocation(BOCrewShellDraftComposition input, PoolKit poolKit) throws DAValidateException, DAException Validates the data of theBOCrewShellDraftCompositionobject to be inserted. It checks if theBOCrewShellDraftCompositionobject's foreman field is null. It checks if theBOCrewShellDraftCompositionobject's day field is not in the past. It checks if theBOCrewShellobject and theBOCrewShellDraftCompositioninput are not null. It checks if theBOCrewShellobject is active. It checks if, in the specified day, there is not already an association between the givenBOCrewShellobject and the selectedBOSchedulingUserobject. It checks if, in the specified day, there is not already an association between anyBOCrewShellobject and the selectedBOSchedulingUserobject.- Parameters:
input- the currentBOCrewShellDraftCompositioninput to be validatedpoolKit- thePoolKitpoolkit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
retrieveTechniciansByCrewShellAndDay
protected List<BOCrewShellDraftComposition> retrieveTechniciansByCrewShellAndDay(BOCrewShellDraftComposition input, PoolKit poolKit) throws DAValidateException, DAException Retrieves the draft composition of aBOCrewShellobject for the selected day, i.e., the list of associatedBOSchedulingUserobjects.- Parameters:
input- the currentBOCrewShellDraftCompositioninput to be validatedpoolKit- thePoolKitpoolkit- Returns:
- searchEvent.launch(poolKit).getContent(); the composition of a
BOCrewShellobject for the selected day - Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
alignCrewShellComposition
protected void alignCrewShellComposition(Long crewShellID, Date day, PoolKit pk) throws DAException, DAValidateException Aligns the composition of aBOCrewShellobject (i.e., crew shell) for the selectedDateday (i.e., composition day) if its composition changes.- Parameters:
crewShellID- the crew shell's IDday- the composition datepk- thePoolKitpoolkit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
initCache
protected void initCache()Initializes theBOCacheobject to load aBOCrewShellobject.
-