Class BTWorkOrderHeaderHistory

java.lang.Object
overit.geocall.bl.BusinessTask<Void>
overit.geocallapp.utilities.core.bl.common.task.BTHistory
overit.geocallapp.wfm.workorders.bl.header.task.BTWorkOrderHeaderHistory
All Implemented Interfaces:
Serializable, Tool

public class BTWorkOrderHeaderHistory extends BTHistory
Business task in order to save a history of BOWorkOrderHeader.
Since:
16.0
See Also:
GCApi:
task
  • Constructor Details

    • BTWorkOrderHeaderHistory

      public BTWorkOrderHeaderHistory()
  • Method Details

    • getBTDescription

      protected String getBTDescription()
      Description copied from class: BTHistory
      Returns a descriptive name for this history task. This name is used for logging purposes to identify the specific history task being executed.
      Specified by:
      getBTDescription in class BTHistory
      Returns:
      a string describing the task
    • initializeDAO

      protected void initializeDAO()
      Description copied from class: BTHistory
      Initializes 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:
      initializeDAO in class BTHistory
    • getEntityTablePrefix

      protected String getEntityTablePrefix()
      Description copied from class: BTHistory
      Returns the prefix used in field names of the entity table.
      Specified by:
      getEntityTablePrefix in class BTHistory
      Returns:
      the prefix string used in field names of the entity table
    • getHistoryTablePrefix

      protected String getHistoryTablePrefix()
      Description copied from class: BTHistory
      Returns the prefix used in field names of the history table.
      Specified by:
      getHistoryTablePrefix in class BTHistory
      Returns:
      the prefix string used in field names of the history table
    • getHistoryDateField

      protected String getHistoryDateField()
      Description copied from class: BTHistory
      Returns the name of the field in the history table that stores the creation date.
      Specified by:
      getHistoryDateField in class BTHistory
      Returns:
      the name of the date field in the history table
    • getHistoryField

      protected String getHistoryField()
      Description copied from class: BTHistory
      Returns the name of the field in the entity table that references the history table.
      Specified by:
      getHistoryField in class BTHistory
      Returns:
      the name of the field in the entity table that references the history table
    • getForeignHistoryField

      protected String getForeignHistoryField()
      Description copied from class: BTHistory
      Returns the name of the field in the history table that references the previous history record.
      Specified by:
      getForeignHistoryField in class BTHistory
      Returns:
      the name of the field in the history table that references the previous history record
    • getHistoryForeignField

      protected String getHistoryForeignField()
      Description copied from class: BTHistory
      Returns the name of the field in the history table that references the entity table.
      Specified by:
      getHistoryForeignField in class BTHistory
      Returns:
      the name of the field in the history table that references the entity table
    • getHistoryOperationField

      protected String getHistoryOperationField()
      Description copied from class: BTHistory
      Returns the name of the field in the history table that stores the operation code.
      Specified by:
      getHistoryOperationField in class BTHistory
      Returns:
      the name of the operation code field in the history table
    • getStackTraceField

      protected String getStackTraceField()
      Description copied from class: BTHistory
      Returns the name of the field in the history table that stores stack trace information. By default, this method returns null, indicating that stack trace recording is not enabled. Subclasses can override this method to enable stack trace recording.
      Overrides:
      getStackTraceField in class BTHistory
      Returns:
      the name of the stack trace field in the history table, or null if stack trace recording is not enabled
    • traceCurrentStack

      protected boolean traceCurrentStack()
      Description copied from class: BTHistory
      Determines whether to record the current stack trace in the history record. By default, this method returns false, indicating that stack trace recording is not enabled. Subclasses can override this method to enable stack trace recording based on specific conditions.
      Overrides:
      traceCurrentStack in class BTHistory
      Returns:
      true if the current stack trace should be recorded, false otherwise
    • customizeChangedFields

      protected HashGetter customizeChangedFields(List<String> changedHistoryFields)
      Description copied from class: BTHistory
      Hook 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:
      customizeChangedFields in class BTHistory
      Parameters:
      changedHistoryFields - the list of field names that have changed
      Returns:
      a HashGetter containing custom values to add to the history record
    • getExcludedHistoryFieldsFromComparison

      protected List<String> getExcludedHistoryFieldsFromComparison()
      Description copied from class: BTHistory
      Returns a list of history table fields to exclude from change detection. This method builds a list of fields that should be ignored when comparing history records to determine if changes have occurred. These include:
      • Standard audit fields (DELETED, INSERTED, UPDATED)
      • Primary key fields of the history table
      • Foreign key to the previous history record
      • Operation code field
      • Date field
      Overrides:
      getExcludedHistoryFieldsFromComparison in class BTHistory
      Returns:
      a list of field names to exclude from history record comparisons
    • translateFields

      protected HashGetter translateFields(Map<String,Object> hgValues)
      Description copied from class: BTHistory
      Translates 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:
      translateFields in class BTHistory
      Parameters:
      hgValues - the entity data to translate
      Returns:
      a new HashGetter containing the translated values for the history record
    • writeHistoryRecord

      protected void writeHistoryRecord(Map<String,Object> currentValues, HashGetter previousHistoryRecord, PoolKit pk) throws DAValidateException, DAException
      Description copied from class: BTHistory
      Writes a new history record to the history table. This method performs the actual insertion of a history record based on the current entity values and, optionally, the previous history record. It:
      • Translates entity field values to history field values
      • Identifies changed fields if a previous history record exists
      • Adds stack trace information if enabled
      • Inserts the new history record
      • Updates the entity record to reference the new history record
      Overrides:
      writeHistoryRecord in class BTHistory
      Parameters:
      currentValues - the current entity values
      previousHistoryRecord - the previous history record, or null if none exists
      pk - the PoolKit
      Throws:
      DAValidateException - if validation fails during record insertion
      DAException - if a data access error occurs during record insertion