Class BTInterventionExecution<T extends InterventionExecutionInput>
java.lang.Object
overit.geocall.bl.BusinessTask<SimpleBusinessEvent<T,Void>>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<SimpleBusinessEvent<T,Void>>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<SimpleBusinessEvent<T,Void>>
overit.geocallapp.wfm.orchestrator.workorders.bl.outcome.intervention.task.BTInterventionExecution<T>
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
- Direct Known Subclasses:
BTInterventionArrivalOnSite,BTInterventionStart,BTInterventionTakeInCharge
public abstract class BTInterventionExecution<T extends InterventionExecutionInput>
extends ValidPermissionBusinessTask<SimpleBusinessEvent<T,Void>>
An abstract class that extends
ValidPermissionBusinessTask and represents a business task for executing an intervention.
This class is responsible for:
- Validating the input: generic checks performed by the superclass, personal checks performed by the subclasses
- Finding interventions to be removed and removing other interventions from the foreman
- Performing the action (take in charge, arrival on site, intervention start), which is implemented in subclasses
- Recalculating the work order operation and status
- Since:
- 18.0
- See Also:
- GCApi:
- task
-
Field Summary
FieldsFields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidChecks the date in the givenInterventionExecutionInputinput object.protected abstract voidChecks the status of the intervention to ensure it is valid for the current operation.protected voidexecute(SimpleBusinessEvent<T, Void> event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected List<BOIntervention> findInterventionsToBeRemoved(PoolKit poolKit) This method finds the interventions that are associated with the same foreman id and with a different work order operation.protected WorkOrdersIntegrationServicegetIntegrationService(PoolKit poolKit) Retrieves the WorkOrdersIntegrationService instance.booleanDetermines whether the current state is valid for execution.protected voidnotifyInterventionOutcome(BOInterventionOutcome interventionOutcome, PoolKit poolKit, InterventionOutcomeNotificationAction action) Notifies that the intervention outcome was modified by callingInterventionOutcomeNotificationEventprotected abstract voidperformInterventionAction(InterventionExecutionInput input, PoolKit poolKit) protected voidRecalculates the work order operation status.protected voidrecalculateWorkOrderStatus(PoolKit poolKit) Recalculate work order status.protected voidremoveOtherInterventionsFromForeman(List<BOIntervention> interventionsToBeRemoved, PoolKit poolKit) Removes other interventions from foreman by callingInterventionExecutionDeleteEventprotected voidupdateWorkOrderOperation(PoolKit poolKit) Updates the work order operation by launchingWorkOrderOperationUpdateEvent.protected voidvalidateInput(InterventionExecutionInput input, PoolKit poolKit) Validates the input for the intervention execution task.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
-
Field Details
-
operation
-
intervention
-
-
Constructor Details
-
BTInterventionExecution
public BTInterventionExecution()
-
-
Method Details
-
execute
protected void execute(SimpleBusinessEvent<T, Void> event, PoolKit poolKit) throws DAException, DAValidateExceptionDescription copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<SimpleBusinessEvent<T extends InterventionExecutionInput,Void>> - 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(InterventionExecutionInput input, PoolKit poolKit) throws DAValidateException, DAException Validates the input for the intervention execution task.- Parameters:
input- TheInterventionExecutionInputinput object.poolKit- thePoolKit- Throws:
DAValidateException- If any validation error occurs.DAException- If any error occurs during the validation process.
-
checkDate
Checks the date in the givenInterventionExecutionInputinput object.- Parameters:
inputDate- The date of theInterventionExecutionInputinput object to check.- Throws:
DAValidateException- If any validation error occurs during the date check.
-
checkInterventionStatus
Checks the status of the intervention to ensure it is valid for the current operation.- Throws:
DAValidateException- If the intervention status is not valid.
-
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.
-
findInterventionsToBeRemoved
protected List<BOIntervention> findInterventionsToBeRemoved(PoolKit poolKit) throws DAValidateException, DAException This method finds the interventions that are associated with the same foreman id and with a different work order operation.- Parameters:
poolKit- thePoolKit- Returns:
- The list of BOIntervention objects to be removed.
- Throws:
DAValidateException- If the intervention status is not valid.DAException- If an error occurs during the process.
-
removeOtherInterventionsFromForeman
protected void removeOtherInterventionsFromForeman(List<BOIntervention> interventionsToBeRemoved, PoolKit poolKit) throws DAException, DAValidateException Removes other interventions from foreman by callingInterventionExecutionDeleteEvent- Parameters:
interventionsToBeRemoved- the list of BOIntervention objects to be removedpoolKit- thePoolKit- Throws:
DAException- If any error occurs during the deletion processDAValidateException- If any validation error occurs
-
performInterventionAction
protected abstract void performInterventionAction(InterventionExecutionInput input, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
updateWorkOrderOperation
Updates the work order operation by launchingWorkOrderOperationUpdateEvent.- Parameters:
poolKit- ThePoolKit- Throws:
DAException- If any error occurs during the update process.DAValidateException- If any validation error occurs.
-
notifyInterventionOutcome
protected void notifyInterventionOutcome(BOInterventionOutcome interventionOutcome, PoolKit poolKit, InterventionOutcomeNotificationAction action) throws DAException, DAValidateException Notifies that the intervention outcome was modified by callingInterventionOutcomeNotificationEvent- Parameters:
interventionOutcome- theBOInterventionOutcometo notifypoolKit- thePoolKitaction- theInterventionOutcomeNotificationActionrepresenting the action that was performed- Throws:
DAException- if an error occurs during the notification processDAValidateException- if any validation error occurs
-
recalculateWorkOrderOperationStatus
protected void recalculateWorkOrderOperationStatus(PoolKit poolKit) throws DAValidateException, DAException Recalculates the work order operation status.- Parameters:
poolKit- thePoolKit- Throws:
DAValidateException- If any validation error occurs.DAException- If an error occurs during the process.
-
recalculateWorkOrderStatus
Recalculate work order status.- Parameters:
poolKit- thePoolKit- Throws:
DAValidateException- If any validation error occurs.DAException- If any error occurs during the notification process.
-
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
-