Class BTCrewShellTechnicianUpdate
java.lang.Object
overit.geocall.bl.BusinessTask<CrewShellTechnicianUpdateEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<CrewShellTechnicianUpdateEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<CrewShellTechnicianUpdateEvent>
overit.geocallapp.wfm.core.bl.crewshell.composition.draft.task.BTCrewShellTechnicianUpdate
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(CrewShellTechnicianUpdateEvent.class)
public class BTCrewShellTechnicianUpdate
extends ValidPermissionBusinessTask<CrewShellTechnicianUpdateEvent>
Business task in order to update a
When the
BOCrewShellDraftComposition object. When the
CrewShellTechnicianUpdateEvent event is launched the BT notices the
call and updates the BOCrewShellDraftComposition object basing on the event's input. - Since:
- 16.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 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(CrewShellTechnicianUpdateEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.Retrieves the list of the not editable fields of aBOCrewShellDraftCompositionobject.protected voidhandleForemanToFalseTransition(BOCrewShellDraftComposition currentTechnician, PoolKit poolKit) Handles the transition of the foreman field from true to false for theBOCrewShellDraftCompositionobject to be updated.protected voidhandleForemanToTrueTransition(BOCrewShellDraftComposition currentTechnician, PoolKit poolKit) Handles the transition of the foreman field from false to true for theBOCrewShellDraftCompositionobject to be updated.protected voidInitializes theBOCacheobjects for each business object.booleanDetermines whether the current state is valid for execution.protected voidupdateForemanTransition(BOCrewShellDraftComposition currentTechnician, boolean newForemanValue, PoolKit poolKit) Updates the transition of the foreman field for theBOCrewShellDraftCompositionobject to be updated.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
-
-
Constructor Details
-
BTCrewShellTechnicianUpdate
public BTCrewShellTechnicianUpdate()
-
-
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(CrewShellTechnicianUpdateEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<CrewShellTechnicianUpdateEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
handleForemanToFalseTransition
protected void handleForemanToFalseTransition(BOCrewShellDraftComposition currentTechnician, PoolKit poolKit) throws DAValidateException, DAException Handles the transition of the foreman field from true to false for theBOCrewShellDraftCompositionobject to be updated. It updates theBOCrewShellDraftCompositionobject's foreman status from true to false and performs any necessary operations related to this transition; more precisely, it searches for otherBOCrewShellDraftCompositionobjects in the sameBOCrewShellobject and determines theBOCrewShellDraftCompositionhaving the smallest id as the new foreman.- Parameters:
currentTechnician- the currentBOCrewShellDraftCompositionobject for whom the foreman field is transitioningpoolKit- thePoolKitpoolkit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
handleForemanToTrueTransition
protected void handleForemanToTrueTransition(BOCrewShellDraftComposition currentTechnician, PoolKit poolKit) throws DAValidateException, DAException Handles the transition of the foreman field from false to true for theBOCrewShellDraftCompositionobject to be updated. It updates theBOCrewShellDraftCompositionobject's foreman status from false to true and performs any necessary operations related to this transition; more precisely, it searches for the currentBOCrewShellDraftCompositionforeman and determines theBOCrewShellDraftCompositionobject to be updated as the new foreman of theBOCrewShellobject.- Parameters:
currentTechnician- the currentBOCrewShellDraftCompositionobject for whom the foreman field is transitioningpoolKit- thePoolKitpoolkit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
updateForemanTransition
protected void updateForemanTransition(BOCrewShellDraftComposition currentTechnician, boolean newForemanValue, PoolKit poolKit) throws DAValidateException, DAException Updates the transition of the foreman field for theBOCrewShellDraftCompositionobject to be updated. It manages the transition of the foreman field for theBOCrewShellDraftCompositionobject to be updated, which can either change from true to false or from false to true. It searches for otherBOCrewShellDraftCompositionobjects within the sameBOCrewShellobject and determines the new foreman based on certain logical conditions based on the id.- Parameters:
currentTechnician- the currentBOCrewShellDraftCompositionobject for whom the foreman field is transitioningnewForemanValue- the new value for the foreman field (i.e., true or false)poolKit- thePoolKitpoolkit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
getNotUpdatableFields
Retrieves the list of the not editable fields of aBOCrewShellDraftCompositionobject.- Returns:
- notUpdatableFields the list of the not editable fields.
-
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 theBOCacheobjects for each business object.
-