Class BTTimesheetGapFill
java.lang.Object
overit.geocall.bl.BusinessTask<TimesheetGapFillEvent>
overit.geocallapp.wfm.core.bl.timesheet.task.BTTimesheet<TimesheetGapFillEvent>
overit.geocallapp.wfm.core.bl.timesheet.task.BTTimesheetGapFill
- All Implemented Interfaces:
Serializable,Tool
@Event(TimesheetGapFillEvent.class)
public class BTTimesheetGapFill
extends BTTimesheet<TimesheetGapFillEvent>
Business task in order to fill the gaps between all the tasks of a
timesheet.
When the
When the
TimesheetGapFillEvent is launched the BT notices the call
and tries to fill the gaps between the timesheet tasks.Required fields:
- timesheet id
- shift ids
Error code:
- Since:
- 9.2
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcalculateDuration(Timesheet timesheet, PoolKit poolKit) protected voidcalculateWarnings(Timesheet timesheet, PoolKit poolKit) protected voidcheckGapFillerConditions(TimesheetEntitiesAggregate aggregate, PoolKit poolKit) Checks all conditions before gap filler.protected voidcheckTimesheetState(TimesheetEntitiesAggregate aggregate) Checks the timesheet state for this operation.protected voidexecute(TimesheetGapFillEvent event, PoolKit poolKit) protected TimesheetGapFillOutputgapFill(BOTask previousTask, BOTask nextTask, TimesheetEntitiesAggregate aggregate, BOTaskCategory gapFillerCategory, List<overit.geocallapp.wfm.util.timeline.TimeLineRange> activeShiftTaskRanges, PoolKit poolKit) protected LonggetMinutesDifference(Date from, Date to) getTaskToModify(List<overit.geocallapp.wfm.util.timeline.TimeLineRange> ranges, BOTask task, TimesheetEntitiesAggregate aggregate, Long gap) insertTask(Timesheet timesheet, Date startDate, Date endDate, BOTaskCategory gapFillerCategory, PoolKit poolKit) protected TimesheetEntitiesAggregateloadAggregate(Timesheet timesheet, PoolKit poolKit) It loads the timesheet aggregate object.protected BOTaskCategoryloadGapFillerCategory(PoolKit poolKit) protected BOTaskprotected TimesheetloadTimesheet(Long timesheetId, PoolKit poolKit) Loads theTimesheetfrom the given id.protected List<TimesheetGapFillOutput> shiftGapFill(TimesheetEntitiesAggregate aggregate, Long shiftId, BOTaskCategory gapFillerCategory, PoolKit poolKit) protected List<TimesheetGapFillOutput> timesheetGapFill(TimesheetEntitiesAggregate aggregate, Collection<Long> inputShifts, PoolKit poolKit) protected voidupdateTask(BOTask task, 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
-
BTTimesheetGapFill
public BTTimesheetGapFill()
-
-
Method Details
-
execute
protected void execute(TimesheetGapFillEvent event, PoolKit poolKit) throws DAException, DAValidateException - Specified by:
executein classBTTimesheet<TimesheetGapFillEvent>- Throws:
DAExceptionDAValidateException
-
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
-
checkGapFillerConditions
protected void checkGapFillerConditions(TimesheetEntitiesAggregate aggregate, PoolKit poolKit) throws DAValidateException, DAException Checks all conditions before gap filler.- 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
-
timesheetGapFill
protected List<TimesheetGapFillOutput> timesheetGapFill(TimesheetEntitiesAggregate aggregate, Collection<Long> inputShifts, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
loadGapFillerCategory
protected BOTaskCategory loadGapFillerCategory(PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
shiftGapFill
protected List<TimesheetGapFillOutput> shiftGapFill(TimesheetEntitiesAggregate aggregate, Long shiftId, BOTaskCategory gapFillerCategory, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
gapFill
protected TimesheetGapFillOutput gapFill(BOTask previousTask, BOTask nextTask, TimesheetEntitiesAggregate aggregate, BOTaskCategory gapFillerCategory, List<overit.geocallapp.wfm.util.timeline.TimeLineRange> activeShiftTaskRanges, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
getMinutesDifference
-
getTaskToModify
-
updateTask
- Throws:
DAValidateExceptionDAException
-
insertTask
protected List<BOTask> insertTask(Timesheet timesheet, Date startDate, Date endDate, BOTaskCategory gapFillerCategory, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
loadTask
- Throws:
DAValidateExceptionDAException
-
calculateDuration
protected void calculateDuration(Timesheet timesheet, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
calculateWarnings
protected void calculateWarnings(Timesheet timesheet, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-