Class BTTimesheetClose
java.lang.Object
overit.geocall.bl.BusinessTask<TimesheetCloseEvent>
overit.geocallapp.wfm.core.bl.timesheet.task.BTTimesheet<TimesheetCloseEvent>
overit.geocallapp.wfm.core.bl.timesheet.task.BTTimesheetClose
- All Implemented Interfaces:
Serializable,Tool
@Event(TimesheetCloseEvent.class)
public class BTTimesheetClose
extends BTTimesheet<TimesheetCloseEvent>
Business task in order to close a timesheet.
When the
TimesheetCloseEvent is launched the BT notices the call,
checks the timesheet closing conditions and eventually changes the
Timesheet state to BOTimesheetState.Values.TO_BE_VALIDATED or
BOTimesheetState.Values.VALIDATED, whether the validation is enabled
or not.
Required fields:
- timesheet id
Error code:
- Since:
- 9.2
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidchangeTimesheetState(TimesheetEntitiesAggregate aggregate, PoolKit poolKit) Changes the timesheet state toBOTimesheetState.Values.TO_BE_VALIDATEDorBOTimesheetState.Values.VALIDATED, whether the validation is enabled or not.protected voidcheckClosingConditions(TimesheetEntitiesAggregate aggregate, PoolKit poolKit) Checks all closing conditions before closing the timesheet.protected voidcheckTaskEndDate(TimesheetEntitiesAggregate aggregate) Checks the task end date for every timesheet task.protected voidcheckTaskPresence(TimesheetEntitiesAggregate aggregate, PoolKit poolKit) Checks the task presence for every timesheet shift.protected voidcheckTimesheetState(TimesheetEntitiesAggregate aggregate) Checks the timesheet state for this operation.protected voidcheckTimesheetWarnings(TimesheetEntitiesAggregate aggregate) Checks the timesheet blocking warnings.protected voidexecute(TimesheetCloseEvent event, PoolKit poolKit) Performs the closure of the timesheet.protected TimesheetEntitiesAggregateloadAggregate(Timesheet timesheet, PoolKit poolKit) It loads the timesheet aggregate object.protected TimesheetloadTimesheet(Long timesheetId, PoolKit poolKit) Loads theTimesheetfrom the given id.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
-
BTTimesheetClose
public BTTimesheetClose()
-
-
Method Details
-
execute
protected void execute(TimesheetCloseEvent event, PoolKit poolKit) throws DAException, DAValidateException Performs the closure of the timesheet.- Specified by:
executein classBTTimesheet<TimesheetCloseEvent>- Parameters:
event- theTimesheetCloseEventpoolKit- the pool kit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadTimesheet
protected Timesheet loadTimesheet(Long timesheetId, PoolKit poolKit) throws DAValidateException, DAException Loads theTimesheetfrom the given id.- Parameters:
timesheetId- the timesheet idpoolKit- the pool kit- Returns:
- the loaded
Timesheet - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadAggregate
protected TimesheetEntitiesAggregate loadAggregate(Timesheet timesheet, PoolKit poolKit) throws DAValidateException, DAException It loads the timesheet aggregate object.- Parameters:
timesheet- the givenTimesheetused to load all the related entities of the aggregatepoolKit- the pool kit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
checkClosingConditions
protected void checkClosingConditions(TimesheetEntitiesAggregate aggregate, PoolKit poolKit) throws DAValidateException, DAException Checks all closing conditions before closing the timesheet.- Parameters:
aggregate- the timesheet aggregatepoolKit- the pool kit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
checkTimesheetState
Checks the timesheet state for this operation.- Parameters:
aggregate- the timesheet aggregate- Throws:
DAValidateException- the DA validate exception
-
checkTimesheetWarnings
protected void checkTimesheetWarnings(TimesheetEntitiesAggregate aggregate) throws DAValidateException Checks the timesheet blocking warnings.- Parameters:
aggregate- the timesheet aggregate- Throws:
DAValidateException- the DA validate exception
-
checkTaskPresence
protected void checkTaskPresence(TimesheetEntitiesAggregate aggregate, PoolKit poolKit) throws DAValidateException, DAException Checks the task presence for every timesheet shift.- Parameters:
aggregate- the timesheet aggregatepoolKit- the pool kit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
checkTaskEndDate
Checks the task end date for every timesheet task.- Parameters:
aggregate- the timesheet aggregate- Throws:
DAValidateException- the DA validate exception
-
changeTimesheetState
protected void changeTimesheetState(TimesheetEntitiesAggregate aggregate, PoolKit poolKit) throws DAValidateException, DAException Changes the timesheet state toBOTimesheetState.Values.TO_BE_VALIDATEDorBOTimesheetState.Values.VALIDATED, whether the validation is enabled or not.- Parameters:
aggregate- the timesheet aggregatepoolKit- the pool kit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-