Class BTPreviousMeasureSearch
java.lang.Object
overit.geocall.bl.BusinessTask<PreviousMeasureSearchEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<PreviousMeasureSearchEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<PreviousMeasureSearchEvent>
overit.geocallapp.wfm.measuringelements.bl.measuringelement.measure.task.BTPreviousMeasureSearch
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(PreviousMeasureSearchEvent.class)
public class BTPreviousMeasureSearch
extends ValidPermissionBusinessTask<PreviousMeasureSearchEvent>
Business task in order to search for a measuring element's previous
When the
Permissions:
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(PreviousMeasureSearchEvent event, PoolKit pk) Writes the measuring element's previous measure into the event journal.protected BOMeasureFinds the most recent chronological measure for a measuring element before a 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
-
BTPreviousMeasureSearch
public BTPreviousMeasureSearch()
-
-
Method Details
-
execute
protected void execute(PreviousMeasureSearchEvent event, PoolKit pk) throws DAException, DAValidateException Writes the measuring element's previous measure into the event journal.- Specified by:
executein classValidExecutionBusinessTask<PreviousMeasureSearchEvent>- Parameters:
event- thePreviousMeasureSearchEventpk- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
findPreviousChronologicalMeasure
protected BOMeasure findPreviousChronologicalMeasure(PreviousMeasureSearchEventInput input, PoolKit pk) throws DAException, DAValidateException Finds the most recent chronological measure for a measuring element before a target date.This method searches for the previous
BOMeasureof the specified measuring element that was taken before the given target date. The search excludes measures withBOMeasureStatus.Values.REJECTEDstatus and returns the most recent valid measure in chronological order.The search process:
- Filters measures by the specified measuring element ID
- Restricts the search to measures taken before the target date
- Excludes measures with REJECTED status
- Orders results by measuring date in descending order
- Returns the first (most recent) result, or null if no measures are found
- Parameters:
input- thePreviousMeasureSearchEventInputcontaining the measuring element and target date for the searchpk- thePoolKitfor database access and transaction management- Returns:
- the most recent
BOMeasurebefore the target date, ornullif no valid previous measure exists - Throws:
DAException- if a database access error occurs during the searchDAValidateException- if validation fails during the search operation- See Also:
-
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
-