Class BTWorkCycleStructureDelete
java.lang.Object
overit.geocall.bl.BusinessTask<WorkCycleStructureDeleteEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<WorkCycleStructureDeleteEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<WorkCycleStructureDeleteEvent>
overit.geocallapp.wfm.workorders.bl.workcycle.structure.task.BTWorkCycleStructureDelete
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(WorkCycleStructureDeleteEvent.class)
public class BTWorkCycleStructureDelete
extends ValidPermissionBusinessTask<WorkCycleStructureDeleteEvent>
Business task in order to delete a
BOWorkCycleStructure.
When the WorkCycleStructureDeleteEvent is launched the BT notices the call and deletes the
BOWorkCycleStructure basing on the event's input.
Required fields:
- workCycleStructureId
Error Code:
- 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 booleancheckNonOptionalOperations(List<BOWorkCycleStructure> workCycleStructures) Check on work cycle structures if there are non-optional operation definedprotected voidexecute(WorkCycleStructureDeleteEvent event, PoolKit poolKit) Remove the givenBOWorkCycleStructureid.protected List<BOWorkCycleStructure> getStructures(BOWorkCycleStructure workCycleStructure, PoolKit poolKit) Get the list ofBOWorkCycleStructureassociated to the sameBOWorkCycleprotected BOWorkCycleStructuregetWorkCycleStructure(Long workCycleStructureId, PoolKit poolKit) Retrieves the work cycle structure with the given id.booleanDetermines whether the current state is valid for execution.protected voidnotifyWorkCycleDelete(BOWorkCycleStructure workCycleStructure, PoolKit poolKit) Notifies the deletion of a work cycle structure.protected voidupdateWorkOrderOperationsWorkCycleSource(Long workCycleStructureId, PoolKit poolKit) Updates the work order operations work cycle source.protected voidvalidate(BOWorkCycleStructure workCycleStructure, PoolKit poolKit) Validates the data before the deletion.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
-
BTWorkCycleStructureDelete
public BTWorkCycleStructureDelete()
-
-
Method Details
-
execute
protected void execute(WorkCycleStructureDeleteEvent event, PoolKit poolKit) throws DAException, DAValidateException Remove the givenBOWorkCycleStructureid.- Specified by:
executein classValidExecutionBusinessTask<WorkCycleStructureDeleteEvent>- Parameters:
event- theWorkCycleStructureDeleteEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
getWorkCycleStructure
protected BOWorkCycleStructure getWorkCycleStructure(Long workCycleStructureId, PoolKit poolKit) throws DAValidateException, DAException Retrieves the work cycle structure with the given id.- Parameters:
workCycleStructureId- the id of theBOWorkCycleStructurepoolKit- thePoolKit- Returns:
- the
BOWorkCycleStructure - Throws:
DAException- the DA exception * @throws DAValidateException the DA validate exceptionDAValidateException
-
getStructures
protected List<BOWorkCycleStructure> getStructures(BOWorkCycleStructure workCycleStructure, PoolKit poolKit) throws DAException, DAValidateException Get the list ofBOWorkCycleStructureassociated to the sameBOWorkCycle- Parameters:
workCycleStructure- theBOWorkCycleStructurepoolKit- thePoolKit- Returns:
- the list of
BOWorkCycleStructure - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
validate
protected void validate(BOWorkCycleStructure workCycleStructure, PoolKit poolKit) throws DAValidateException, DAException Validates the data before the deletion.- Parameters:
workCycleStructure- theBOWorkCycleStructure- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
checkNonOptionalOperations
Check on work cycle structures if there are non-optional operation defined- Parameters:
workCycleStructures- the list ofBOWorkCycleStructure- Returns:
- true if there are non-optional operation defined, false otherwise
-
updateWorkOrderOperationsWorkCycleSource
protected void updateWorkOrderOperationsWorkCycleSource(Long workCycleStructureId, PoolKit poolKit) throws DAException, DAValidateException Updates the work order operations work cycle source.- Parameters:
workCycleStructureId- the id of theBOWorkCycleStructurepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
notifyWorkCycleDelete
protected void notifyWorkCycleDelete(BOWorkCycleStructure workCycleStructure, PoolKit poolKit) throws DAValidateException, DAException Notifies the deletion of a work cycle structure.- Parameters:
workCycleStructure- TheBOWorkCycleStructureto be deleted.poolKit- ThePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA 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
-