Class BTSchedulingOnInterventionOutcomeNotification
java.lang.Object
overit.geocall.bl.BusinessTask<InterventionOutcomeNotificationEvent>
overit.geocallapp.wfm.orchestrator.scheduling.bl.outcome.task.BTSchedulingOnInterventionOutcomeNotification
- All Implemented Interfaces:
Serializable,Tool
@Event(InterventionOutcomeNotificationEvent.class)
public class BTSchedulingOnInterventionOutcomeNotification
extends BusinessTask<InterventionOutcomeNotificationEvent>
Business task that react to the update of an intervention outcome.
When the
When the
InterventionOutcomeNotificationEvent is launched
the BT notices the call, updates the BOAgenda and the BOAppointment related to the notified intervention outcome
and eventually cancels all the future schedulings on this intervention. - Since:
- 18.0
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidarrivalOnSiteAgenda(BOAgenda agenda, PoolKit poolKit) Arrival at the site an agenda by updating its status toBOAgendaStatus.Values.IN_EXECUTIONand launching anAgendaUpdateEvent.protected voidbody(InterventionOutcomeNotificationEvent event, PoolKit poolKit) If the notification is an update for an intervention outcome, it updates the related agenda and appointment and eventually cancels all the future schedulings on the notified intervention.protected voidcancelFutureSchedulings(Long workOrderOperation, Date limitDate, PoolKit poolKit) Cancels all the future schedulings related to the intervention's work order operation.protected voidDeletes empty agenda resources based on the given agenda ids, current assignees ids by callingEmptyInterventionResourceDeleteEventprotected LonggetAppointmentStatus(Long outcomeType, boolean isLastAppointment) Returns the calculated next appointment status.protected SchedulingIntegrationServicegetIntegrationService(PoolKit poolKit) Returns the integration service.protected List<BOScheduling> loadFutureCancellableSchedulings(Long workOrderOperation, Date followingSlotLimitDate, PoolKit poolKit) Loads all the future schedulings related to the intervention's work order operation.protected voidstartAgenda(BOAgenda agenda, PoolKit poolKit) Save agenda by launching anAgendaUpdateEvent.protected voidsubmitAgenda(InterventionOutcomeNotificationInput input, PoolKit poolKit) Submits the agenda based on the givenInterventionOutcomeNotificationInput.protected voidtakeInChargeAppointment(InterventionOutcomeNotificationInput input, PoolKit poolKit) Takes in charge the appointment associated with theInterventionOutcomeNotificationInput's appointment.protected voidupdateAgenda(InterventionOutcomeNotificationInput input, PoolKit poolKit) Updates the agenda related to the notified intervention.protected voidupdateAppointment(Long outcomeType, Long appointmentId, boolean lastAppointment, PoolKit poolKit) Update appointment related to the notified intervention.Methods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTSchedulingOnInterventionOutcomeNotification
public BTSchedulingOnInterventionOutcomeNotification()
-
-
Method Details
-
body
protected void body(InterventionOutcomeNotificationEvent event, PoolKit poolKit) throws DAException, DAValidateException If the notification is an update for an intervention outcome, it updates the related agenda and appointment and eventually cancels all the future schedulings on the notified intervention. If the notification is a submit the task will change the status of the agenda to submit. If the notification is a take in charge the task will take in charge the agenda, take in charge the appointment and if the property isEmptyAgendaResourceDeletionEnabled is true it will delete the empty agenda resource records related to the agenda by calling theEmptyInterventionResourceDeleteEvent- Specified by:
bodyin classBusinessTask<InterventionOutcomeNotificationEvent>- Parameters:
event- theInterventionOutcomeNotificationEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
updateAgenda
protected void updateAgenda(InterventionOutcomeNotificationInput input, PoolKit poolKit) throws DAValidateException, DAException Updates the agenda related to the notified intervention.- Parameters:
input- theInterventionOutcomeNotificationInputpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
updateAppointment
protected void updateAppointment(Long outcomeType, Long appointmentId, boolean lastAppointment, PoolKit poolKit) throws DAValidateException, DAException Update appointment related to the notified intervention.- Parameters:
outcomeType- the outcome typeappointmentId- the appointment idlastAppointment- is this the last appointmentpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getAppointmentStatus
Returns the calculated next appointment status.- Parameters:
outcomeType- the outcome typeisLastAppointment- is this the last appointment- Returns:
- the calculated appointment status
-
cancelFutureSchedulings
protected void cancelFutureSchedulings(Long workOrderOperation, Date limitDate, PoolKit poolKit) throws DAValidateException, DAException Cancels all the future schedulings related to the intervention's work order operation.- Parameters:
workOrderOperation- the work order operationlimitDate- the limit datepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadFutureCancellableSchedulings
protected List<BOScheduling> loadFutureCancellableSchedulings(Long workOrderOperation, Date followingSlotLimitDate, PoolKit poolKit) throws DAValidateException, DAException Loads all the future schedulings related to the intervention's work order operation.- Parameters:
workOrderOperation- the work order operationfollowingSlotLimitDate- the following slot limit datepoolKit- thePoolKit- Returns:
- a list of BO scheduling elements of type BOScheduling
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getIntegrationService
protected SchedulingIntegrationService getIntegrationService(PoolKit poolKit) throws DAValidateException Returns the integration service.- Parameters:
poolKit- thePoolKit- Returns:
- the integration service
- Throws:
DAValidateException- the DA validate exception
-
takeInChargeAppointment
protected void takeInChargeAppointment(InterventionOutcomeNotificationInput input, PoolKit poolKit) throws DAValidateException, DAException Takes in charge the appointment associated with theInterventionOutcomeNotificationInput's appointment. The appointment status will be set toBOAppointmentStatus.Values.PLANNEDonly if it is stillBOAppointmentStatus.Values.OPEN.- Parameters:
input- The input bean for the InterventionOutcomeNotificationEvent.poolKit- thePoolKit- Throws:
DAValidateException- If there is an issue with data validation.DAException- If there is an error during the data access operation.
-
submitAgenda
protected void submitAgenda(InterventionOutcomeNotificationInput input, PoolKit poolKit) throws DAValidateException, DAException Submits the agenda based on the givenInterventionOutcomeNotificationInput.- Parameters:
input- theInterventionOutcomeNotificationInputobjectpoolKit- thePoolKit- Throws:
DAValidateException- if there is an issue with data validationDAException- if there is an error during the data access operation
-
deleteEmptyAgendaResource
protected void deleteEmptyAgendaResource(Set<Long> agendaIds, Set<Long> currentAssigneesIds, PoolKit poolKit) throws DAValidateException, DAException Deletes empty agenda resources based on the given agenda ids, current assignees ids by callingEmptyInterventionResourceDeleteEvent- Parameters:
agendaIds- the set ofBOAgenda's idscurrentAssigneesIds- the set of current assignees idspoolKit- ThePoolKit- Throws:
DAValidateException- if there is an issue with data validationDAException- if there is an error during the data access operation
-
arrivalOnSiteAgenda
protected void arrivalOnSiteAgenda(BOAgenda agenda, PoolKit poolKit) throws DAException, DAValidateException Arrival at the site an agenda by updating its status toBOAgendaStatus.Values.IN_EXECUTIONand launching anAgendaUpdateEvent.- Parameters:
agenda- The agenda to be arrival at the sitepoolKit- ThePoolKit- Throws:
DAException- If there is an error during the data access operationDAValidateException- If there is an issue with data validation
-
startAgenda
protected void startAgenda(BOAgenda agenda, PoolKit poolKit) throws DAException, DAValidateException Save agenda by launching anAgendaUpdateEvent.- Parameters:
agenda- TheBOAgendapoolKit- ThePoolKit- Throws:
DAException- If there is an error during the data access operationDAValidateException- If there is an issue with data validation
-