Class BTCapacityPlanningSaturationCalculate
java.lang.Object
overit.geocall.bl.BusinessTask<CapacityPlanningSaturationCalculateEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<CapacityPlanningSaturationCalculateEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<CapacityPlanningSaturationCalculateEvent>
overit.geocallapp.wfm.forecastcapacity.bl.capacityplanning.coveragealgorithm.output.task.BTCapacityPlanningSaturationCalculate
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(CapacityPlanningSaturationCalculateEvent.class)
public class BTCapacityPlanningSaturationCalculate
extends ValidPermissionBusinessTask<CapacityPlanningSaturationCalculateEvent>
Business task to calculate the saturation of resources and assignment of activities.
This task calculates the saturation of resources and the assignment of activities
based on the assignments and the forecast details.
- Since:
- 20.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculateActivitiesAssignment(List<BOCapacityPlanningResultDetail> assignments, List<BOForecastActivityDetail> activityDetails) Calculates the assignment of activities based on the assignments and the activity details.calculateActivityAssignmentCategories(Map<Long, Double> activitiesAssignment) Calculates the activity assignment categories based on the assignment values.calculateResourceSaturationCategories(Map<Long, Double> resourcesSaturation) Calculates the resource saturation categories based on the saturation values.calculateResourcesSaturation(List<BOForecastResourceDetail> resourceDetails) Calculates the saturation of resources based on the resource details and assignments.protected BOCapacityPlanningResultcalculateTotalResult(BOCapacityPlanningResult result, List<BOCapacityPlanningResultDetail> assignments, List<BOForecastResourceDetail> resourceDetails, List<BOForecastActivityDetail> activityDetails, PoolKit poolKit) Calculates the total result using CapacityPlanningTotalResultCalculateEvent.protected voidexecute(CapacityPlanningSaturationCalculateEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected LongGets a Long value, returning 0 if the value is null.booleanDetermines whether the current state is valid for execution.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
-
LOG
-
-
Constructor Details
-
BTCapacityPlanningSaturationCalculate
public BTCapacityPlanningSaturationCalculate()
-
-
Method Details
-
execute
protected void execute(CapacityPlanningSaturationCalculateEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<CapacityPlanningSaturationCalculateEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
calculateTotalResult
protected BOCapacityPlanningResult calculateTotalResult(BOCapacityPlanningResult result, List<BOCapacityPlanningResultDetail> assignments, List<BOForecastResourceDetail> resourceDetails, List<BOForecastActivityDetail> activityDetails, PoolKit poolKit) throws DAException, DAValidateException Calculates the total result using CapacityPlanningTotalResultCalculateEvent.- Parameters:
result- the capacity planning resultassignments- the assignmentsresourceDetails- the resource detailsactivityDetails- the activity detailspoolKit- the pool kit- Returns:
- the updated capacity planning result
- Throws:
DAException- if a data access exception occursDAValidateException- if a data validation exception occurs
-
calculateResourcesSaturation
protected Map<Long,Double> calculateResourcesSaturation(List<BOForecastResourceDetail> resourceDetails) Calculates the saturation of resources based on the resource details and assignments.- Parameters:
resourceDetails- the resource details- Returns:
- a map of resource ID to saturation value
-
getLong
Gets a Long value, returning 0 if the value is null.- Parameters:
value- the value to check- Returns:
- the value, or 0 if the value is null
-
calculateActivitiesAssignment
protected Map<Long,Double> calculateActivitiesAssignment(List<BOCapacityPlanningResultDetail> assignments, List<BOForecastActivityDetail> activityDetails) Calculates the assignment of activities based on the assignments and the activity details.- Parameters:
assignments- the assignmentsactivityDetails- the activity details- Returns:
- a map of activity ID to assignment value
-
calculateResourceSaturationCategories
protected Map<String,Long> calculateResourceSaturationCategories(Map<Long, Double> resourcesSaturation) Calculates the resource saturation categories based on the saturation values.- Parameters:
resourcesSaturation- the map of resource ID to saturation value- Returns:
- a map of category to count
-
calculateActivityAssignmentCategories
protected Map<String,Long> calculateActivityAssignmentCategories(Map<Long, Double> activitiesAssignment) Calculates the activity assignment categories based on the assignment values.- Parameters:
activitiesAssignment- the map of activity ID to assignment value- Returns:
- a map of category to count
-
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
-