All Implemented Interfaces:
Serializable, Tool, ValidExecution

Business task in order to search for a measuring element's next BOMeasure, according to the target date.

When the PreviousMeasureSearchEvent is launched the BT notices the call and searches for the BOMeasure according to the event's input.

Permissions:

Since:
20.0
See Also:
GCApi:
task
  • Constructor Details

    • BTNextMeasureSearch

      public BTNextMeasureSearch()
  • Method Details

    • execute

      protected void execute(NextMeasureSearchEvent event, PoolKit pk) throws DAException, DAValidateException
      Writes the measuring element's next measure into the event journal.
      Specified by:
      execute in class ValidExecutionBusinessTask<NextMeasureSearchEvent>
      Parameters:
      event - the NextMeasureSearchEvent
      pk - the PoolKit
      Throws:
      DAException - the DA exception
      DAValidateException - the DA validate exception
    • findNextChronologicalMeasure

      protected BOMeasure findNextChronologicalMeasure(NextMeasureSearchEventInput input, PoolKit pk) throws DAException, DAValidateException
      Finds the next chronological measure for a measuring element after a specified target date.

      This method searches for the earliest non-rejected measure that occurs after the target date provided in the input. It retrieves all measures for the specified measuring element and filters them to find the chronologically next valid measure in the sequence.

      The search process:

      • Filters measures by the specified measuring element ID
      • Restricts the search to measures taken after the target date
      • Excludes measures with REJECTED status
      • Orders results by measuring date in ascending order
      • Returns the first (most recent) result, or null if no measures are found

      This method is used to support measure sequence management, particularly when inserting or updating measures and needing to find subsequent measures that may require alignment.

      Parameters:
      input - the input containing the measuring element and target date for the search
      pk - the pool kit providing access to database connections and services
      Returns:
      the next chronological non-rejected measure after the target date, or null if none exists
      Throws:
      DAValidateException - if validation fails during the search process
      DAException - if a data access error occurs during the search process
    • isValidExecution

      public boolean isValidExecution()
      Description copied from interface: ValidExecution
      Determines whether the current state is valid for execution.
      Returns:
      true if execution is valid, false otherwise