Class BTTimesheetTaskInsert
java.lang.Object
overit.geocall.bl.BusinessTask<TimesheetTaskInsertEvent>
overit.geocallapp.wfm.core.bl.timesheet.task.BTTimesheet<TimesheetTaskInsertEvent>
overit.geocallapp.wfm.core.bl.timesheet.task.BTTimesheetTaskInsert
- All Implemented Interfaces:
Serializable,Tool
@Event(TimesheetTaskInsertEvent.class)
public class BTTimesheetTaskInsert
extends BTTimesheet<TimesheetTaskInsertEvent>
Business task in order to insert a
When the
BOTask into a timesheet. When the
TimesheetTaskInsertEvent 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
Required fields:
- start date
- category
Error code:
Codes.Timesheet.Validation.TIMESHEET_NOT_EDITABLECodes.Timesheet.Validation.END_DATE_EARLIER_START_DATE;Codes.Timesheet.Validation.FUTURE_INSERTION_NOT_AVAILABLE;Codes.Timesheet.Validation.INTERVENTION_REQUIRED;Codes.Timesheet.Validation.MOBILE_CREATION_NOT_ALLOWED;Codes.Timesheet.Validation.SERVER_CREATION_NOT_ALLOWED;Codes.Timesheet.Validation.TIMESHEET_NOT_INCLUDE_DATES;Codes.Timesheet.Validation.UNAVAILABILITY_REASON_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 BOEventEntitycreateEventEntity(Long intervention) protected BOTaskcreateTask(Timesheet timesheet, TimesheetTaskInsertInput input, TimesheetShiftCalculationOutput taskShift, PoolKit poolKit) protected voidexecute(TimesheetTaskInsertEvent event, PoolKit poolKit) protected TimesheetgetTimesheet(Long timesheetId, Long user, Date referenceDate, PoolKit poolKit) protected LonginsertEventEntity(BOEventEntity eventEntity, PoolKit poolKit) protected LonginsertTask(BOTask task, PoolKit poolKit) insertTimesheetTasks(Timesheet timesheet, TimesheetTaskInsertInput input, Date startDate, Date endDate, PoolKit poolKit) protected voidupdateLinkedTasks(List<BOTask> tasks, PoolKit poolKit) protected voidupdateTask(BOTask task, PoolKit poolKit) protected voidvalidateData(TimesheetTaskInsertInput input, Timesheet timesheet, 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
-
BTTimesheetTaskInsert
public BTTimesheetTaskInsert()
-
-
Method Details
-
execute
protected void execute(TimesheetTaskInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException - Specified by:
executein classBTTimesheet<TimesheetTaskInsertEvent>- Throws:
DAExceptionDAValidateException
-
getTimesheet
protected Timesheet getTimesheet(Long timesheetId, Long user, Date referenceDate, 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(TimesheetTaskInsertInput input, Timesheet timesheet, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
insertTimesheetTasks
protected List<BOTask> insertTimesheetTasks(Timesheet timesheet, TimesheetTaskInsertInput 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, TimesheetTaskInsertInput input, TimesheetShiftCalculationOutput taskShift, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
createEventEntity
-
insertEventEntity
protected Long insertEventEntity(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, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
updateTask
- Throws:
DAValidateExceptionDAException
-