Class SchedulingUtils
java.lang.Object
overit.geocallapp.wfm.orchestrator.scheduling.utils.SchedulingUtils
Utility class for scheduling actions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.locationtech.jts.geom.CoordinategetAddressCoordinate(BOAddress address, boolean isStart) Returns the address coordinates starting from an address idstatic org.locationtech.jts.geom.CoordinategetAddressCoordinate(SchedulingIntegrationService service, Long addressId, boolean isStart) Returns the address coordinates starting from an address idstatic org.locationtech.jts.geom.CoordinategetCoordianteFromScheduling(BOScheduling scheduling, boolean isStartPoint) Returns the start or endCoordinateof the schedulingstatic org.locationtech.jts.geom.CoordinategetCoordianteFromTeamAddress(SchedulingIntegrationService service, SchedulingTeamResource resource, boolean isStartPoint) Return the start or endCoordinatestarting from the team configurationstatic org.locationtech.jts.geom.CoordinategetCoordinateFromWorkshiftAddress(SchedulingIntegrationService service, SchedulingTeamResource resource, boolean isStartPoint) Return the start or endCoordinatestarting from the work shift configurationstatic LonggetOssSpace(SchedulingTeamResource resource) static DoublegetPathDistance(CoordinatesPath coordinatesPath) Gets the distance value from a CoordinatesPath object.static LonggetPathTime(CoordinatesPath coordinatesPath) Gets the time value from a CoordinatesPath object.static LonggetResourceAddress(SchedulingTeamResource resource, boolean isStartAddress) Return the start or end address of the current resourcestatic LonggetTransferTimeType(SchedulingTeamResource resource) getWorkShiftDays(TimeLine workShiftTimeLine) Returns a list of work shift days from the given workShiftTimeLine.static booleanCheck in the system properties if the time-distance calculation is disabled.static List<BOScheduling> loadSchedulingFromWorkShift(SchedulingIntegrationService integrationService, Long workShiftId, PoolKit poolKit) This method loads the scheduling starting from a work shift id, it gets the scheduling ids for the scheduling that are not in statusBOSchedulingStatus.Values.CANCELLED
-
Method Details
-
isCoordinatesPathCalculationDisabled
public static boolean isCoordinatesPathCalculationDisabled()Check in the system properties if the time-distance calculation is disabled.- Returns:
- true if the time-distance calculation is disabled, false otherwise
-
getPathTime
Gets the time value from a CoordinatesPath object.- Parameters:
coordinatesPath- the CoordinatesPath object- Returns:
- the time defined in the CoordinatesPath object.
-
getPathDistance
Gets the distance value from a CoordinatesPath object.- Parameters:
coordinatesPath- the CoordinatesPath object- Returns:
- the distance defined in the CoordinatesPath object.
-
getAddressCoordinate
public static org.locationtech.jts.geom.Coordinate getAddressCoordinate(SchedulingIntegrationService service, Long addressId, boolean isStart) throws DAValidateException, DAException Returns the address coordinates starting from an address id- Parameters:
service- theSchedulingIntegrationServiceaddressId- the address idisStart- says if is a start or end address- Returns:
- the address coordinates
- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
getAddressCoordinate
public static org.locationtech.jts.geom.Coordinate getAddressCoordinate(BOAddress address, boolean isStart) throws DAValidateException Returns the address coordinates starting from an address id- Parameters:
address- theBOAddressisStart- says if is a start or end address- Returns:
- the address coordinates
- Throws:
DAValidateException- the DA validate exception
-
getCoordianteFromScheduling
public static org.locationtech.jts.geom.Coordinate getCoordianteFromScheduling(BOScheduling scheduling, boolean isStartPoint) Returns the start or endCoordinateof the scheduling- Parameters:
scheduling- theBOSchedulingisStartPoint- says if we are requiring the coordinates of the start or end point- Returns:
- the start or end coordinates of the scheduling
-
getCoordianteFromTeamAddress
public static org.locationtech.jts.geom.Coordinate getCoordianteFromTeamAddress(SchedulingIntegrationService service, SchedulingTeamResource resource, boolean isStartPoint) throws DAValidateException, DAException Return the start or endCoordinatestarting from the team configuration- Parameters:
service- theSchedulingIntegrationServiceresource- theSchedulingTeamResourceisStartPoint- says if we are requiring the coordinates of the start or end point- Returns:
- the start or end coordinates from the team configuration
- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
getCoordinateFromWorkshiftAddress
public static org.locationtech.jts.geom.Coordinate getCoordinateFromWorkshiftAddress(SchedulingIntegrationService service, SchedulingTeamResource resource, boolean isStartPoint) throws DAValidateException, DAException Return the start or endCoordinatestarting from the work shift configuration- Parameters:
service- theSchedulingIntegrationServiceresource- theSchedulingTeamResourceisStartPoint- says if we are requiring the coordinates of the start or end point- Returns:
- the start or end coordinates of the work shift
- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
getResourceAddress
Return the start or end address of the current resource- Parameters:
isStartAddress- says if we are requiring the star or the end address- Returns:
- poolKit the
PoolKit
-
getTransferTimeType
-
getOssSpace
-
getWorkShiftDays
Returns a list of work shift days from the given workShiftTimeLine.- Parameters:
workShiftTimeLine- The TimeLine object representing the work shift schedule.- Returns:
- A List containing the work shift days, represented as Date objects.
- Throws:
DAValidateException- If the workShiftTimeLine does not contain any work shift ranges.
-
loadSchedulingFromWorkShift
public static List<BOScheduling> loadSchedulingFromWorkShift(SchedulingIntegrationService integrationService, Long workShiftId, PoolKit poolKit) throws DAException, DAValidateException This method loads the scheduling starting from a work shift id, it gets the scheduling ids for the scheduling that are not in statusBOSchedulingStatus.Values.CANCELLED- Parameters:
workShiftId- the work shift of the scheduling ids you want to retrievepoolKit- thePoolKit- Returns:
- a List of scheduling IDs that meet the specified criteria
- Throws:
DAException- if an error occurs during the loading processDAValidateException- if the scheduling is not valid
-