Class BTTimesheetAutomaticTaskInsert
java.lang.Object
overit.geocall.bl.BusinessTask<TimesheetAutomaticTaskInsertEvent>
overit.geocallapp.wfm.core.bl.timesheet.task.BTTimesheet<TimesheetAutomaticTaskInsertEvent>
overit.geocallapp.wfm.core.bl.timesheet.task.BTTimesheetAutomaticTaskInsert
- All Implemented Interfaces:
Serializable,Tool
@Event(TimesheetAutomaticTaskInsertEvent.class)
public class BTTimesheetAutomaticTaskInsert
extends BTTimesheet<TimesheetAutomaticTaskInsertEvent>
Business task in order to insert an automatic
When the
BOTask into a
timesheet. When the
TimesheetAutomaticTaskInsertEvent is launched the BT notices
the call and performs these actions:
- loads the timesheet and possibly inserts a new one
- checks the input data
- inserts a new task into timesheet
- calculates the actual duration of all timesheet tasks
- calculates the timesheet warnings
Error Code:
Codes.Timesheet.Validation.TIMESHEET_NOT_EDITABLECodes.Timesheet.Validation.END_DATE_EARLIER_START_DATECodes.Timesheet.Validation.SERVER_CREATION_NOT_ALLOWEDCodes.Timesheet.Validation.MOBILE_CREATION_NOT_ALLOWEDCodes.Timesheet.Validation.FUTURE_INSERTION_NOT_AVAILABLECodes.Timesheet.Validation.UNAVAILABILITY_REASON_REQUIREDCodes.Timesheet.Validation.INTERVENTION_REQUIRED
- Since:
- 9.2
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcalculateDuration(Timesheet timesheet, PoolKit poolKit) protected List<TimesheetShiftCalculationOutput> calculateTaskShifts(Timesheet timesheet, Date startDate, Date endDate, PoolKit poolKit) protected voidcalculateWarnings(Timesheet timesheet, PoolKit poolKit) protected voidcheckTimesheetState(Timesheet timesheet) Checks the timesheet state for this operation.protected BOTaskcreateTask(Timesheet timesheet, TimesheetAutomaticTaskInsertInput input, TimesheetShiftCalculationOutput taskShift, PoolKit poolKit) protected voidexecute(TimesheetAutomaticTaskInsertEvent event, PoolKit poolKit) protected DategetTaskEndDate(TimesheetAutomaticTaskInsertInput input, TimesheetShiftCalculationOutput taskShift, BOEventEntity eventEntity, PoolKit poolKit) protected DategetTaskStartDate(TimesheetAutomaticTaskInsertInput input, TimesheetShiftCalculationOutput taskShift, BOEventEntity eventEntity, PoolKit poolKit) protected TimesheetgetTimesheet(Long user, Date referenceDate, TimesheetTaskEventCache cache, PoolKit poolKit) protected LonggetUnavailabilityReason(TimesheetAutomaticTaskInsertInput input, BOEventEntity eventEntity, PoolKit poolKit) protected voidinsertEventEntity(BOEventEntity eventEntity, PoolKit poolKit) protected LonginsertTask(BOTask task, PoolKit poolKit) insertTimesheetTasks(Timesheet timesheet, TimesheetAutomaticTaskInsertInput input, Date startDate, Date endDate, PoolKit poolKit) protected booleanisDailyAbsence(TimesheetAutomaticTaskInsertInput input, BOEventEntity eventEntity, PoolKit poolKit) protected voidupdateLinkedTasks(List<BOTask> tasks, TimesheetTaskEventCache cache, PoolKit poolKit) protected voidupdateTask(BOTask task, PoolKit poolKit) protected voidvalidateData(TimesheetAutomaticTaskInsertInput input, 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
-
BTTimesheetAutomaticTaskInsert
public BTTimesheetAutomaticTaskInsert()
-
-
Method Details
-
execute
protected void execute(TimesheetAutomaticTaskInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException - Specified by:
executein classBTTimesheet<TimesheetAutomaticTaskInsertEvent>- Throws:
DAExceptionDAValidateException
-
insertEventEntity
protected void insertEventEntity(BOEventEntity eventEntity, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
getTimesheet
protected Timesheet getTimesheet(Long user, Date referenceDate, TimesheetTaskEventCache cache, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
checkTimesheetState
Checks the timesheet state for this operation.- Parameters:
timesheet- the givenTimesheet- Throws:
DAValidateException
-
validateData
protected void validateData(TimesheetAutomaticTaskInsertInput input, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
insertTimesheetTasks
protected List<BOTask> insertTimesheetTasks(Timesheet timesheet, TimesheetAutomaticTaskInsertInput input, Date startDate, Date endDate, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
calculateTaskShifts
protected List<TimesheetShiftCalculationOutput> calculateTaskShifts(Timesheet timesheet, Date startDate, Date endDate, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
createTask
protected BOTask createTask(Timesheet timesheet, TimesheetAutomaticTaskInsertInput input, TimesheetShiftCalculationOutput taskShift, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
getTaskStartDate
protected Date getTaskStartDate(TimesheetAutomaticTaskInsertInput input, TimesheetShiftCalculationOutput taskShift, BOEventEntity eventEntity, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
getTaskEndDate
protected Date getTaskEndDate(TimesheetAutomaticTaskInsertInput input, TimesheetShiftCalculationOutput taskShift, BOEventEntity eventEntity, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
isDailyAbsence
protected boolean isDailyAbsence(TimesheetAutomaticTaskInsertInput input, BOEventEntity eventEntity, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
insertTask
- 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
-
updateLinkedTasks
protected void updateLinkedTasks(List<BOTask> tasks, TimesheetTaskEventCache cache, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
updateTask
- Throws:
DAValidateExceptionDAException
-