Class BTDataCollectionSheetInstanceUnlock
java.lang.Object
overit.geocall.bl.BusinessTask<DataCollectionSheetInstanceUnlockEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<DataCollectionSheetInstanceUnlockEvent>
overit.geocallapp.wfm.mobileforms.bl.task.BTDataCollection<DataCollectionSheetInstanceUnlockEvent>
overit.geocallapp.wfm.mobileforms.bl.instance.task.BTDataCollectionSheetInstanceUnlock
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(DataCollectionSheetInstanceUnlockEvent.class)
public class BTDataCollectionSheetInstanceUnlock
extends BTDataCollection<DataCollectionSheetInstanceUnlockEvent>
Business task for unlocking data collection sheet instances.
This task handles the unlocking (fixing) of data collection sheets that have been
requested for unlocking. It processes DataCollectionSheetInstanceUnlockEvent events
and performs comprehensive validation before fixing the sheet and resetting its unlock status.
- Since:
- 22.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckSheet(Long sheetId, PoolKit poolKit) Validates that the sheet meets all requirements for unlocking.protected voidexecute(DataCollectionSheetInstanceUnlockEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected voidFixes the sheet by launching a fix event.booleanDetermines whether this task can be executed based on user permissions.protected BODataCollectionSheetLoads a data collection sheet by its ID.protected voidresetUnlockSheet(Long sheetId, PoolKit poolKit) Resets the unlock request flag on the sheet to false.protected voidsendPushNotification(Long sheetId, PoolKit poolKit) Sends a push notification to the user about the sheet unlock.Methods inherited from class overit.geocallapp.wfm.mobileforms.bl.task.BTDataCollection
getException, 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
-
BTDataCollectionSheetInstanceUnlock
public BTDataCollectionSheetInstanceUnlock()
-
-
Method Details
-
execute
protected void execute(DataCollectionSheetInstanceUnlockEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<DataCollectionSheetInstanceUnlockEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
checkSheet
Validates that the sheet meets all requirements for unlocking. Launches an unlock check event and throws an exception if validation fails.- Parameters:
sheetId- the id of the data collection sheet to validatepoolKit- the database connection pool kit for database operations- Throws:
DAValidateException- if the sheet fails validation checksDAException- if a database error occurs during validation
-
fixSheet
Fixes the sheet by launching a fix event.- Parameters:
sheetId- the ID of the sheet to fixpoolKit- the database connection pool kit for database operations- Throws:
DAValidateException- if validation failsDAException- if a database error occurs
-
resetUnlockSheet
protected void resetUnlockSheet(Long sheetId, PoolKit poolKit) throws DAValidateException, DAException Resets the unlock request flag on the sheet to false.- Parameters:
sheetId- the ID of the sheet to resetpoolKit- the database connection pool kit for database operations- Throws:
DAValidateException- if validation failsDAException- if a database error occurs
-
sendPushNotification
protected void sendPushNotification(Long sheetId, PoolKit poolKit) throws DAException, DAValidateException Sends a push notification to the user about the sheet unlock.- Parameters:
sheetId- the ID of the unlocked sheetpoolKit- the database connection pool kit for database operations- Throws:
DAException- if a database error occursDAValidateException- if validation fails
-
loadSheet
protected BODataCollectionSheet loadSheet(Long sheetId, PoolKit poolKit) throws DAValidateException, DAException Loads a data collection sheet by its ID.- Parameters:
sheetId- the unique identifier of the sheet to loadpoolKit- the database connection pool kit for database operations- Returns:
- the loaded data collection sheet
- Throws:
DAValidateException- if the sheet ID is invalid or sheet not foundDAException- if a database error occurs during loading
-
isValidExecution
public boolean isValidExecution()Determines whether this task can be executed based on user permissions.- Specified by:
isValidExecutionin interfaceValidExecution- Overrides:
isValidExecutionin classBTDataCollection<DataCollectionSheetInstanceUnlockEvent>- Returns:
trueif the current user has permission to unlock sheets,falseotherwise
-