Class BTWorkShiftExceptionTotalsCalculation
java.lang.Object
overit.geocall.bl.BusinessTask<WorkShiftExceptionTotalsCalculationEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<WorkShiftExceptionTotalsCalculationEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<WorkShiftExceptionTotalsCalculationEvent>
overit.geocallapp.wfm.calendars.bl.workshift.exception.task.BTWorkShiftExceptionTotalsCalculation
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(WorkShiftExceptionTotalsCalculationEvent.class)
public class BTWorkShiftExceptionTotalsCalculation
extends ValidPermissionBusinessTask<WorkShiftExceptionTotalsCalculationEvent>
Business task which implements some calculation logics related to a
When the
BOWorkShiftException. When the
WorkShiftExceptionTotalsCalculationEvent is launched the BT notices the call
and does the required logics basing on the event's input. - Since:
- 17.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 voidcalculateTotalUnavailability(BOWorkShift workShift, PoolKit poolKit) Calculates the total amount of overlapping breaks and absences during a givenBOWorkShift-protected voidexecute(WorkShiftExceptionTotalsCalculationEvent event, PoolKit poolKit) Implements some logics about the calculation.protected List<BOWorkShiftException> getExceptions(List<BOWorkShiftException> shiftExceptions, Long classType, PoolKit poolKit) Method that filters a list of input work shift exceptions based on the class type.booleanDetermines whether the current state is valid for execution.protected List<BOWorkShiftExceptionWorkShift> loadRelations(BOWorkShift workShift, PoolKit poolKit) protected voidnotifyWorkShift(BOWorkShift workShift, BaseNotificationAction action, PoolKit poolKit) protected BOWorkShiftsearchWorkShift(Long workShiftId, PoolKit poolKit) Searches the requiredBOWorkShift.protected List<BOWorkShiftException> searchWorkShiftExceptionWorkShift(BOWorkShift workShift, PoolKit poolKit) Loads absences and extra presences overlapping a givenBOWorkShift.protected voidsetStartEndDate(BOWorkShift workShift, TimeLine timeLine) Method to set the new start and end dates of work shifts based on extra presences and absences.protected voidupdateWorkShift(BOWorkShift workShift, PoolKit poolKit) Updates the work shift.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
-
BTWorkShiftExceptionTotalsCalculation
public BTWorkShiftExceptionTotalsCalculation()
-
-
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(WorkShiftExceptionTotalsCalculationEvent event, PoolKit poolKit) throws DAException, DAValidateException Implements some logics about the calculation.- Specified by:
executein classValidExecutionBusinessTask<WorkShiftExceptionTotalsCalculationEvent>- Parameters:
event- theWorkShiftExceptionTotalsCalculationEventpoolKit- thePoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionis thrown
-
searchWorkShift
protected BOWorkShift searchWorkShift(Long workShiftId, PoolKit poolKit) throws DAException, DAValidateException Searches the requiredBOWorkShift.- Parameters:
workShiftId- the ID of the requiredBOWorkShiftpoolKit- thePoolKitpool kit- Returns:
- the required work shift
- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
getExceptions
protected List<BOWorkShiftException> getExceptions(List<BOWorkShiftException> shiftExceptions, Long classType, PoolKit poolKit) throws DAValidateException, DAException Method that filters a list of input work shift exceptions based on the class type.- Parameters:
shiftExceptions- the list ofBOWorkShiftExceptionclassType- the class type idpoolKit- thePoolKit- Returns:
- the filtered list of
BOWorkShiftException - Throws:
DAValidateExceptionDAException
-
searchWorkShiftExceptionWorkShift
protected List<BOWorkShiftException> searchWorkShiftExceptionWorkShift(BOWorkShift workShift, PoolKit poolKit) throws DAException, DAValidateException Loads absences and extra presences overlapping a givenBOWorkShift.- Parameters:
workShift- theBOWorkShiftpoolKit- thePoolKitpool kit- Returns:
- the list of work shift exceptions overlapping a given work shift
- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
loadRelations
protected List<BOWorkShiftExceptionWorkShift> loadRelations(BOWorkShift workShift, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
setStartEndDate
Method to set the new start and end dates of work shifts based on extra presences and absences.- Parameters:
workShift- theBOWorkShifttimeLine- theTimeLineof the work shift
-
updateWorkShift
protected void updateWorkShift(BOWorkShift workShift, PoolKit poolKit) throws DAException, DAValidateException Updates the work shift.- Parameters:
workShift- theBOWorkShiftpoolKit- thePoolKitpool kit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
notifyWorkShift
protected void notifyWorkShift(BOWorkShift workShift, BaseNotificationAction action, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-