Class MeasureStatusChangeTask<E extends SimpleBusinessEvent<BOMeasure,Void>>
java.lang.Object
overit.geocall.bl.BusinessTask<E>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<E>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<E>
overit.geocallapp.wfm.orchestrator.assets.bl.measuringelement.measure.task.MeasureStatusChangeTask<E>
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
- Direct Known Subclasses:
BTMeasureReject,BTMeasureValidate
public abstract class MeasureStatusChangeTask<E extends SimpleBusinessEvent<BOMeasure,Void>>
extends ValidPermissionBusinessTask<E>
Abstract business task in order to change the status of a
Permissions:
BOMeasure. 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 voidExecutes the status change operation on a measure.protected AssetsIntegrationServiceReturn theAssetsEventIntegrationServiceused to access other domains.protected abstract LongGets the target status for the measure status change operation.booleanDetermines whether the current state is valid for execution.protected abstract voidvalidateForStatusChange(BOMeasure measure) Validates if the measure can undergo the requested status change.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
-
MeasureStatusChangeTask
public MeasureStatusChangeTask()
-
-
Method Details
-
getIntegrationService
Return theAssetsEventIntegrationServiceused to access other domains.- Parameters:
pk- thePoolKit- Returns:
- the
AssetsEventIntegrationServiceused to access services and events in other domains - Throws:
DAValidateException- thrown if there are data related loading errors
-
execute
Executes the status change operation on a measure.The method:
- Loads the measure to prevent any updates except status changes
- Validates if the status change is allowed
- Performs the status update
- Specified by:
executein classValidExecutionBusinessTask<E extends SimpleBusinessEvent<BOMeasure,Void>> - Parameters:
event- the eventpk- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validateForStatusChange
Validates if the measure can undergo the requested status change.- Parameters:
measure- the measure to validate for status change- Throws:
DAValidateException- if the status change validation fails
-
getTargetStatus
Gets the target status for the measure status change operation.- Returns:
- the target status
-
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
-