Class BTResourceForecastCopy
java.lang.Object
overit.geocall.bl.BusinessTask<ResourceForecastCopyEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<ResourceForecastCopyEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<ResourceForecastCopyEvent>
overit.geocallapp.wfm.forecastcapacity.bl.forecast.resource.task.BTResourceForecastManagement<ResourceForecastCopyEvent>
overit.geocallapp.wfm.forecastcapacity.bl.forecast.resource.task.BTResourceForecastCopy
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(ResourceForecastCopyEvent.class)
public class BTResourceForecastCopy
extends BTResourceForecastManagement<ResourceForecastCopyEvent>
Business task in order to copy and paste a
When the
BOResourceForecastHeader object, alongside its own data. When the
ResourceForecastCopyEvent is launched the BT notices the call and inserts the BOResourceForecastHeader object
basing on the event's input, i.e. the resource 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 voidcopyDetails(Long copiedHeaderId, Long pastedHeaderId, List<Long> copiedResourcesIds, List<Long> pastedResourcesIds, PoolKit pk) Copies and pastes resources' details (i.e., calendars).protected voidCopies and pastes the resources' grouping constraints.protected voidcopyResources(Long copiedHeaderId, Long pastedHeaderId, PoolKit pk) Copies and pastes resources, skills, details and grouping constraints from the source header to the target header.protected voidcopySkills(List<Long> copiedResourcesIds, List<Long> pastedResourcesIds, Long pastedHeaderId, PoolKit pk) Copies and pastes resources' skills.protected voidexecute(ResourceForecastCopyEvent event, PoolKit pk) Executes a massive copy and paste of a givenBOResourceForecastHeaderobject.booleanDetermines whether the current state is valid for execution.protected voidValidates data before the insertion.Methods inherited from class overit.geocallapp.wfm.forecastcapacity.bl.forecast.resource.task.BTResourceForecastManagement
searchResourceForecastByCode, validateCodeDuplication, validateDates, validateFieldsLengthMethods 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
-
BTResourceForecastCopy
public BTResourceForecastCopy()
-
-
Method Details
-
isValidExecution
public boolean isValidExecution()Description copied from interface:ValidExecutionDetermines whether the current state is valid for execution.- Specified by:
isValidExecutionin interfaceValidExecution- Overrides:
isValidExecutionin classBTResourceForecastManagement<ResourceForecastCopyEvent>- Returns:
- true if execution is valid, false otherwise
-
execute
protected void execute(ResourceForecastCopyEvent event, PoolKit pk) throws DAException, DAValidateException Executes a massive copy and paste of a givenBOResourceForecastHeaderobject.- Specified by:
executein classValidExecutionBusinessTask<ResourceForecastCopyEvent>- Parameters:
event- theResourceForecastCopyEventeventpk- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validateAndCompleteInput
protected void validateAndCompleteInput(BOResourceForecastHeader input, PoolKit pk) throws DAValidateException, DAException Validates data before the insertion.- Parameters:
input- theBOResourceForecastHeaderto copy and pastepk- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException
-
copyResources
protected void copyResources(Long copiedHeaderId, Long pastedHeaderId, PoolKit pk) throws DAException, DAValidateException Copies and pastes resources, 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> copiedResourcesIds, List<Long> pastedResourcesIds, Long pastedHeaderId, PoolKit pk) throws DAValidateException, DAException Copies and pastes resources' skills.- Parameters:
copiedResourcesIds- the IDs of the copied resources, i.e. sourcepastedResourcesIds- the IDs of the pasted resources, i.e. targetpastedHeaderId- the ID of the resource forecast to paste, i.e. targetpk- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
copyDetails
protected void copyDetails(Long copiedHeaderId, Long pastedHeaderId, List<Long> copiedResourcesIds, List<Long> pastedResourcesIds, PoolKit pk) throws DAValidateException, DAException Copies and pastes resources' details (i.e., calendars).- Parameters:
copiedHeaderId- the ID of the resource forecast to copy, i.e. sourcepastedHeaderId- the ID of the resource forecast to paste, i.e. targetcopiedResourcesIds- the IDs of the copied resources, i.e. sourcepastedResourcesIds- the IDs of the pasted resources, i.e. targetpk- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
copyGroupingConstraints
protected void copyGroupingConstraints(List<Long> copiedResourcesIds, List<Long> pastedResourcesIds, PoolKit pk) throws DAValidateException, DAException Copies and pastes the resources' grouping constraints.- Parameters:
copiedResourcesIds- the IDs of the copied resources, i.e. sourcepastedResourcesIds- the IDs of the pasted resources, i.e. targetpk- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-