Class BTNextMeasureSearch
java.lang.Object
overit.geocall.bl.BusinessTask<NextMeasureSearchEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<NextMeasureSearchEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<NextMeasureSearchEvent>
overit.geocallapp.wfm.measuringelements.bl.measuringelement.measure.task.BTNextMeasureSearch
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(NextMeasureSearchEvent.class)
public class BTNextMeasureSearch
extends ValidPermissionBusinessTask<NextMeasureSearchEvent>
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
-
Field Summary
Fields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidexecute(NextMeasureSearchEvent event, PoolKit pk) Writes the measuring element's next measure into the event journal.protected BOMeasureFinds the next chronological measure for a measuring element after a specified target date.booleanDetermines whether the current state is valid for execution.Methods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
checkValidExecution, getException, throwExceptionIfInvalidMethods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask
body, getEventMethods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
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:
executein classValidExecutionBusinessTask<NextMeasureSearchEvent>- Parameters:
event- theNextMeasureSearchEventpk- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- 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 searchpk- 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 processDAException- if a data access error occurs during the search process
-
isValidExecution
public boolean isValidExecution()Description copied from interface:ValidExecutionDetermines whether the current state is valid for execution.- Returns:
- true if execution is valid, false otherwise
-