Class BTCapacityPlanningScenarioCoverageTimeReport
java.lang.Object
overit.geocall.bl.BusinessTask<CapacityPlanningScenarioCoverageTimeReportEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<CapacityPlanningScenarioCoverageTimeReportEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<CapacityPlanningScenarioCoverageTimeReportEvent>
overit.geocallapp.wfm.forecastcapacity.bl.capacityplanning.scenario.task.BTCapacityPlanningScenarioCoverageReport<CapacityPlanningScenarioCoverageTimeReportEvent>
overit.geocallapp.wfm.forecastcapacity.bl.capacityplanning.scenario.task.BTCapacityPlanningScenarioCoverageTimeReport
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(CapacityPlanningScenarioCoverageTimeReportEvent.class)
public class BTCapacityPlanningScenarioCoverageTimeReport
extends BTCapacityPlanningScenarioCoverageReport<CapacityPlanningScenarioCoverageTimeReportEvent>
Business task to generate the coverage time report for a capacity planning scenario.
- Since:
- 19.0
- See Also:
-
Field Summary
Fields inherited from class overit.geocallapp.wfm.forecastcapacity.bl.capacityplanning.scenario.task.BTCapacityPlanningScenarioCoverageReport
FROM, MONTH, TOFields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DateTimeRangeadjustDateRangeForWeeklyGrouping(DateTimeRange dateRange, TimeGroupingType groupingType) Adjusts the date range for weekly grouping to ensure complete weeks.protected voiddailyReport(List<Map<String, Object>> availableCapacity, List<Map<String, Object>> committedCapacity, List<Map<String, Object>> demand, Date day, CapacityPlanningScenarioCoverageTimeReportOutput output) Create a report for the given day.protected voidexecute(CapacityPlanningScenarioCoverageTimeReportEvent event, PoolKit poolKit) Calculate the coverage time for a capacity planning scenario.formatCoverageTimeReport(BOCapacityPlanningScenario scenario, List<Map<String, Object>> availableCapacity, List<Map<String, Object>> committedCapacity, List<Map<String, Object>> demand, TimeGroupingType groupingType, DateTimeRange date) Format the coverage time report.loadAvailableCapacity(Long resourceForecastHeader, List<Long> resourceIds, DateTimeRange date, TimeGroupingType groupingType, PoolKit poolKit) Load the available capacity of a resource forecast detail grouped by the specifiedTimeGroupingType.loadCommittedCapacity(Long capacityPlanningScenarioId, List<Long> resourceIds, List<Long> activityIds, DateTimeRange date, TimeGroupingType groupingType, PoolKit poolKit) Load the committed capacity of a capacity planning scenario grouped by the specifiedTimeGroupingType.loadDemand(Long activityForecastHeader, List<Long> activityIds, DateTimeRange date, TimeGroupingType groupingType, LogHelper logHelper, PoolKit poolKit) Load the demand of the resource forecast header grouped by the specifiedTimeGroupingType.protected List<BOForecastResource> loadResources(BOCapacityPlanningScenario scenario, Collection<Long> resourceIds, Collection<Long> skills, PoolKit poolKit) Loads the resources of the given capacity planning scenario.protected voidmonthlyReport(List<Map<String, Object>> availableCapacity, List<Map<String, Object>> committedCapacity, List<Map<String, Object>> demand, Long month, Long year, CapacityPlanningScenarioCoverageTimeReportOutput output) Create a report for the given month.protected voidpopulateOutput(CapacityPlanningScenarioCoverageTimeReportOutput output, List<Map<String, Object>> availableCapacityFiltered, List<Map<String, Object>> committedCapacityFiltered, List<Map<String, Object>> demandFiltered) Populate the output with the data from the available and committed capacity.protected voidValidates the input parameters.protected voidweeklyReport(List<Map<String, Object>> availableCapacity, List<Map<String, Object>> committedCapacity, List<Map<String, Object>> demand, Long week, Long year, CapacityPlanningScenarioCoverageTimeReportOutput output) Create a report for the given week.Methods inherited from class overit.geocallapp.wfm.forecastcapacity.bl.capacityplanning.scenario.task.BTCapacityPlanningScenarioCoverageReport
filterActivitiesBySkills, filterResourcesBySkills, getDistributedWorkload, getForecastActivitiesDetails, getSourceTimeframes, isValidExecution, loadActivities, loadCapacityPlanningScenario, populateAvailableCapacityOutput, populateCommittedCapacityOutput, populateDemandOutput, searchSkills, timeframeToMapMethods 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
-
BTCapacityPlanningScenarioCoverageTimeReport
public BTCapacityPlanningScenarioCoverageTimeReport()
-
-
Method Details
-
execute
protected void execute(CapacityPlanningScenarioCoverageTimeReportEvent event, PoolKit poolKit) throws DAException, DAValidateException Calculate the coverage time for a capacity planning scenario.- Specified by:
executein classValidExecutionBusinessTask<CapacityPlanningScenarioCoverageTimeReportEvent>- Parameters:
event- theCapacityPlanningScenarioCoverageTimeReportEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validate
protected void validate(CapacityPlanningScenarioCoverageTimeReportFilter input) throws DAValidateException Validates the input parameters.- Throws:
DAValidateException
-
loadResources
protected List<BOForecastResource> loadResources(BOCapacityPlanningScenario scenario, Collection<Long> resourceIds, Collection<Long> skills, PoolKit poolKit) throws DAException, DAValidateException Loads the resources of the given capacity planning scenario.- Overrides:
loadResourcesin classBTCapacityPlanningScenarioCoverageReport<CapacityPlanningScenarioCoverageTimeReportEvent>- Parameters:
scenario- theBOCapacityPlanningScenarioresourceIds- the resource idsskills- the skillspoolKit- thePoolKit- Returns:
- the list of
BOForecastResource - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
loadAvailableCapacity
protected List<Map<String,Object>> loadAvailableCapacity(Long resourceForecastHeader, List<Long> resourceIds, DateTimeRange date, TimeGroupingType groupingType, PoolKit poolKit) throws DAException, DAValidateException Load the available capacity of a resource forecast detail grouped by the specifiedTimeGroupingType.- Parameters:
resourceForecastHeader- the resource forecast header idresourceIds- the list of resourcesdate- the filter dategroupingType- the grouping typepoolKit- thePoolKit- Returns:
- the list of available capacity
- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
loadCommittedCapacity
protected List<Map<String,Object>> loadCommittedCapacity(Long capacityPlanningScenarioId, List<Long> resourceIds, List<Long> activityIds, DateTimeRange date, TimeGroupingType groupingType, PoolKit poolKit) throws DAException, DAValidateException Load the committed capacity of a capacity planning scenario grouped by the specifiedTimeGroupingType.- Parameters:
capacityPlanningScenarioId- the capacity planning scenario idresourceIds- the list of resourcesactivityIds- the list of activitiesdate- the filter dategroupingType- the grouping typepoolKit- thePoolKit- Returns:
- the list of committed capacity
- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
loadDemand
protected List<Map<String,Object>> loadDemand(Long activityForecastHeader, List<Long> activityIds, DateTimeRange date, TimeGroupingType groupingType, LogHelper logHelper, PoolKit poolKit) throws DAException, DAValidateException Load the demand of the resource forecast header grouped by the specifiedTimeGroupingType.- Parameters:
activityForecastHeader- the resource forecast header idactivityIds- the list of activity idsdate- the filter date rangegroupingType- the grouping typepoolKit- thePoolKit- Returns:
- the list of demand
- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
formatCoverageTimeReport
protected List<CapacityPlanningScenarioCoverageTimeReportOutput> formatCoverageTimeReport(BOCapacityPlanningScenario scenario, List<Map<String, Object>> availableCapacity, List<Map<String, Object>> committedCapacity, List<Map<String, Object>> demand, TimeGroupingType groupingType, DateTimeRange date) Format the coverage time report.- Parameters:
scenario- the capacity planning scenarioavailableCapacity- the available capacitycommittedCapacity- the committed capacitydemand- the demandgroupingType- the grouping typedate-- Returns:
- the list of
CapacityPlanningScenarioCoverageTimeReportOutput
-
dailyReport
protected void dailyReport(List<Map<String, Object>> availableCapacity, List<Map<String, Object>> committedCapacity, List<Map<String, Object>> demand, Date day, CapacityPlanningScenarioCoverageTimeReportOutput output) Create a report for the given day.- Parameters:
availableCapacity- the list of available capacitycommittedCapacity- the list of committed capacityday- the dayoutput- theCapacityPlanningScenarioCoverageTimeReportOutput
-
weeklyReport
protected void weeklyReport(List<Map<String, Object>> availableCapacity, List<Map<String, Object>> committedCapacity, List<Map<String, Object>> demand, Long week, Long year, CapacityPlanningScenarioCoverageTimeReportOutput output) Create a report for the given week.- Parameters:
availableCapacity- the list of available capacitycommittedCapacity- the list of committed capacityweek- the weekyear- the yearoutput- theCapacityPlanningScenarioCoverageTimeReportOutput
-
monthlyReport
protected void monthlyReport(List<Map<String, Object>> availableCapacity, List<Map<String, Object>> committedCapacity, List<Map<String, Object>> demand, Long month, Long year, CapacityPlanningScenarioCoverageTimeReportOutput output) Create a report for the given month.- Parameters:
availableCapacity- the list of available capacitycommittedCapacity- the list of committed capacitymonth- the monthyear- the yearoutput- theCapacityPlanningScenarioCoverageTimeReportOutput
-
populateOutput
protected void populateOutput(CapacityPlanningScenarioCoverageTimeReportOutput output, List<Map<String, Object>> availableCapacityFiltered, List<Map<String, Object>> committedCapacityFiltered, List<Map<String, Object>> demandFiltered) Populate the output with the data from the available and committed capacity.- Parameters:
output- theCapacityPlanningScenarioCoverageTimeReportOutputavailableCapacityFiltered- the available capacity filtered by the periodcommittedCapacityFiltered- the committed capacity filtered by the period
-
adjustDateRangeForWeeklyGrouping
protected DateTimeRange adjustDateRangeForWeeklyGrouping(DateTimeRange dateRange, TimeGroupingType groupingType) throws DAValidateException Adjusts the date range for weekly grouping to ensure complete weeks. For weekly grouping, restricts the range to complete weeks: - Start date: if Monday keep it, otherwise move to next Monday - End date: if Sunday keep it, otherwise move to previous Sunday- Parameters:
dateRange- the original date rangegroupingType- the grouping type- Returns:
- the adjusted date range, or the original if not weekly grouping
- Throws:
DAValidateException
-