Class BTAggregateBundleRequirementsLoad
java.lang.Object
overit.geocall.bl.BusinessTask<AggregateBundleRequirementsLoadEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<AggregateBundleRequirementsLoadEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<AggregateBundleRequirementsLoadEvent>
overit.geocallapp.wfm.bundler.bl.bundleRequirement.task.BTAggregateBundleRequirementsLoad
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(AggregateBundleRequirementsLoadEvent.class)
public class BTAggregateBundleRequirementsLoad
extends ValidPermissionBusinessTask<AggregateBundleRequirementsLoadEvent>
Business task to load aggregated bundle requirements for multiple bundles.
This task loads all requirements for the specified bundles and
aggregates them by bundle ID and requirement type (mandatory, preferred, excluded).
The task processes requirements for both resources and teams, grouping them by type:
- Mandatory resources and teams that must be assigned
- Preferred resources that should be assigned when possible
- Excluded resources and teams that must not be assigned
- Since:
- 22.0
- See Also:
- GCApi:
- task
-
Field Summary
Fields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<AggregateBundleRequirement> aggregateRequirements(List<BOBundleRequirement> requirements, Collection<Long> bundleIds) Aggregates requirements by bundle ID, grouping resources and teams by type.protected voidexecute(AggregateBundleRequirementsLoadEvent event, PoolKit poolKit) Executes the task to load and aggregate bundle requirements.protected voidfillBundlerRequirements(List<BOBundleRequirement> bundleRequirements, AggregateBundleRequirement aggregate) Fills the aggregated requirement with the given list of requirements.booleanDetermines whether the current state is valid for execution.protected List<BOBundleRequirement> loadRequirements(PoolKit poolKit, BundleRequirementSearchFilter filter) Loads requirements based on the given filter.protected booleanValidates the input and returns true if there are no bundles to process.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
-
Constructor Details
-
BTAggregateBundleRequirementsLoad
public BTAggregateBundleRequirementsLoad()
-
-
Method Details
-
execute
protected void execute(AggregateBundleRequirementsLoadEvent event, PoolKit poolKit) throws DAException, DAValidateException Executes the task to load and aggregate bundle requirements.- Specified by:
executein classValidExecutionBusinessTask<AggregateBundleRequirementsLoadEvent>- Parameters:
event- theAggregateBundleRequirementsLoadEventcontaining the input datapoolKit- thePoolKitfor database operations- Throws:
DAException- if a database error occursDAValidateException- if validation fails
-
loadRequirements
protected List<BOBundleRequirement> loadRequirements(PoolKit poolKit, BundleRequirementSearchFilter filter) throws DAValidateException, DAException Loads requirements based on the given filter.- Parameters:
poolKit- thePoolKitfor database operationsfilter- theBundleRequirementSearchFiltercontaining search criteria- Returns:
- the list of
BOBundleRequirementmatching the filter - Throws:
DAValidateException- if validation failsDAException- if a database error occurs
-
validate
protected boolean validate(AggregateBundleRequirementsLoadEvent event, AggregateBundleRequirementsLoadInput input) Validates the input and returns true if there are no bundles to process.- Parameters:
event- theAggregateBundleRequirementsLoadEventcontaining the event datainput- theAggregateBundleRequirementsLoadInputcontaining the input data- Returns:
- true if there are no bundles to process
-
aggregateRequirements
protected Collection<AggregateBundleRequirement> aggregateRequirements(List<BOBundleRequirement> requirements, Collection<Long> bundleIds) Aggregates requirements by bundle ID, grouping resources and teams by type.- Parameters:
requirements- the list of requirements from the databasebundleIds- the bundle IDs to process- Returns:
- collection of aggregated requirements
-
fillBundlerRequirements
protected void fillBundlerRequirements(List<BOBundleRequirement> bundleRequirements, AggregateBundleRequirement aggregate) Fills the aggregated requirement with the given list of requirements.- Parameters:
bundleRequirements- the list of requirements for a specific bundleaggregate- the aggregated requirement to fill
-
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
-