Class BTBundlingRuleHeaderValidate
java.lang.Object
overit.geocall.bl.BusinessTask<BundlingRuleHeaderValidateEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<BundlingRuleHeaderValidateEvent>
overit.geocallapp.wfm.bundler.bl.task.BTBundler<BundlingRuleHeaderValidateEvent>
overit.geocallapp.wfm.bundler.bl.configuration.bundling.rule.header.task.BTBundlingRuleHeaderValidate
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(BundlingRuleHeaderValidateEvent.class)
public class BTBundlingRuleHeaderValidate
extends BTBundler<BundlingRuleHeaderValidateEvent>
Business task in order to validate a
When the
BOBundlingRuleHeader. When the
BundlingRuleHeaderValidateEvent is launched the BT notices
the call and validates the BOBundlingRuleHeader basing on the event's
input. Error Code:
- Since:
- 11.0
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckMinAndMax(BOBundlingRuleHeader ruleHeader) Checks if the minimum and the maximum dimensions of theBundleare valid and that the maximum is not greater thanBOBundlingRuleHeader.DEFAULT_MAX_BUNDLE_SIZE.protected voidexecute(BundlingRuleHeaderValidateEvent event, PoolKit poolKit) Validates theBOBundlingRuleHeaderby checking: if its code and priority are unique if the minimum and the maximum bundle's dimensions are respected if at least one primary criterion is set if at least one of the execution type is set to trueprotected StringgetDefaultBundlingRuleCode(BOBundlingRuleHeader ruleHeader, PoolKit poolKit) Checks if there are anyBOBundlingRuleHeaderwith flag "isDefault" present and return its code.protected booleanisPriorityUnique(PoolKit poolKit, BOBundlingRuleHeader ruleHeader) Checks if the currentBOBundlingRuleHeaderhas a unique priority or not.protected booleanisRuleCodeUnique(BOBundlingRuleHeader ruleHeader, PoolKit poolKit) Checks if the currentBOBundlingRuleHeaderhas a unique code or not.protected voidvalidateRule(BOBundlingRuleHeader ruleHeader, PoolKit poolKit) Performs all the needed validation for theBOBundlingRuleHeader.Methods inherited from class overit.geocallapp.wfm.bundler.bl.task.BTBundler
getException, isValidExecution, throwExceptionIfInvalidMethods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask
body, checkValidExecution, getEventMethods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTBundlingRuleHeaderValidate
public BTBundlingRuleHeaderValidate()
-
-
Method Details
-
execute
protected void execute(BundlingRuleHeaderValidateEvent event, PoolKit poolKit) throws DAException, DAValidateException Validates theBOBundlingRuleHeaderby checking:- if its code and priority are unique
- if the minimum and the maximum bundle's dimensions are respected
- if at least one primary criterion is set
- if at least one of the execution type is set to true
- Specified by:
executein classValidExecutionBusinessTask<BundlingRuleHeaderValidateEvent>- Parameters:
event- theBundlingRuleHeaderValidateEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validateRule
protected void validateRule(BOBundlingRuleHeader ruleHeader, PoolKit poolKit) throws DAValidateException, DAException Performs all the needed validation for theBOBundlingRuleHeader.- Parameters:
ruleHeader- theBOBundlingRuleHeaderpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
checkMinAndMax
Checks if the minimum and the maximum dimensions of theBundleare valid and that the maximum is not greater thanBOBundlingRuleHeader.DEFAULT_MAX_BUNDLE_SIZE.- Parameters:
ruleHeader- theBOBundlingRuleHeader- Returns:
- true, if successful
- Throws:
DAValidateException- the DA validate exception
-
isRuleCodeUnique
protected boolean isRuleCodeUnique(BOBundlingRuleHeader ruleHeader, PoolKit poolKit) throws DAValidateException, DAException Checks if the currentBOBundlingRuleHeaderhas a unique code or not.- Parameters:
ruleHeader- the currentBOBundlingRuleHeaderpoolKit- thePoolKit- Returns:
- true, if rule code is unique
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
isPriorityUnique
protected boolean isPriorityUnique(PoolKit poolKit, BOBundlingRuleHeader ruleHeader) throws DAValidateException, DAException Checks if the currentBOBundlingRuleHeaderhas a unique priority or not.- Parameters:
poolKit- thePoolKitruleHeader- the currentBOBundlingRuleHeader- Returns:
- the page response which contains all the rules with the same priority
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getDefaultBundlingRuleCode
protected String getDefaultBundlingRuleCode(BOBundlingRuleHeader ruleHeader, PoolKit poolKit) throws DAValidateException, DAException Checks if there are anyBOBundlingRuleHeaderwith flag "isDefault" present and return its code.- Parameters:
ruleHeader- the currentBOBundlingRuleHeaderpoolKit- thePoolKit- Returns:
- the default bundling rule code if present
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-