Class BTDCTemplateVisibilityRuleRowInsert
java.lang.Object
overit.geocall.bl.BusinessTask<DCTemplateVisibilityRuleRowInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<DCTemplateVisibilityRuleRowInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<DCTemplateVisibilityRuleRowInsertEvent>
overit.geocallapp.wfm.mobileforms.bl.template.visibilityrules.rows.task.BTDCTemplateVisibilityRuleRowInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(DCTemplateVisibilityRuleRowInsertEvent.class)
public class BTDCTemplateVisibilityRuleRowInsert
extends ValidPermissionBusinessTask<DCTemplateVisibilityRuleRowInsertEvent>
Business task to insert a
BODCTemplateVisibilityRuleRow.
Validates that:
- Rule header is not null and exists
- Exactly one visibility association is defined (userType, operationCenter, structure, or area)
- No duplicate configuration exists for the same rule header
Permission:
- 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 voidexecute(DCTemplateVisibilityRuleRowInsertEvent event, PoolKit poolKit) Inserts the givenBODCTemplateVisibilityRuleRowand writes the newly generated id into the event journal.booleanDetermines whether the current state is valid for execution.protected voidvalidate(BODCTemplateVisibilityRuleRow visibilityRuleRow, PoolKit poolKit) Validates the input data for the data collection visibility rule row before inserting.protected voidvalidateExactlyOneNotNull(Object... values) Validates that exactly one of the given values is not null.protected voidvalidateOrganizationalStructuresSelection(BODCTemplateVisibilityRuleRow visibilityRuleRow, PoolKit poolKit) Validates that there isn't configurations for different organizational structures in the same ruleprotected voidvalidateRuleHeader(BODCTemplateVisibilityRuleRow visibilityRuleRow, PoolKit poolKit) Validates that the rule header is not null and exists.protected voidvalidateUniqueConfiguration(BODCTemplateVisibilityRuleRow visibilityRuleRow, PoolKit poolKit) Validates that the given configuration does not already exist.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
-
BTDCTemplateVisibilityRuleRowInsert
public BTDCTemplateVisibilityRuleRowInsert()
-
-
Method Details
-
execute
protected void execute(DCTemplateVisibilityRuleRowInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Inserts the givenBODCTemplateVisibilityRuleRowand writes the newly generated id into the event journal.- Specified by:
executein classValidExecutionBusinessTask<DCTemplateVisibilityRuleRowInsertEvent>- Parameters:
event- theDCTemplateVisibilityRuleRowInsertEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validate
protected void validate(BODCTemplateVisibilityRuleRow visibilityRuleRow, PoolKit poolKit) throws DAValidateException, DAException Validates the input data for the data collection visibility rule row before inserting.Validates that:
- Rule header is not null and exists
- Exactly one visibility association is defined (userType, operationCenter, structure, or area)
- No duplicate configuration exists for the same rule header
- Parameters:
visibilityRuleRow- theBODCTemplateVisibilityRuleRowto validatepoolKit- thePoolKitfor database operations- Throws:
DAValidateException- if validation fails (e.g., missing required multilanguage values or null model)DAException- if a database access error occurs during validation
-
validateRuleHeader
protected void validateRuleHeader(BODCTemplateVisibilityRuleRow visibilityRuleRow, PoolKit poolKit) throws DAValidateException, DAException Validates that the rule header is not null and exists.- Parameters:
visibilityRuleRow- theBODCTemplateVisibilityRuleRowto validatepoolKit- thePoolKitfor database operations- Throws:
DAValidateException- if validation fails (e.g., missing required multilanguage values or null model)DAException- if a database access error occurs during validation
-
validateExactlyOneNotNull
Validates that exactly one of the given values is not null.- Parameters:
values- the values to validate- Throws:
DAValidateException- if validation fails
-
validateUniqueConfiguration
protected void validateUniqueConfiguration(BODCTemplateVisibilityRuleRow visibilityRuleRow, PoolKit poolKit) throws DAException, DAValidateException Validates that the given configuration does not already exist.- Parameters:
visibilityRuleRow- theBODCTemplateVisibilityRuleRowto validatepoolKit- thePoolKit- Throws:
DAException- if a database access error occursDAValidateException- if validation fails
-
validateOrganizationalStructuresSelection
protected void validateOrganizationalStructuresSelection(BODCTemplateVisibilityRuleRow visibilityRuleRow, PoolKit poolKit) throws DAException, DAValidateException Validates that there isn't configurations for different organizational structures in the same rule- Parameters:
visibilityRuleRow- theBODCTemplateVisibilityRuleRowto validatepoolKit- thePoolKit- Throws:
DAException- if a database access error occursDAValidateException- if validation fails
-
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
-