Class BTWorkOrderOperationHistory
java.lang.Object
overit.geocall.bl.BusinessTask<Void>
overit.geocallapp.utilities.core.bl.common.task.BTHistory
overit.geocallapp.wfm.workorders.bl.operation.task.BTWorkOrderOperationHistory
- All Implemented Interfaces:
Serializable,Tool
Business task in order to save a history of
BOWorkOrderOperation. - See Also:
- GCApi:
- task
-
Field Summary
Fields inherited from class overit.geocallapp.utilities.core.bl.common.task.BTHistory
currentDBValues, dao, daoHistory, elaboratedRows, filters, HISTORY_CACHE_NAME, HISTORY_TABLE_TRANSLATE_FIELD_CACHE, historyFieldsMap, historyWritten, LOG, newHistoryRecordId, operationCode, operationMode, operationType, TYPE_COMMAND_AND_HISTORY, TYPE_ONLY_HISTORY, validModes, values -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected HashGettercustomizeChangedFields(List<String> changedHistoryFields) Hook method for customizing history record values based on changed fields.protected voidHook method for customizing the field mapping between entity and history tables.protected StringReturns a descriptive name for this history task.protected StringReturns the prefix used in field names of the entity table.protected StringReturns the name of the field in the history table that references the previous history record.protected StringReturns the name of the field in the history table that stores the creation date.protected StringReturns the name of the field in the entity table that references the history table.protected StringReturns the name of the field in the history table that references the entity table.protected StringReturns the name of the field in the history table that stores the operation code.protected StringReturns the prefix used in field names of the history table.protected StringReturns the name of the field in the history table that stores the user ID.protected voidInitializes the DAOs used by this history task.protected HashGettertranslateFields(Map<String, Object> values) Translates entity field values to their corresponding history field values.Methods inherited from class overit.geocallapp.utilities.core.bl.common.task.BTHistory
applyCommand, body, buildMap, createHistoryRecord, getChangedFields, getCustomFieldsToExclude, getElaboratedRows, getExcludedHistoryFieldsFromComparison, getFieldsToExclude, getHistoryRecordId, getHistorySequenceField, getHistoryTableField, getOperationCodeValue, getStackTraceField, getStackTraceString, getValidOperationModes, insertHistoryRecord, isDelete, isHistoryWritten, isInsert, isUpdate, loadCurrentDBData, loadPreviousHistoryRecord, loadTranslatedFieldMap, postElaboration, preElaboration, setCommandAndHistoryParams, setHistoryParams, traceCurrentStack, validateParams, writeHistoryRecordMethods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTWorkOrderOperationHistory
public BTWorkOrderOperationHistory()
-
-
Method Details
-
getBTDescription
Description copied from class:BTHistoryReturns a descriptive name for this history task. This name is used for logging purposes to identify the specific history task being executed.- Specified by:
getBTDescriptionin classBTHistory- Returns:
- a string describing the task
-
initializeDAO
protected void initializeDAO()Description copied from class:BTHistoryInitializes the DAOs used by this history task. Implementations must set:- dao: for entity table operations (insert/update/delete)
- daoHistory: for history table operations
- Specified by:
initializeDAOin classBTHistory
-
getEntityTablePrefix
Description copied from class:BTHistoryReturns the prefix used in field names of the entity table.- Specified by:
getEntityTablePrefixin classBTHistory- Returns:
- the prefix string used in field names of the entity table
-
getHistoryTablePrefix
Description copied from class:BTHistoryReturns the prefix used in field names of the history table.- Specified by:
getHistoryTablePrefixin classBTHistory- Returns:
- the prefix string used in field names of the history table
-
getHistoryDateField
Description copied from class:BTHistoryReturns the name of the field in the history table that stores the creation date.- Specified by:
getHistoryDateFieldin classBTHistory- Returns:
- the name of the date field in the history table
-
getHistoryField
Description copied from class:BTHistoryReturns the name of the field in the entity table that references the history table.- Specified by:
getHistoryFieldin classBTHistory- Returns:
- the name of the field in the entity table that references the history table
-
getForeignHistoryField
Description copied from class:BTHistoryReturns the name of the field in the history table that references the previous history record.- Specified by:
getForeignHistoryFieldin classBTHistory- Returns:
- the name of the field in the history table that references the previous history record
-
getHistoryForeignField
Description copied from class:BTHistoryReturns the name of the field in the history table that references the entity table.- Specified by:
getHistoryForeignFieldin classBTHistory- Returns:
- the name of the field in the history table that references the entity table
-
getHistoryOperationField
Description copied from class:BTHistoryReturns the name of the field in the history table that stores the operation code.- Specified by:
getHistoryOperationFieldin classBTHistory- Returns:
- the name of the operation code field in the history table
-
getHistoryUserField
Description copied from class:BTHistoryReturns the name of the field in the history table that stores the user ID.- Overrides:
getHistoryUserFieldin classBTHistory- Returns:
- the name of the user ID field in the history table, or null if user tracking is not enabled
-
customizeChangedFields
Description copied from class:BTHistoryHook method for customizing history record values based on changed fields. This method is called before inserting a new history record when a previous history record exists.- Overrides:
customizeChangedFieldsin classBTHistory- Parameters:
changedHistoryFields- the list of field names that have changed- Returns:
- a HashGetter containing custom values to add to the history record
-
translateFields
Description copied from class:BTHistoryTranslates entity field values to their corresponding history field values. This method applies the field mapping to convert entity data into the format required for the history table. It:- Maps entity field names to history field names using the translation map
- Adds the foreign key reference to the entity record
- Sets the operation code (INSERT/UPDATE/DELETE)
- Sets the timestamp for the history record
- Sets the user ID if user tracking is enabled
- Overrides:
translateFieldsin classBTHistory- Parameters:
values- the entity data to translate- Returns:
- a new
HashGettercontaining the translated values for the history record
-
customizeFieldMap
Description copied from class:BTHistoryHook method for customizing the field mapping between entity and history tables. This method provides a customization point for subclasses to modify the automatically generated field mapping. Subclasses can override this method to:- Add mappings for fields that don't follow standard naming conventions
- Remove mappings that should not be included in history records
- Modify existing mappings to handle special cases
- Overrides:
customizeFieldMapin classBTHistory- Parameters:
map- the translation map from entity fields to history fields to be customized
-