Class BTTimesheetTaskCancel
java.lang.Object
overit.geocall.bl.BusinessTask<TimesheetTaskCancelEvent>
overit.geocallapp.wfm.core.bl.timesheet.task.BTTimesheet<TimesheetTaskCancelEvent>
overit.geocallapp.wfm.core.bl.timesheet.task.BTTimesheetTaskCancel
- All Implemented Interfaces:
Serializable,Tool
@Event(TimesheetTaskCancelEvent.class)
public class BTTimesheetTaskCancel
extends BTTimesheet<TimesheetTaskCancelEvent>
Business task in order to cancel a
When the
BOTask. When the
TimesheetTaskCancelEvent is launched the BT notices the call
and cancels the BOTask basing on the event's input. Required fields:
- timesheet task id
Error Code:
- Since:
- 9.2
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcalculateDuration(Timesheet timesheet, PoolKit poolKit) Calculates the timesheet durations.protected voidcalculateWarnings(Timesheet timesheet, PoolKit poolKit) Calculates all the timesheet warnings.protected voidcancelTask(BOTask task, PoolKit poolKit) Cancels the givenBOTask.protected voidcheckTimesheetState(Timesheet timesheet) Checks the timesheet state for this operation.protected voidexecute(TimesheetTaskCancelEvent event, PoolKit poolKit) Cancels the given task and recalculates all the timesheets durations and warnings.protected BOTaskLoads theBOTask.protected TimesheetloadTimesheet(TimesheetTaskCancelInput input, Long timesheetId, PoolKit poolKit) Loads theTimesheetfrom the given id.protected voidvalidateData(BOTask task, Timesheet timesheet, TimesheetPermissionCheck permissionCheck, TimesheetTaskEventCache cache, PoolKit poolKit) 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
-
BTTimesheetTaskCancel
public BTTimesheetTaskCancel()
-
-
Method Details
-
execute
protected void execute(TimesheetTaskCancelEvent event, PoolKit poolKit) throws DAException, DAValidateException Cancels the given task and recalculates all the timesheets durations and warnings.- Specified by:
executein classBTTimesheet<TimesheetTaskCancelEvent>- Parameters:
event- the timesheet task cancel eventpoolKit- the pool kit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
loadTimesheet
protected Timesheet loadTimesheet(TimesheetTaskCancelInput input, Long timesheetId, PoolKit poolKit) throws DAValidateException, DAException Loads theTimesheetfrom the given id.- Parameters:
input- the timesheet task cancel event inputtimesheetId- the timesheet idpoolKit- the pool kit- Returns:
- the loaded
Timesheet - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
validateData
protected void validateData(BOTask task, Timesheet timesheet, TimesheetPermissionCheck permissionCheck, TimesheetTaskEventCache cache, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
checkTimesheetState
Checks the timesheet state for this operation.- Parameters:
timesheet- the givenTimesheet- Throws:
DAValidateException
-
cancelTask
Cancels the givenBOTask.- Parameters:
task- theBOTaskto cancelpoolKit- the pool kit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadTask
Loads theBOTask.- Parameters:
taskId- the task idpk- the pool kit- Returns:
- the loaded
BOTask. - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
calculateDuration
protected void calculateDuration(Timesheet timesheet, PoolKit poolKit) throws DAValidateException, DAException Calculates 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
-