Class BTSchedulingCoordinatesPathCalculation
java.lang.Object
overit.geocall.bl.BusinessTask<SchedulingCoordinatesPathCalculationEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<SchedulingCoordinatesPathCalculationEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<SchedulingCoordinatesPathCalculationEvent>
overit.geocallapp.wfm.orchestrator.scheduling.bl.activityassignment.task.BTSchedulingCoordinatesPathCalculation
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(SchedulingCoordinatesPathCalculationEvent.class)
public class BTSchedulingCoordinatesPathCalculation
extends ValidPermissionBusinessTask<SchedulingCoordinatesPathCalculationEvent>
Business task in order to schedule an activity to a resource
- Since:
- 17.0
- See Also:
- GCApi:
- task
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BOSchedulingprotected Longprotected Longprotected SchedulingTeamResourceprotected BOResourceTypeprotected Longprotected TimeLineFields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalculate start-end activity dates and the arrival date, with also the break slot if needed.protected voidaddTimeAndDistanceInformation(PoolKit poolKit) Calculates the times and the distance between the current scheduling and the previous/next.protected voidexecute(SchedulingCoordinatesPathCalculationEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected org.locationtech.jts.geom.CoordinategetActivityCoordinates(BOScheduling previousScheduling, BOScheduling nextScheduling, boolean isStartPoint, PoolKit poolKit) Returns the start or endCoordinateof the input schedulingprotected DategetArrivalDate(Long timeFromPrevious, Date startWorkDate) Gets the arrival date of the resource, starting from the previous activity or the workshift start dateprotected SchedulingIntegrationServicegetIntegrationService(PoolKit poolKit) protected BOSchedulingprotected BOSchedulingprotected Dateprotected LonggetScheduledActivityAddress(BOScheduling scheduling, PoolKit poolKit) Returns the address Id of the input schedulingprotected booleanReturns true if the break is already managed in a previous scheduling, false otherwiseprotected booleanReturn a boolean that says if the time-distance calculation is enabledbooleanDetermines whether the current state is valid for execution.protected voidloadRequiredEntities(PoolKit poolKit) protected voidresetBreakOnNextSchedulings(boolean isBreakIncluded) If the break has been included in the current activity, reset the break values in the next schedulingsprotected voidMethods 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
-
resourceDetail
-
currentScheduling
-
resourceType
-
operationCenter
-
ossSpace
-
transferTimeType
-
workShiftTimeLine
-
-
Constructor Details
-
BTSchedulingCoordinatesPathCalculation
public BTSchedulingCoordinatesPathCalculation()
-
-
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(SchedulingCoordinatesPathCalculationEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<SchedulingCoordinatesPathCalculationEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
validateEventInput
-
getIntegrationService
protected SchedulingIntegrationService getIntegrationService(PoolKit poolKit) throws DAValidateException - Throws:
DAValidateException
-
getPreviousScheduling
-
getNextScheduling
-
loadRequiredEntities
- Throws:
DAValidateExceptionDAException
-
addTimeAndDistanceInformation
protected void addTimeAndDistanceInformation(PoolKit poolKit) throws DAValidateException, DAException Calculates the times and the distance between the current scheduling and the previous/next.- Parameters:
poolKit-- Throws:
DAValidateExceptionDAException
-
getResourceStartWorkDate
- Throws:
DAValidateException
-
isCoordinatesPathCalculationEnabled
protected boolean isCoordinatesPathCalculationEnabled(PoolKit poolKit) throws DAValidateException, DAException Return a boolean that says if the time-distance calculation is enabled- Parameters:
poolKit- thePoolKit- Returns:
- Throws:
DAValidateExceptionDAException
-
addStartEndTimeWithBreak
Calculate start-end activity dates and the arrival date, with also the break slot if needed.- Throws:
DAValidateException
-
isBreakAlreadyManaged
protected boolean isBreakAlreadyManaged()Returns true if the break is already managed in a previous scheduling, false otherwise -
resetBreakOnNextSchedulings
protected void resetBreakOnNextSchedulings(boolean isBreakIncluded) If the break has been included in the current activity, reset the break values in the next schedulings -
getArrivalDate
Gets the arrival date of the resource, starting from the previous activity or the workshift start date- Parameters:
timeFromPrevious-startWorkDate-- Returns:
-
getScheduledActivityAddress
protected Long getScheduledActivityAddress(BOScheduling scheduling, PoolKit poolKit) throws DAValidateException, DAException Returns the address Id of the input scheduling- Parameters:
scheduling- theBOSchedulingpoolKit- thePoolKit- Returns:
- the address Id of the input scheduling
- Throws:
DAValidateExceptionDAException
-
getActivityCoordinates
protected org.locationtech.jts.geom.Coordinate getActivityCoordinates(BOScheduling previousScheduling, BOScheduling nextScheduling, boolean isStartPoint, PoolKit poolKit) throws DAValidateException, DAException Returns the start or endCoordinateof the input scheduling- Parameters:
previousScheduling- theBOSchedulingisStartPoint- says if we are requiring the coordinates of the start or end point- Returns:
- the start or end coordinates of the scheduling
- Throws:
DAValidateExceptionDAException
-