Class BTAppointmentLoadOrCreate
java.lang.Object
overit.geocall.bl.BusinessTask<AppointmentLoadOrCreateEvent>
overit.geocallapp.wfm.scheduling.appointment.task.BTAppointmentLoadOrCreate
- All Implemented Interfaces:
Serializable,Tool
@Event(AppointmentLoadOrCreateEvent.class)
public class BTAppointmentLoadOrCreate
extends BusinessTask<AppointmentLoadOrCreateEvent>
Business task for loading or creating an appointment for a work order operation.
This task provides a modern interface to replace the legacy pattern of
caricaOCreaAppuntamento used in DATSchedulazioneOdl.
The task:
- Searches for the last appointment for the work order operation using
DATSchedulazioneOdlPda.loadUltimoAppuntamento(overit.geocall.util.HashGetter, overit.geocall.sql.PooledConnection) - If an OPEN appointment exists, reuses it
- If a SCHEDULED appointment exists:
- If multiple assignment is disabled, throws an error (C270_1379)
- If multiple assignment is enabled, creates a new appointment
- If no appointment exists, creates a new one using
DATCreaAppuntamentoFittizioOdl - Loads the complete appointment data using
DAIncollaAttivita.loadAttivita(java.lang.Long) - Returns the appointment ID and data for use with legacy scheduling code
- Since:
- 22.0
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbody(AppointmentLoadOrCreateEvent event, PoolKit poolKit) Implements this method to write the specific task logic to handle the input parameter.protected HashGetterloadWorkOrderOperationData(Long workOrderOperationId, PooledConnection conn) Loads work order operation data from database.Methods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTAppointmentLoadOrCreate
public BTAppointmentLoadOrCreate()
-
-
Method Details
-
body
protected void body(AppointmentLoadOrCreateEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:BusinessTaskImplements this method to write the specific task logic to handle the input parameter.- Specified by:
bodyin classBusinessTask<AppointmentLoadOrCreateEvent>- Parameters:
event- the object upon which the task will works onpoolKit- the poolkit containing the reference to the database connection that can be used- Throws:
DAException- in case of database errorDAValidateException- in case of database validation error
-
loadWorkOrderOperationData
protected HashGetter loadWorkOrderOperationData(Long workOrderOperationId, PooledConnection conn) throws DAException, DAValidateException Loads work order operation data from database.- Parameters:
workOrderOperationId- the work order operation IDconn- the database connection- Returns:
- the work order operation data
- Throws:
DAException- if database error occursDAValidateException- if validation error occurs
-