Class BTDataCollectionSheetInstanceLock
java.lang.Object
overit.geocall.bl.BusinessTask<DataCollectionSheetInstanceLockEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<DataCollectionSheetInstanceLockEvent>
overit.geocallapp.wfm.mobileforms.bl.task.BTDataCollection<DataCollectionSheetInstanceLockEvent>
overit.geocallapp.wfm.mobileforms.bl.instance.task.BTDataCollectionSheetInstanceLock
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(DataCollectionSheetInstanceLockEvent.class)
public class BTDataCollectionSheetInstanceLock
extends BTDataCollection<DataCollectionSheetInstanceLockEvent>
Business task for locking data collection sheet instances by closing work order operation sheets.
This task handles the locking of data collection sheets that are associated with work order
operations. It processes DataCollectionSheetInstanceLockEvent events and performs
validation before closing the sheet to lock it.
- Since:
- 22.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckFixed(BODataCollectionSheet sheet) Validates that the sheet is in fixed state.protected voidValidates that the sheet is associated with a work order operation.protected voidcheckScope(BODataCollectionSheet sheet) Validates that the sheet scope is associated with work order operations.protected voidcheckSheet(BODataCollectionSheet sheet) Performs validation checks on the sheet before locking.protected voidcloseSheet(BODataCollectionSheet sheet, PoolKit poolKit) Closes the data collection sheet to lock it.protected voidexecute(DataCollectionSheetInstanceLockEvent event, PoolKit poolKit) Executes the data collection sheet locking process.protected BODataCollectionSheetLoads a data collection sheet by its ID.Methods inherited from class overit.geocallapp.wfm.mobileforms.bl.task.BTDataCollection
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
-
BTDataCollectionSheetInstanceLock
public BTDataCollectionSheetInstanceLock()
-
-
Method Details
-
execute
protected void execute(DataCollectionSheetInstanceLockEvent event, PoolKit poolKit) throws DAException, DAValidateException Executes the data collection sheet locking process.- Specified by:
executein classValidExecutionBusinessTask<DataCollectionSheetInstanceLockEvent>- Parameters:
event- the lock event containing the sheet ID to be lockedpoolKit- the database connection pool kit for database operations- Throws:
DAException- if a database error occurs during the locking processDAValidateException- if the sheet fails any validation checks
-
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
-
checkSheet
Performs validation checks on the sheet before locking.- Parameters:
sheet- the data collection sheet to validate- Throws:
DAValidateException- if any validation check fails
-
closeSheet
protected void closeSheet(BODataCollectionSheet sheet, PoolKit poolKit) throws DAValidateException, DAException Closes the data collection sheet to lock it.- Parameters:
sheet- the data collection sheet to closepoolKit- the database connection pool kit for database operations- Throws:
DAValidateException- if the sheet cannot be closedDAException- if a database error occurs during closing
-
checkFixed
Validates that the sheet is in fixed state.- Parameters:
sheet- the data collection sheet to validate- Throws:
DAValidateException- if the sheet is not in fixed state (error code: DATACOLLECTION_SHEET_MUST_BE_IN_FIXED_STATE)
-
checkScope
Validates that the sheet scope is associated with work order operations.- Parameters:
sheet- the data collection sheet to validate- Throws:
DAValidateException- if the sheet scope is not operation-related (error code: DATACOLLECTION_SHEET_SCOPE_NOT_OPERATION)
-
checkOperation
Validates that the sheet is associated with a work order operation.- Parameters:
sheet- the data collection sheet to validate- Throws:
DAValidateException- if the sheet is not associated with a work order operation (error code: DATACOLLECTION_SHEET_NOT_ASSOCIATED_TO_WO_OPERATION)
-