Class BTTimesheetActualDurationUpdate
java.lang.Object
overit.geocall.bl.BusinessTask<TimesheetActualDurationUpdateEvent>
overit.geocallapp.wfm.core.bl.timesheet.task.BTTimesheet<TimesheetActualDurationUpdateEvent>
overit.geocallapp.wfm.core.bl.timesheet.task.BTTimesheetActualDurationUpdate
- All Implemented Interfaces:
Serializable,Tool
@Event(TimesheetActualDurationUpdateEvent.class)
public class BTTimesheetActualDurationUpdate
extends BTTimesheet<TimesheetActualDurationUpdateEvent>
Business task in order to calculate all the actual durations of the tasks of a timesheet.
When the
TimesheetActualDurationUpdateEvent is launched the BT notices the call and calculates all the BOTask.actualDuration
of the timesheet tasks basing on the event's input.- Since:
- 9.2
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidexecute(TimesheetActualDurationUpdateEvent event, PoolKit poolKit) Performs the actual duration of all tasks of the given timesheet.getOldActualDurations(Timesheet timesheet) Returns the old actual duration of the tasks.protected booleanisActualDurationChanged(BOTask task, Map<Long, Long> oldActualDurations) Returnstrueif the task actual duration is changed,falseotherwise.protected TimesheetEntitiesAggregateloadAggregate(Timesheet timesheet, PoolKit poolKit) It loads the timesheet aggregate object.protected BOTaskLoads aBOTask.protected voidresetActualDuration(Timesheet timesheet) Reset actual duration for all timesheet tasks.protected voidupdateRangeTasks(overit.geocallapp.wfm.util.timeline.TimeLineRange range, TimesheetEntitiesAggregate aggregate) Updates the tasks included in a range.protected voidUpdates the timesheet tasks.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
-
BTTimesheetActualDurationUpdate
public BTTimesheetActualDurationUpdate()
-
-
Method Details
-
execute
protected void execute(TimesheetActualDurationUpdateEvent event, PoolKit poolKit) throws DAException, DAValidateException Performs the actual duration of all tasks of the given timesheet.- Specified by:
executein classBTTimesheet<TimesheetActualDurationUpdateEvent>- Parameters:
event- theTimesheetActualDurationUpdateEventpoolKit- the pool kit- 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
-
getOldActualDurations
Returns the old actual duration of the tasks.- Parameters:
timesheet- the givenTimesheet- Returns:
- the old actual duration of the tasks
-
resetActualDuration
Reset actual duration for all timesheet tasks.- Parameters:
timesheet- the givenTimesheet
-
updateRangeTasks
protected void updateRangeTasks(overit.geocallapp.wfm.util.timeline.TimeLineRange range, TimesheetEntitiesAggregate aggregate) Updates the tasks included in a range.- Parameters:
range- the rangeaggregate- the timesheet aggregate
-
updateTasks
protected void updateTasks(Timesheet timesheet, Map<Long, Long> oldActualDurations, PoolKit poolKit) throws DAValidateException, DAExceptionUpdates the timesheet tasks.- Parameters:
timesheet- the givenTimesheetoldActualDurations- the old actual duration of the taskspoolKit- the pool kit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
isActualDurationChanged
Returnstrueif the task actual duration is changed,falseotherwise.- Parameters:
task- the given taskoldActualDurations- the old actual duration of the tasks- Returns:
trueif the task actual duration is changed,falseotherwise
-
loadTask
Loads aBOTask.- Parameters:
taskId- the task idpoolKit- the pool kit- Returns:
- the
BOTaskwith the given id - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-