Class BTActivityForecastCopy
java.lang.Object
overit.geocall.bl.BusinessTask<ActivityForecastCopyEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<ActivityForecastCopyEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<ActivityForecastCopyEvent>
overit.geocallapp.wfm.forecastcapacity.bl.forecast.activity.task.BTActivityForecastCopy
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(ActivityForecastCopyEvent.class)
public class BTActivityForecastCopy
extends ValidPermissionBusinessTask<ActivityForecastCopyEvent>
Business task in order to copy and paste a
When the
BOActivityForecastHeader object, alongside its own data. When the
ActivityForecastCopyEvent is launched the BT notices the call and inserts the BOActivityForecastHeader object
basing on the event's input, i.e. the activity forecast to be copied. Required fields:
- 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 voidcopyActivities(Long copiedHeaderId, Long pastedHeaderId, PoolKit pk) Copies and pastes activities, skills, details and grouping constraints from the source header to the target header.protected voidcopyActivityImportFilters(Long copiedHeaderId, Long pastedHeaderId, PoolKit pk) Copies and pastes activity import filters.protected voidcopyCalendars(Long copiedHeaderId, Long pastedHeaderId, List<Long> copiedActivitiesIds, List<Long> pastedActivitiesIds, PoolKit pk) Copies and pastes activities' details (i.e., calendars).protected voidcopySkills(List<Long> copiedActivitiesIds, List<Long> pastedActivitiesIds, Long pastedHeaderId, PoolKit pk) Copies and pastes activities' skills.protected voidexecute(ActivityForecastCopyEvent event, PoolKit pk) Executes a massive copy and paste of a givenBOActivityForecastHeaderobject.booleanDetermines whether the current state is valid for execution.protected voidvalidateAndCompleteInput(BOActivityForecastHeader input, PoolKit poolKit) Validates the data before the insertion.protected voidvalidateCode(String code, PoolKit poolKit) Validates code's uniqueness.protected voidvalidateFieldsLength(BOActivityForecastHeader input, PoolKit pk) Validates the fields' length of theBOActivityForecastHeaderinput to be checked.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
-
BTActivityForecastCopy
public BTActivityForecastCopy()
-
-
Method Details
-
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
-
execute
protected void execute(ActivityForecastCopyEvent event, PoolKit pk) throws DAException, DAValidateException Executes a massive copy and paste of a givenBOActivityForecastHeaderobject.- Specified by:
executein classValidExecutionBusinessTask<ActivityForecastCopyEvent>- Parameters:
event- theActivityForecastCopyEventeventpk- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validateAndCompleteInput
protected void validateAndCompleteInput(BOActivityForecastHeader input, PoolKit poolKit) throws DAException, DAValidateException Validates the data before the insertion.- Parameters:
input- theBOActivityForecastHeaderto copy and pastepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException
-
validateCode
Validates code's uniqueness. The validation's scope is the forecast header.- Parameters:
code- the code to checkpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException
-
validateFieldsLength
protected void validateFieldsLength(BOActivityForecastHeader input, PoolKit pk) throws DAException, DAValidateException Validates the fields' length of theBOActivityForecastHeaderinput to be checked. Code's length must not exceed 50 characters and the description's length must not exceed 255 characters.- Parameters:
input- theBOActivityForecastHeaderinput to be checkedpk- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException
-
copyActivities
protected void copyActivities(Long copiedHeaderId, Long pastedHeaderId, PoolKit pk) throws DAException, DAValidateException Copies and pastes activities, skills, details and grouping constraints from the source header to the target header.- Parameters:
copiedHeaderId- the ID of the source headerpastedHeaderId- the ID of the target headerpk- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
copySkills
protected void copySkills(List<Long> copiedActivitiesIds, List<Long> pastedActivitiesIds, Long pastedHeaderId, PoolKit pk) throws DAValidateException, DAException Copies and pastes activities' skills.- Parameters:
copiedActivitiesIds- the IDs of the copied activities, i.e. sourcepastedActivitiesIds- the IDs of the pasted activities, i.e. targetpastedHeaderId- the ID of the target headerpk- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
copyCalendars
protected void copyCalendars(Long copiedHeaderId, Long pastedHeaderId, List<Long> copiedActivitiesIds, List<Long> pastedActivitiesIds, PoolKit pk) throws DAValidateException, DAException Copies and pastes activities' details (i.e., calendars). It also copies and pastes, for each activity detail, its grouping constraint.- Parameters:
copiedHeaderId- the ID of the activity forecast to copy, i.e. sourcepastedHeaderId- the ID of the activity forecast to paste, i.e. targetcopiedActivitiesIds- the IDs of the copied activities, i.e. sourcepastedActivitiesIds- the IDs of the pasted activities, i.e. targetpk- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
copyActivityImportFilters
protected void copyActivityImportFilters(Long copiedHeaderId, Long pastedHeaderId, PoolKit pk) throws DAException, DAValidateException Copies and pastes activity import filters.- Parameters:
copiedHeaderId- the ID of the source headerpastedHeaderId- the ID of the target headerpk- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-