Class BTWorkShiftTourDataCalculator
java.lang.Object
overit.geocall.bl.BusinessTask<ResourceWorkShiftTourCalculationEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<ResourceWorkShiftTourCalculationEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<ResourceWorkShiftTourCalculationEvent>
overit.geocallapp.wfm.orchestrator.scheduling.bl.activityassignment.task.BTWorkShiftTourDataCalculator
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(ResourceWorkShiftTourCalculationEvent.class)
public class BTWorkShiftTourDataCalculator
extends ValidPermissionBusinessTask<ResourceWorkShiftTourCalculationEvent>
Business task in order to schedule an activity to a resource
- Since:
- 17.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 voidcalculateTourInformation(BOResourceWorkShiftTour tourData, PoolKit poolKit) This method calculates tour information for a resource's work shift.protected voidcheckTourTime(Date tourEndDate, PoolKit poolKit) Checks if the tour time of the resource is contained into the resource workshift time.protected voiddefineStartWorkingTime(PoolKit poolKit) Return the start working time of the resourceprotected voidelaborateFirstScheduling(BOResourceWorkShiftTour tourData, BOScheduling firstScheduling) Calculate the tour information related to the first schedulingprotected voidelaborateNextScheduling(BOResourceWorkShiftTour tourData, BOScheduling nextScheduling) Calculate the tour information adding a new scheduling to the tourprotected voidexecute(ResourceWorkShiftTourCalculationEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected SchedulingIntegrationServicegetIntegrationService(PoolKit poolKit) booleanDetermines whether the current state is valid for execution.protected voidloadRequiredEntities(PoolKit poolKit) 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
-
resource
-
transferTimeType
-
startWorkingTime
-
-
Constructor Details
-
BTWorkShiftTourDataCalculator
public BTWorkShiftTourDataCalculator()
-
-
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(ResourceWorkShiftTourCalculationEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<ResourceWorkShiftTourCalculationEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
loadRequiredEntities
- Throws:
DAValidateExceptionDAException
-
getIntegrationService
protected SchedulingIntegrationService getIntegrationService(PoolKit poolKit) throws DAValidateException - Throws:
DAValidateException
-
defineStartWorkingTime
Return the start working time of the resource- Throws:
DAValidateExceptionDAException
-
calculateTourInformation
protected void calculateTourInformation(BOResourceWorkShiftTour tourData, PoolKit poolKit) throws DAValidateException, DAException This method calculates tour information for a resource's work shift. It iterates through the resource's work shift schedulings to find the first non-cancelled scheduling. Once found, it uses it to elaborate the tour information of first scheduling and next scheduling. Finally, it checks the tour time.- Parameters:
tourData- The BOResourceWorkShiftTour object to store the calculated tour information.poolKit- ThePoolKit- Throws:
DAValidateException- If there is a validation error.DAException- If there is a data access error.
-
elaborateFirstScheduling
protected void elaborateFirstScheduling(BOResourceWorkShiftTour tourData, BOScheduling firstScheduling) Calculate the tour information related to the first scheduling -
elaborateNextScheduling
protected void elaborateNextScheduling(BOResourceWorkShiftTour tourData, BOScheduling nextScheduling) Calculate the tour information adding a new scheduling to the tour -
checkTourTime
protected void checkTourTime(Date tourEndDate, PoolKit poolKit) throws DAValidateException, DAException Checks if the tour time of the resource is contained into the resource workshift time.- Parameters:
tourEndDate- the end time of the tourpoolKit-- Throws:
DAValidateExceptionDAException
-