java.lang.Object
overit.geocallapp.wfm.orchestrator.scheduling.utils.SchedulingUtils

public class SchedulingUtils extends Object
Utility class for scheduling actions.
  • 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

      public static Long getPathTime(CoordinatesPath coordinatesPath)
      Gets the time value from a CoordinatesPath object.
      Parameters:
      coordinatesPath - the CoordinatesPath object
      Returns:
      the time defined in the CoordinatesPath object.
    • getPathDistance

      public static Double getPathDistance(CoordinatesPath coordinatesPath)
      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 - the SchedulingIntegrationService
      addressId - the address id
      isStart - says if is a start or end address
      Returns:
      the address coordinates
      Throws:
      DAException - the DA exception
      DAValidateException - 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 - the BOAddress
      isStart - 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 end Coordinate of the scheduling
      Parameters:
      scheduling - the BOScheduling
      isStartPoint - 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 end Coordinate starting from the team configuration
      Parameters:
      service - the SchedulingIntegrationService
      resource - the SchedulingTeamResource
      isStartPoint - 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 exception
      DAValidateException - 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 end Coordinate starting from the work shift configuration
      Parameters:
      service - the SchedulingIntegrationService
      resource - the SchedulingTeamResource
      isStartPoint - 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 exception
      DAValidateException - the DA validate exception
    • getResourceAddress

      public static Long getResourceAddress(SchedulingTeamResource resource, boolean isStartAddress)
      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

      public static Long getTransferTimeType(SchedulingTeamResource resource)
    • getOssSpace

      public static Long getOssSpace(SchedulingTeamResource resource)
    • getWorkShiftDays

      public static List<Date> getWorkShiftDays(TimeLine workShiftTimeLine) throws DAValidateException
      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 status BOSchedulingStatus.Values.CANCELLED
      Parameters:
      workShiftId - the work shift of the scheduling ids you want to retrieve
      poolKit - the PoolKit
      Returns:
      a List of scheduling IDs that meet the specified criteria
      Throws:
      DAException - if an error occurs during the loading process
      DAValidateException - if the scheduling is not valid