Class BTForecastShiftModelCopy
java.lang.Object
overit.geocall.bl.BusinessTask<ForecastShiftModelCopyEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<ForecastShiftModelCopyEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<ForecastShiftModelCopyEvent>
overit.geocallapp.wfm.forecastcapacity.bl.forecast.resource.shiftmodel.task.BTForecastShiftModelCopy
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(ForecastShiftModelCopyEvent.class)
public class BTForecastShiftModelCopy
extends ValidPermissionBusinessTask<ForecastShiftModelCopyEvent>
Business task in order to copy a
When the
BOForecastShiftModel object. When the
ForecastShiftModelCopyEvent is launched the BT notices the
call and copies the BOForecastShiftModel and all related BOForecastShiftModelDetail objects
basing on the event's input. Required fields:
- Id
- Code
- Description
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 voidcopyForecastShiftModelDetailRows(Long forecastShiftModelToCopyId, Long forecastShiftModelCopiedId, PoolKit poolKit) Copy all forecast shift model detail rows.protected voidexecute(ForecastShiftModelCopyEvent event, PoolKit poolKit) Copies the givenBOForecastShiftModeland writes the newly generated id into the event journal.protected List<BOForecastShiftModelDetail> getForecastShiftModelDetails(Long forecastShiftModelId, PoolKit poolKit) Get the list of forecast shift model detail.protected LonginsertForecastShiftModel(BOForecastShiftModel forecastShiftModel, PoolKit poolKit) Insert a new forecast shift model.booleanDetermines whether the current state is valid for execution.protected voidupdateForecastShiftModelDetail(BOForecastShiftModelDetail forecastShiftModelDetail, PoolKit poolKit) Update an existing forecast shift model detail.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 pk) Validates the data before the copy.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
-
BTForecastShiftModelCopy
public BTForecastShiftModelCopy()
-
-
Method Details
-
execute
protected void execute(ForecastShiftModelCopyEvent event, PoolKit poolKit) throws DAException, DAValidateException Copies the givenBOForecastShiftModeland writes the newly generated id into the event journal. It also copies all relatedBOForecastShiftModelDetail.- Specified by:
executein classValidExecutionBusinessTask<ForecastShiftModelCopyEvent>- Parameters:
event- theForecastShiftModelCopyEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validateInput
protected void validateInput(BOForecastShiftModel input, PoolKit pk) throws DAValidateException, DAException Validates the data before the copy.- Parameters:
input- theBOForecastShiftModelto copy- Throws:
DAValidateException- the DA validate exceptionDAException
-
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
-
copyForecastShiftModelDetailRows
protected void copyForecastShiftModelDetailRows(Long forecastShiftModelToCopyId, Long forecastShiftModelCopiedId, PoolKit poolKit) throws DAException, DAValidateException Copy all forecast shift model detail rows.- Parameters:
forecastShiftModelToCopyId- theBOForecastShiftModelto copy idforecastShiftModelCopiedId- theBOForecastShiftModelcopied idpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
getForecastShiftModelDetails
protected List<BOForecastShiftModelDetail> getForecastShiftModelDetails(Long forecastShiftModelId, PoolKit poolKit) throws DAException, DAValidateException Get the list of forecast shift model detail.- Parameters:
forecastShiftModelId- theBOForecastShiftModelidpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
insertForecastShiftModel
protected Long insertForecastShiftModel(BOForecastShiftModel forecastShiftModel, PoolKit poolKit) throws DAException, DAValidateException Insert a new forecast shift model.- Parameters:
forecastShiftModel- theBOForecastShiftModelpoolKit- thePoolKit- Returns:
- id of the new forecast shift model
- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
updateForecastShiftModelDetail
protected void updateForecastShiftModelDetail(BOForecastShiftModelDetail forecastShiftModelDetail, PoolKit poolKit) throws DAException, DAValidateException Update an existing forecast shift model detail.- Parameters:
forecastShiftModelDetail- theBOForecastShiftModelDetailpoolKit- 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
-