Class BTMeasuringElementInsert
java.lang.Object
overit.geocall.bl.BusinessTask<MeasuringElementInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<MeasuringElementInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<MeasuringElementInsertEvent>
overit.geocallapp.wfm.orchestrator.assets.bl.measuringelement.task.BTMeasuringElementInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(MeasuringElementInsertEvent.class)
public class BTMeasuringElementInsert
extends ValidPermissionBusinessTask<MeasuringElementInsertEvent>
Business task in order to insert a
When the
Permissions: Error codes:
BOMeasuringElement. When the
MeasuringElementInsertEvent is launched the BT notices the call and
inserts the BOMeasuringElement according to the event's input. Permissions: Error codes:
Codes.PROPERTY_REQUIREDfor code, description and statusCodes.FIELDS_LENGTHfor code and descriptionCodes.NOT_FOUNDfor technical object, status, counter direction, characteristic, measurement unit and catalog groupCodes.MeasuringElement.UNDEFINED_CHARACTERISTIC_AND_CATALOG_GROUPCodes.MeasuringElement.INVALID_CHARACTERISTIC_USAGECodes.MeasuringElement.PROPERTY_NOT_ALLOWED_FOR_CHARACTERISTICCodes.MeasuringElement.PROPERTY_NOT_ALLOWED_WITHOUT_CHARACTERISTICCodes.MeasuringElement.MEASUREMENT_CATALOG_GROUP_REQUIRED
- 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 voidcheckUniqueness(BOMeasuringElement measuringElement, PoolKit pk) Validates that no measuring element exists with the same code for the given technical object.protected voidexecute(MeasuringElementInsertEvent event, PoolKit pk) Inserts theBOMeasuringElementobject and writes the newly generated id into the event journal.protected AssetsIntegrationServiceReturns an instance ofAssetsIntegrationService.booleanDetermines whether the current state is valid for execution.protected voidvalidateInput(BOMeasuringElement measuringElement, PoolKit pk) Validates theBOMeasuringElementobject data before its insertion.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
-
BTMeasuringElementInsert
public BTMeasuringElementInsert()
-
-
Method Details
-
getIntegrationService
Returns an instance ofAssetsIntegrationService.- Parameters:
pk- thePoolKit- Returns:
- an instance of
AssetsIntegrationService - Throws:
DAValidateException- the DA validate exception
-
execute
protected void execute(MeasuringElementInsertEvent event, PoolKit pk) throws DAException, DAValidateException Inserts theBOMeasuringElementobject and writes the newly generated id into the event journal.- Specified by:
executein classValidExecutionBusinessTask<MeasuringElementInsertEvent>- Parameters:
event- theMeasuringElementInsertEventpk- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validateInput
protected void validateInput(BOMeasuringElement measuringElement, PoolKit pk) throws DAValidateException, DAException Validates theBOMeasuringElementobject data before its insertion.- Parameters:
measuringElement- theBOMeasuringElementobject to be insertedpk- thePoolKitpk- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
checkUniqueness
protected void checkUniqueness(BOMeasuringElement measuringElement, PoolKit pk) throws DAValidateException, DAException Validates that no measuring element exists with the same code for the given technical object.The method searches for measuring elements with the same code and technical object. This validation ensures uniqueness of measuring element codes within a technical object's scope.
- Parameters:
measuringElement- the measuring element to check for uniquenesspk- the pool kit for accessing integration services- Throws:
DAValidateException- withCodes.CODE_ALREADY_DEFINEDif a measuring element with the same code already exists for the technical objectDAException- if there's an error during the search operation
-
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
-