Class BTTimesheetAutomaticTaskUpdate
java.lang.Object
overit.geocall.bl.BusinessTask<TimesheetAutomaticTaskUpdateEvent>
overit.geocallapp.wfm.core.bl.timesheet.task.BTTimesheet<TimesheetAutomaticTaskUpdateEvent>
overit.geocallapp.wfm.core.bl.timesheet.task.BTTimesheetAutomaticTaskUpdate
- All Implemented Interfaces:
Serializable,Tool
@Event(TimesheetAutomaticTaskUpdateEvent.class)
public class BTTimesheetAutomaticTaskUpdate
extends BTTimesheet<TimesheetAutomaticTaskUpdateEvent>
Business task in order to update an automatic
When the
BOTask. When the
TimesheetAutomaticTaskUpdateEvent is launched the BT notices
the call and updates the BOTask basing on the event's input. Error Code:
- Since:
- 9.2
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcalculateDuration(Timesheet timesheet, PoolKit poolKit) Calculates all the timesheet durations.protected voidcalculateWarnings(Timesheet timesheet, PoolKit poolKit) Calculates all the timesheet warnings.protected voidcheckTimesheetState(Timesheet timesheet) Checks the timesheet state for this operation.protected voidexecute(TimesheetAutomaticTaskUpdateEvent event, PoolKit poolKit) Updates the automaticBOTaskand recalculates all the timesheet durations and warnings.protected BOEventEntitygetEventEntity(Long eventEntityId, Timesheet timesheet, PoolKit poolKit) protected DategetTaskEndDate(TimesheetAutomaticTaskUpdateInput input, BOTask task, Timesheet timesheet, PoolKit poolKit) protected DategetTaskStartDate(TimesheetAutomaticTaskUpdateInput input, BOTask task, Timesheet timesheet, PoolKit poolKit) protected voidinsertEventEntity(BOEventEntity eventEntity, Timesheet timesheet, PoolKit poolKit) protected booleanisDailyAbsence(TimesheetAutomaticTaskUpdateInput input, BOEventEntity eventEntity, PoolKit poolKit) protected BOTaskLoads aBOTask.protected TimesheetloadTimesheet(TimesheetAutomaticTaskUpdateInput input, PoolKit poolKit) Loads theTimesheet.protected BOTaskprepareTaskData(TimesheetAutomaticTaskUpdateInput input, Timesheet timesheet, PoolKit poolKit) Prepares the task data for the update.protected voidupdateTask(TimesheetAutomaticTaskUpdateInput input, Timesheet timesheet, PoolKit poolKit) Updates the automaticBOTask.protected voidvalidateData(TimesheetAutomaticTaskUpdateInput input, Timesheet timesheet, PoolKit poolKit) Validates the event's input data.Methods inherited from class overit.geocallapp.wfm.core.bl.timesheet.task.BTTimesheet
body, checkTimesheetActivation, throwInactiveTimesheetExceptionMethods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTTimesheetAutomaticTaskUpdate
public BTTimesheetAutomaticTaskUpdate()
-
-
Method Details
-
execute
protected void execute(TimesheetAutomaticTaskUpdateEvent event, PoolKit poolKit) throws DAException, DAValidateException Updates the automaticBOTaskand recalculates all the timesheet durations and warnings.- Specified by:
executein classBTTimesheet<TimesheetAutomaticTaskUpdateEvent>- Parameters:
event- the timesheet task update eventpoolKit- the pool kit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
insertEventEntity
protected void insertEventEntity(BOEventEntity eventEntity, Timesheet timesheet, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
loadTimesheet
protected Timesheet loadTimesheet(TimesheetAutomaticTaskUpdateInput input, PoolKit poolKit) throws DAValidateException, DAException Loads theTimesheet.- Parameters:
input- the input of the eventpoolKit- the pool kit- Returns:
- the loaded
Timesheet - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
checkTimesheetState
Checks the timesheet state for this operation.- Parameters:
timesheet- the givenTimesheet- Throws:
DAValidateException
-
validateData
protected void validateData(TimesheetAutomaticTaskUpdateInput input, Timesheet timesheet, PoolKit poolKit) throws DAValidateException, DAException Validates the event's input data.- Parameters:
input- the input of the eventtimesheet- the givenTimesheetpoolKit- the pool kit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
updateTask
protected void updateTask(TimesheetAutomaticTaskUpdateInput input, Timesheet timesheet, PoolKit poolKit) throws DAValidateException, DAException Updates the automaticBOTask.- Parameters:
input- the input of the eventtimesheet- the givenTimesheetpoolKit- the pool kit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
prepareTaskData
protected BOTask prepareTaskData(TimesheetAutomaticTaskUpdateInput input, Timesheet timesheet, PoolKit poolKit) throws DAValidateException, DAException Prepares the task data for the update.- Parameters:
input- the input of the eventpoolKit- the pool kit- Returns:
- the
BOTaskcontaining the new values for the update - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getTaskStartDate
protected Date getTaskStartDate(TimesheetAutomaticTaskUpdateInput input, BOTask task, Timesheet timesheet, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
getTaskEndDate
protected Date getTaskEndDate(TimesheetAutomaticTaskUpdateInput input, BOTask task, Timesheet timesheet, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
getEventEntity
protected BOEventEntity getEventEntity(Long eventEntityId, Timesheet timesheet, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
isDailyAbsence
protected boolean isDailyAbsence(TimesheetAutomaticTaskUpdateInput input, BOEventEntity eventEntity, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
loadTask
Loads aBOTask.- Parameters:
taskId- the task idpoolKit- the pool kit- Returns:
- the
BOTaskwith the given id - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
calculateDuration
protected void calculateDuration(Timesheet timesheet, PoolKit poolKit) throws DAValidateException, DAException Calculates all the timesheet durations.- Parameters:
timesheet- the givenTimesheetpoolKit- the pool kit- Throws:
DAExceptionDAValidateException
-
calculateWarnings
protected void calculateWarnings(Timesheet timesheet, PoolKit poolKit) throws DAValidateException, DAException Calculates all the timesheet warnings.- Parameters:
timesheet- the givenTimesheetpoolKit- the pool kit- Throws:
DAExceptionDAValidateException
-