Class BTWorkOrderCreationFromWorkCycle
java.lang.Object
overit.geocall.bl.BusinessTask<WorkOrderCreationFromWorkCycleEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<WorkOrderCreationFromWorkCycleEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<WorkOrderCreationFromWorkCycleEvent>
overit.geocallapp.wfm.orchestrator.workorders.bl.task.BTWorkOrderCreationFromWorkCycle
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(WorkOrderCreationFromWorkCycleEvent.class)
public class BTWorkOrderCreationFromWorkCycle
extends ValidPermissionBusinessTask<WorkOrderCreationFromWorkCycleEvent>
Business task to insert a work order from work cycle.
Permission:
Error Code:
- Since:
- 18.0
- See Also:
- GCApi:
- task
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected WorkOrdersIntegrationServiceprotected Longprotected BOWorkCycleFields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactivateWorkOrder(Long workOrderHeaderId, PoolKit poolKit) Activate the work orderprotected voidaddOperation(List<BOWorkOrderOperation> workOrderOperations, BOWorkOrderOperation operation) Adds an operation to the list of work order operations.protected voidGeneration of unique code for the work order starting from the operationCenterId and completion of the fields in theBOWorkOrderHeaderfrom theBOWorkCycle.protected voidcompleteWorkOrderOperationFromWorkCycleStructure(BOWorkOrderOperation woOperation, BOWorkOrderHeader woHeader, BOWorkCycleStructure workCycleStructure, Long addressId, Long ordering) Completion of the fields in theBOWorkOrderOperationfrom theBOWorkCycleStructure.protected voidcreateRepeatableOperation(BOWorkOrderHeader woHeader, BOWorkCycleStructure workCycleStructure, List<BOWorkOrderOperation> woOperations, PoolKit poolKit) Creation of aBOWorkOrderOperationstarting from a repeatableBOWorkCycleStructure.protected voidcreateSingleOperation(BOWorkOrderHeader woHeader, BOWorkCycleStructure workCycleStructure, List<BOWorkOrderOperation> woOperations, PoolKit poolKit) Creation of aBOWorkOrderOperationstarting from a non-repeatableBOWorkCycleStructure.protected List<BOWorkOrderOperation> createWoOperations(BOWorkOrderHeader woHeader, PoolKit poolKit) Creates a list ofBOWorkOrderOperationbased on the provided work order header and work cycle structures.protected voidexecute(WorkOrderCreationFromWorkCycleEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected WorkOrdersIntegrationServicegetIntegrationService(PoolKit poolKit) Returns the integration service.protected LonggetTechnicalObjectType(BOWorkCycleStructure workCycleStructure, PoolKit poolKit) Return the technical object type for work order operation type or work order typeprotected voidinsertOperations(Long workOrderHeaderId, List<BOWorkOrderOperation> woOperations, PoolKit poolKit) Insert the list ofBOWorkOrderOperation.booleanDetermines whether the current state is valid for execution.searchAssetDescendants(BOWorkCycleStructure workCycleStructure, Long assetId, PoolKit poolKit) Searches for the descendants of an asset based on the provided asset id and asset status from work cycle structure.protected List<BOWorkCycleStructure> searchWorkCycleStructure(BOWorkOrderHeader woHeader, PoolKit poolKit) Searches for work cycle structures based on the provided work order header.protected voidvalidateWorkOrderHeader(BOWorkOrderHeader woHeader, PoolKit poolKit) Check on mandatory fields and visibility of properties.protected voidvalidateWorkOrderOperation(BOWorkCycleStructure workCycleStructure, PoolKit poolKit) Check on the visibility of the properties of theBOWorkOrderOperationMethods 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
-
Field Details
-
integrationService
-
workCycle
-
operationOrdering
-
-
Constructor Details
-
BTWorkOrderCreationFromWorkCycle
public BTWorkOrderCreationFromWorkCycle()
-
-
Method Details
-
execute
protected void execute(WorkOrderCreationFromWorkCycleEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<WorkOrderCreationFromWorkCycleEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
createWoOperations
protected List<BOWorkOrderOperation> createWoOperations(BOWorkOrderHeader woHeader, PoolKit poolKit) throws DAException, DAValidateException Creates a list ofBOWorkOrderOperationbased on the provided work order header and work cycle structures.- Parameters:
woHeader- theBOWorkOrderHeaderpoolKit- thePoolKit- Returns:
- the list of
BOWorkOrderOperation - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validateWorkOrderHeader
protected void validateWorkOrderHeader(BOWorkOrderHeader woHeader, PoolKit poolKit) throws DAValidateException, DAException Check on mandatory fields and visibility of properties.- Parameters:
woHeader- theBOWorkOrderHeaderpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
completeWorkOrderHeaderFromWorkCycle
Generation of unique code for the work order starting from the operationCenterId and completion of the fields in theBOWorkOrderHeaderfrom theBOWorkCycle.- Parameters:
woHeader- theBOWorkOrderHeader
-
insertOperations
protected void insertOperations(Long workOrderHeaderId, List<BOWorkOrderOperation> woOperations, PoolKit poolKit) throws DAValidateException, DAException Insert the list ofBOWorkOrderOperation.- Parameters:
workOrderHeaderId- theBOWorkOrderHeaderidwoOperations- the list ofBOWorkOrderOperationpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
searchWorkCycleStructure
protected List<BOWorkCycleStructure> searchWorkCycleStructure(BOWorkOrderHeader woHeader, PoolKit poolKit) throws DAValidateException, DAException Searches for work cycle structures based on the provided work order header.- Parameters:
woHeader- theBOWorkOrderHeaderpoolKit- thePoolKit- Returns:
- the list of
BOWorkCycleStructure - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
createSingleOperation
protected void createSingleOperation(BOWorkOrderHeader woHeader, BOWorkCycleStructure workCycleStructure, List<BOWorkOrderOperation> woOperations, PoolKit poolKit) throws DAException, DAValidateException Creation of aBOWorkOrderOperationstarting from a non-repeatableBOWorkCycleStructure.- Parameters:
woHeader- theBOWorkOrderHeaderworkCycleStructure- theBOWorkCycleStructurewoOperations- the list ofBOWorkOrderOperationpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
createRepeatableOperation
protected void createRepeatableOperation(BOWorkOrderHeader woHeader, BOWorkCycleStructure workCycleStructure, List<BOWorkOrderOperation> woOperations, PoolKit poolKit) throws DAException, DAValidateException Creation of aBOWorkOrderOperationstarting from a repeatableBOWorkCycleStructure. This involves extracting the descendants of an asset and creating an operation for each asset.- Parameters:
woHeader- theBOWorkOrderHeaderworkCycleStructure- theBOWorkCycleStructurewoOperations- the list ofBOWorkOrderOperationpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
addOperation
protected void addOperation(List<BOWorkOrderOperation> workOrderOperations, BOWorkOrderOperation operation) throws DAValidateException Adds an operation to the list of work order operations. If the size of the list exceeds the maximum allowed number of operations, a DAValidateException is thrown.- Parameters:
workOrderOperations- the list ofBOWorkOrderOperationoperation- theBOWorkOrderOperationto be added- Throws:
DAValidateException- if the maximum number of operations is exceeded
-
searchAssetDescendants
protected List<BOAsset> searchAssetDescendants(BOWorkCycleStructure workCycleStructure, Long assetId, PoolKit poolKit) throws DAValidateException, DAException Searches for the descendants of an asset based on the provided asset id and asset status from work cycle structure.- Parameters:
workCycleStructure- theBOWorkCycleStructureassetId- the id of the asset to search for descendants.poolKit- thePoolKit- Returns:
- the list of
BOAssetobjects representing the descendants of the asset. - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
getTechnicalObjectType
protected Long getTechnicalObjectType(BOWorkCycleStructure workCycleStructure, PoolKit poolKit) throws DAValidateException, DAException Return the technical object type for work order operation type or work order type- Parameters:
workCycleStructure- theBOWorkCycleStructurepoolKit- thePoolKit- Returns:
- the technical object type
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
validateWorkOrderOperation
protected void validateWorkOrderOperation(BOWorkCycleStructure workCycleStructure, PoolKit poolKit) throws DAException, DAValidateException Check on the visibility of the properties of theBOWorkOrderOperation- Parameters:
workCycleStructure- theBOWorkCycleStructurepoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
completeWorkOrderOperationFromWorkCycleStructure
protected void completeWorkOrderOperationFromWorkCycleStructure(BOWorkOrderOperation woOperation, BOWorkOrderHeader woHeader, BOWorkCycleStructure workCycleStructure, Long addressId, Long ordering) Completion of the fields in theBOWorkOrderOperationfrom theBOWorkCycleStructure.- Parameters:
woOperation- theBOWorkOrderOperationwoHeader- theBOWorkOrderHeaderworkCycleStructure- theBOWorkCycleStructure
-
activateWorkOrder
protected void activateWorkOrder(Long workOrderHeaderId, PoolKit poolKit) throws DAValidateException, DAException Activate the work order- Parameters:
workOrderHeaderId- the work order idpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
getIntegrationService
protected WorkOrdersIntegrationService getIntegrationService(PoolKit poolKit) throws DAValidateException Returns the integration service.- Parameters:
poolKit- thePoolKit- Returns:
- the integration service
- Throws:
DAValidateException- the DA validate exception
-
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
-