Class BTForecastResourceDetailManagement<I>
java.lang.Object
overit.geocall.bl.BusinessTask<I>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<I>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<I>
overit.geocallapp.wfm.forecastcapacity.bl.forecast.resource.detail.task.BTForecastResourceDetailManagement<I>
- Type Parameters:
I- the generic type
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
- Direct Known Subclasses:
BTForecastResourceDetailApplyTemplate,BTForecastResourceDetailBuild,BTForecastResourceDetailEdit,BTForecastResourceDetailInsert,BTForecastResourceDetailUpdate
Generic business task for Forecast Resource Detail entities.
Before executing its purpose, the task checks whether the Forecast Management module is active and if the current user has the required permissions
Before executing its purpose, the task checks whether the Forecast Management module is active and if the current user has the required permissions
- Since:
- 15.0
- See Also:
- GCApi:
- task
-
Field Summary
Fields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckResourceWorktimeValidity(Long workDuration, Long maxOvertime, Long unavailability, Long unusableTime) booleancheckResourceWorktimeValidity(ForecastResourceDetailBuildPreview aggregatedPeriod) protected BOResourceForecastHeadergetForecastHeader(Long forecastHeaderId, PoolKit pk) protected LonggetNewValue(boolean updateValue, Long updateMode, Long oldValue, Long newValue) protected ForecastResourceDetailBuildPreviewgetResourceBuildPreview(BOForecastResourceDetail oldWorkshiftBO, BOForecastResourceDetail newWorkshiftBO) Create a ForecastResourceDetailBuildPreview with the old and the new values of work duration, unavailability, unusable time and overtimebooleanDetermines whether the current state is valid for execution.protected BOForecastResourceDetailsearchWorkshift(Long forecastHeader, Long resourceId, Date day, PoolKit pk) Search theBOForecastResourceDetailfor the day and the resourceprotected voidvalidateDates(Date forecastHeaderStartDate, Date forecastHeaderEndDate, Date inputStartDate, Date inputEndDate) protected voidvalidateInput(Long resourceForecastHeaderId, Long forecastResourceId, Long forecastStateId) Validates the input.protected LongzeroOrNegativeToNull(Long value) Methods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
checkValidExecution, getException, throwExceptionIfInvalidMethods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask
body, execute, getEventMethods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTForecastResourceDetailManagement
public BTForecastResourceDetailManagement()
-
-
Method Details
-
validateInput
protected void validateInput(Long resourceForecastHeaderId, Long forecastResourceId, Long forecastStateId) throws DAValidateException Validates the input.- Parameters:
resourceForecastHeaderId- the resource forecast header idforecastResourceId- the forecast resource idforecastStateId- the forecast state id- Throws:
DAValidateException- the DA validate exception
-
validateDates
protected void validateDates(Date forecastHeaderStartDate, Date forecastHeaderEndDate, Date inputStartDate, Date inputEndDate) throws DAValidateException - Throws:
DAValidateException
-
getForecastHeader
protected BOResourceForecastHeader getForecastHeader(Long forecastHeaderId, PoolKit pk) throws DAException, DAValidateException - Throws:
DAExceptionDAValidateException
-
searchWorkshift
protected BOForecastResourceDetail searchWorkshift(Long forecastHeader, Long resourceId, Date day, PoolKit pk) throws DAException, DAValidateException Search theBOForecastResourceDetailfor the day and the resource- Parameters:
resourceId- the resourceday- the daypk- thePoolKit- Returns:
- the
BOForecastResourceDetail - Throws:
DAExceptionDAValidateException
-
isValidExecution
public boolean isValidExecution()Description copied from interface:ValidExecutionDetermines whether the current state is valid for execution.- Returns:
- true if execution is valid, false otherwise
-
getNewValue
- Parameters:
updateValue- this flag indicates if the field must be replaced or if you want to keep the old valueupdateMode- the update mode: 1 -> Replace, 2 -> Increment, 3 -> DecrementoldValue- the value currently saved to DBnewValue- the value to write- Returns:
-
zeroOrNegativeToNull
- Parameters:
value- the input value- Returns:
- the value if it is greater than 0 otherwise null
-
getResourceBuildPreview
protected ForecastResourceDetailBuildPreview getResourceBuildPreview(BOForecastResourceDetail oldWorkshiftBO, BOForecastResourceDetail newWorkshiftBO) Create a ForecastResourceDetailBuildPreview with the old and the new values of work duration, unavailability, unusable time and overtime- Parameters:
oldWorkshiftBO- the oldBOForecastResourceDetailnewWorkshiftBO- the newBOForecastResourceDetail- Returns:
-
checkResourceWorktimeValidity
-
checkResourceWorktimeValidity
public void checkResourceWorktimeValidity(Long workDuration, Long maxOvertime, Long unavailability, Long unusableTime) throws DAValidateException - Throws:
DAValidateException
-