Class AbstractPostUpdateCustomizer

java.lang.Object
com.kingsrook.qqq.backend.core.actions.customizers.AbstractPostUpdateCustomizer
All Implemented Interfaces:
TableCustomizerInterface
Direct Known Subclasses:
HelpContentPostUpdateCustomizer

public abstract class AbstractPostUpdateCustomizer extends Object implements TableCustomizerInterface
Abstract class that a table can specify an implementation of, to provide custom actions after an update takes place. General implementation would be, to iterate over the records (the outputs of the update action), and look at their values: - possibly adding Errors (`addError`) or Warnings (`addWarning`) to the records? - possibly throwing an exception - though doing so won't stop the update, and instead will just set a warning on all of the updated records... - doing "whatever else" you may want to do. - returning the list of records (can be the input list) that you want to go back to the caller. Note that the full updateInput is available as a field in this class, and the "old records" (e.g., with values freshly fetched from the backend) will be available (if the backend supports it) - both as a list (`getOldRecordList`) and as a memoized (by this class) map of primaryKey to record (`getOldRecordMap`).
  • Field Details

  • Constructor Details

    • AbstractPostUpdateCustomizer

      public AbstractPostUpdateCustomizer()
  • Method Details

    • postUpdate

      public List<QRecord> postUpdate(UpdateInput updateInput, List<QRecord> records, Optional<List<QRecord>> oldRecordList) throws QException
      Description copied from interface: TableCustomizerInterface
      custom actions after an update takes place. General implementation would be, to iterate over the records (the outputs of the update action), and look at their values: - possibly adding Errors (`addError`) or Warnings (`addWarning`) to the records? - possibly throwing an exception - though doing so won't stop the update, and instead will just set a warning on all of the updated records... - doing "whatever else" you may want to do. - returning the list of records (can be the input list) that you want to go back to the caller. Note, "old records" (e.g., with values freshly fetched from the backend) will be available (if the backend supports it).
      Specified by:
      postUpdate in interface TableCustomizerInterface
      Throws:
      QException
    • apply

      public abstract List<QRecord> apply(List<QRecord> records) throws QException
      Throws:
      QException
    • getUpdateInput

      public UpdateInput getUpdateInput()
      Getter for updateInput
    • setUpdateInput

      public void setUpdateInput(UpdateInput updateInput)
      Setter for updateInput
    • setOldRecordList

      public void setOldRecordList(List<QRecord> oldRecordList)
    • getOldRecordList

      public List<QRecord> getOldRecordList()
    • getOldRecordMap

      protected Map<Serializable,QRecord> getOldRecordMap()