Class BTOperationCenterDeductionFromAsset
java.lang.Object
overit.geocall.bl.BusinessTask<OperationCenterDeductionFromAssetEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<OperationCenterDeductionFromAssetEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<OperationCenterDeductionFromAssetEvent>
overit.geocallapp.wfm.orchestrator.workorders.bl.operationcenter.task.BTOperationCenterDeductionFromAsset
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(OperationCenterDeductionFromAssetEvent.class)
public class BTOperationCenterDeductionFromAsset
extends ValidPermissionBusinessTask<OperationCenterDeductionFromAssetEvent>
Business task in order to deduce an
BOOperationCenter
from a BOAddress given as id input in OperationCenterDeductionFromAssetInput - Since:
- 18.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 LongdeduceOperationCenter(PoolKit poolKit) This method tries to find the operation center by loading the address and finding if it is associated with an asset or an account.protected voidexecute(OperationCenterDeductionFromAssetEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected WorkOrdersIntegrationServicegetIntegrationService(PoolKit poolKit) Retrieves the WorkOrdersIntegrationService instance.booleanDetermines whether the current state is valid for execution.protected voidvalidateInput(OperationCenterDeductionFromAssetInput input, PoolKit poolKit) Validates the data before performing any action that require the inputMethods 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
-
BTOperationCenterDeductionFromAsset
public BTOperationCenterDeductionFromAsset()
-
-
Method Details
-
execute
protected void execute(OperationCenterDeductionFromAssetEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<OperationCenterDeductionFromAssetEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
validateInput
protected void validateInput(OperationCenterDeductionFromAssetInput input, PoolKit poolKit) throws DAValidateException, DAException Validates the data before performing any action that require the input- Parameters:
input- theOperationCenterDeductionFromAssetInputobject to be validatedpoolKit- thePoolKit- Throws:
DAValidateException- theDAValidateExceptionthrown if the address id is nullCodes.INVALID_PROPERTY_VALUEor if theBOAddressresource doesn't exist inLoadEventDAException- theDAExceptiongeneric error thrown if there are code related errors inLoadEvent
-
deduceOperationCenter
This method tries to find the operation center by loading the address and finding if it is associated with an asset or an account.- Parameters:
poolKit- thePoolKit- Returns:
- a long that represents the operation center id or null if not found
- Throws:
DAException- theDAExceptiongeneric error thrown if there are code related errors inLoadEventDAValidateException- theDAValidateExceptionthrown if there are data related loading errors inLoadEvent
-
getIntegrationService
protected WorkOrdersIntegrationService getIntegrationService(PoolKit poolKit) throws DAValidateException Retrieves the WorkOrdersIntegrationService instance. If the instance hasn't been created yet, it will be created and stored for future use.- Parameters:
poolKit- ThePoolKit.- Returns:
- The
WorkOrdersIntegrationServiceinstance. - Throws:
DAValidateException- If any validation error occurs.
-
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
-