Class BTForecastShiftModelInsert
java.lang.Object
overit.geocall.bl.BusinessTask<ForecastShiftModelInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<ForecastShiftModelInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<ForecastShiftModelInsertEvent>
overit.geocallapp.wfm.forecastcapacity.bl.forecast.resource.shiftmodel.task.BTForecastShiftModelInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(ForecastShiftModelInsertEvent.class)
public class BTForecastShiftModelInsert
extends ValidPermissionBusinessTask<ForecastShiftModelInsertEvent>
Business task in order to insert a
When the
BOForecastShiftModel. When the
ForecastShiftModelInsertEvent is launched the BT notices the
call and inserts the BOForecastShiftModel basing on the event's input. Required fields:
- Code
- Description
- Duration
- Active
Permission:
Error Code:
- 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 TypeMethodDescriptionprotected voidexecute(ForecastShiftModelInsertEvent event, PoolKit poolKit) Inserts the givenBOForecastShiftModeland writes the newly generated id into the event journal.protected voidinsertForecastShiftModelDetail(Long forecastShiftModel, Long sequentialNumber, PoolKit poolKit) Insert a new forecast shift model detail.protected voidinsertForecastShiftModelDetailRows(Long forecastShiftModel, Long duration, PoolKit poolKit) Insert all forecast shift model detail rows.booleanDetermines whether the current state is valid for execution.protected voidvalidateCode(String code, PoolKit poolKit) Validates the code: must be mandatory and unique.protected voidvalidateDuration(Long duration, Long startingDay) Validates the duration: must be mandatory, greater than zero and less equal than MAX_NUMBER_DAYS.protected voidvalidateFieldsLength(BOForecastShiftModel input, PoolKit pk) Validates the fields' length of theBOForecastShiftModelinput to be checked : code's length must not exceed 50 characters and the description's length must not exceed 255 characters.protected voidvalidateInput(BOForecastShiftModel input, PoolKit poolKit) Validates the data before the insertion.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, getEventMethods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTForecastShiftModelInsert
public BTForecastShiftModelInsert()
-
-
Method Details
-
execute
protected void execute(ForecastShiftModelInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Inserts the givenBOForecastShiftModeland writes the newly generated id into the event journal. It also insertsBOForecastShiftModelDetailobjects in a number equal to the value of the "duration" field.- Specified by:
executein classValidExecutionBusinessTask<ForecastShiftModelInsertEvent>- Parameters:
event- theForecastShiftModelInsertEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validateInput
protected void validateInput(BOForecastShiftModel input, PoolKit poolKit) throws DAException, DAValidateException Validates the data before the insertion.- Parameters:
input- theBOForecastShiftModelto insertpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validateDuration
Validates the duration: must be mandatory, greater than zero and less equal than MAX_NUMBER_DAYS. If startingDay is not null, the duration must be a multiple of 7.- Parameters:
duration- the duration to checkstartingDay- the starting day- Throws:
DAValidateException- the DA validate exception
-
validateCode
Validates the code: must be mandatory and unique.- Parameters:
code- the code to checkpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validateFieldsLength
protected void validateFieldsLength(BOForecastShiftModel input, PoolKit pk) throws DAException, DAValidateException Validates the fields' length of theBOForecastShiftModelinput to be checked : code's length must not exceed 50 characters and the description's length must not exceed 255 characters.- Parameters:
input- theBOForecastShiftModelinput to be checkedpk- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException
-
insertForecastShiftModelDetailRows
protected void insertForecastShiftModelDetailRows(Long forecastShiftModel, Long duration, PoolKit poolKit) throws DAException, DAValidateException Insert all forecast shift model detail rows.- Parameters:
forecastShiftModel- theBOForecastShiftModelidduration- the durationpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
insertForecastShiftModelDetail
protected void insertForecastShiftModelDetail(Long forecastShiftModel, Long sequentialNumber, PoolKit poolKit) throws DAException, DAValidateException Insert a new forecast shift model detail.- Parameters:
forecastShiftModel- theBOForecastShiftModelidsequentialNumber- the sequential numberpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
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
-