Class BTDataCollectionTemplateVisibilityRuleDelete
java.lang.Object
overit.geocall.bl.BusinessTask<DataCollectionTemplateVisibilityRuleDeleteEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<DataCollectionTemplateVisibilityRuleDeleteEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<DataCollectionTemplateVisibilityRuleDeleteEvent>
overit.geocallapp.wfm.mobileforms.bl.template.visibilityrules.task.BTDataCollectionTemplateVisibilityRuleDelete
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(DataCollectionTemplateVisibilityRuleDeleteEvent.class)
public class BTDataCollectionTemplateVisibilityRuleDelete
extends ValidPermissionBusinessTask<DataCollectionTemplateVisibilityRuleDeleteEvent>
Business task for deleting a template visibility rule with all its associated rows.
When the DataCollectionTemplateVisibilityRuleDeleteEvent is launched, this task:
- Searches for all rows associated with the rule header
- Deletes each row using
DCTemplateVisibilityRuleRowDeleteEvent - Deletes the header using
DCTemplateVisibilityRuleHeaderDeleteEvent
Permission:
- Since:
- 22.0
- See Also:
- GCApi:
- task
-
Field Summary
FieldsFields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddeleteAssociatedRows(Long ruleHeaderId, PoolKit poolKit) Deletes all rows associated with the given rule header.protected voiddeleteHeader(Long ruleHeaderId, PoolKit poolKit) Deletes the rule header.protected voidexecute(DataCollectionTemplateVisibilityRuleDeleteEvent event, PoolKit poolKit) Executes the deletion of a template visibility rule with all its rows.booleanDetermines whether the current state is valid for execution.protected List<BODCTemplateVisibilityRuleRow> searchRows(Long ruleHeaderId, PoolKit poolKit) Searches for all rows associated with the given rule header.protected voidValidates the input.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
-
ruleHeader
-
-
Constructor Details
-
BTDataCollectionTemplateVisibilityRuleDelete
public BTDataCollectionTemplateVisibilityRuleDelete()
-
-
Method Details
-
execute
protected void execute(DataCollectionTemplateVisibilityRuleDeleteEvent event, PoolKit poolKit) throws DAException, DAValidateException Executes the deletion of a template visibility rule with all its rows.- Specified by:
executein classValidExecutionBusinessTask<DataCollectionTemplateVisibilityRuleDeleteEvent>- Parameters:
event- the delete event containing the ID of the rule header to deletepoolKit- the pool kit for database operations- Throws:
DAException- if a database access error occursDAValidateException- if validation fails
-
validate
Validates the input.- Parameters:
ruleHeaderId- the rule header id- Throws:
DAValidateException- if validation failsDAException
-
deleteAssociatedRows
protected void deleteAssociatedRows(Long ruleHeaderId, PoolKit poolKit) throws DAException, DAValidateException Deletes all rows associated with the given rule header.- Parameters:
ruleHeaderId- the rule header idpoolKit- the pool kit for database operations- Throws:
DAException- if a database access error occursDAValidateException- if validation fails
-
searchRows
protected List<BODCTemplateVisibilityRuleRow> searchRows(Long ruleHeaderId, PoolKit poolKit) throws DAException, DAValidateException Searches for all rows associated with the given rule header.- Parameters:
ruleHeaderId- the rule header idpoolKit- the pool kit for database operations- Returns:
- the list of rows
- Throws:
DAException- if a database access error occursDAValidateException
-
deleteHeader
protected void deleteHeader(Long ruleHeaderId, PoolKit poolKit) throws DAException, DAValidateException Deletes the rule header.- Parameters:
ruleHeaderId- the rule header idpoolKit- the pool kit for database operations- 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
-