Class BTForecastActivityDetailInsertFromWo
java.lang.Object
overit.geocall.bl.BusinessTask<ForecastActivityDetailFromWoInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<ForecastActivityDetailFromWoInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<ForecastActivityDetailFromWoInsertEvent>
overit.geocallapp.wfm.forecastcapacity.bl.forecast.activity.detail.task.BTForecastActivityDetailInsertManagement<ForecastActivityDetailFromWoInsertEvent>
overit.geocallapp.wfm.forecastcapacity.bl.forecast.activity.detail.task.BTForecastActivityDetailInsertFromWo
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(ForecastActivityDetailFromWoInsertEvent.class)
public class BTForecastActivityDetailInsertFromWo
extends BTForecastActivityDetailInsertManagement<ForecastActivityDetailFromWoInsertEvent>
Business task in order to insert a
When the
BOForecastActivityDetail from a list of BOWorkLoadDistribution. When the
ForecastActivityDetailFromWoInsertEvent is launched the BT notices the
call and inserts the BOForecastActivityDetail basing on the event's input. Required fields:
- Activity Forecast Header
- Forecast Activity
- Start Date
- End Date
- Expected Duration
Permission:
- Since:
- 19.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(ForecastActivityDetailFromWoInsertEvent event, PoolKit poolKit) Inserts the givenBOForecastActivityDetailid into the event journal.protected BOForecastActivityPriorityfindDefaultPriority(PoolKit poolKit) Finds the default priority to be used for imported timeframes.protected LonggetActivityId(BOWorkLoadDistribution workLoadDistribution) Returns the id of theBOForecastActivityassociated to the givenBOWorkLoadDistribution.protected voidinsertForecastActivity(Collection<BOWorkLoadDistribution> workLoadDistributions, Long forecastHeaderId, PoolKit poolKit) Inserts the givenBOForecastActivitybefore the insertion of theBOForecastActivityDetail.protected voidinsertForecastActivityDetailBatch(Collection<BOWorkLoadDistribution> workLoadDistributions, Long forecastHeaderId, BOForecastActivityPriority defaultPriority, PoolKit poolKit) Inserts the givenBOWorkLoadDistributionas a batch ofBOForecastActivityDetail.booleanDetermines whether the current state is valid for execution.protected List<BOForecastActivity> searchForecastActivity(Set<String> activities, Long forecastHeaderId, PoolKit poolKit) Searches for the givenBOForecastActivity.Methods inherited from class overit.geocallapp.wfm.forecastcapacity.bl.forecast.activity.detail.task.BTForecastActivityDetailInsertManagement
validateAndCompleteInputMethods 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
-
BTForecastActivityDetailInsertFromWo
public BTForecastActivityDetailInsertFromWo()
-
-
Method Details
-
execute
protected void execute(ForecastActivityDetailFromWoInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Inserts the givenBOForecastActivityDetailid into the event journal.- Specified by:
executein classValidExecutionBusinessTask<ForecastActivityDetailFromWoInsertEvent>- Parameters:
event- theForecastActivityDetailInsertEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
insertForecastActivity
protected void insertForecastActivity(Collection<BOWorkLoadDistribution> workLoadDistributions, Long forecastHeaderId, PoolKit poolKit) throws DAValidateException, DAException Inserts the givenBOForecastActivitybefore the insertion of theBOForecastActivityDetail.- Parameters:
workLoadDistributions- the work load distributionsforecastHeaderId- the forecast header's idpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
searchForecastActivity
protected List<BOForecastActivity> searchForecastActivity(Set<String> activities, Long forecastHeaderId, PoolKit poolKit) throws DAValidateException, DAException Searches for the givenBOForecastActivity.- Parameters:
activities- the activities to search forpoolKit- thePoolKit- Returns:
- a list of
BOForecastActivitycontaining the given activities - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
insertForecastActivityDetailBatch
protected void insertForecastActivityDetailBatch(Collection<BOWorkLoadDistribution> workLoadDistributions, Long forecastHeaderId, BOForecastActivityPriority defaultPriority, PoolKit poolKit) throws DAException, DAValidateException Inserts the givenBOWorkLoadDistributionas a batch ofBOForecastActivityDetail.- Parameters:
workLoadDistributions- theBOWorkLoadDistributionto insertforecastHeaderId- the id of theBOActivityForecastHeaderthat contains the givenBOWorkLoadDistributionpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
getActivityId
Returns the id of theBOForecastActivityassociated to the givenBOWorkLoadDistribution.- Parameters:
workLoadDistribution- theBOWorkLoadDistributionto get the id from- Returns:
- the id of the
BOForecastActivity
-
isValidExecution
public boolean isValidExecution()Description copied from interface:ValidExecutionDetermines whether the current state is valid for execution.- Specified by:
isValidExecutionin interfaceValidExecution- Overrides:
isValidExecutionin classBTForecastActivityDetailInsertManagement<ForecastActivityDetailFromWoInsertEvent>- Returns:
- true if execution is valid, false otherwise
-
findDefaultPriority
protected BOForecastActivityPriority findDefaultPriority(PoolKit poolKit) throws DAException, DAValidateException Finds the default priority to be used for imported timeframes.- Parameters:
poolKit- the pool kit- Returns:
- the default priority, or null if no default priority is configured
- Throws:
DAException- if a database error occursDAValidateException- if a validation error occurs
-