Class BTBundleHeaderStatusUpdate
java.lang.Object
overit.geocall.bl.BusinessTask<BundleHeaderStatusUpdateEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<BundleHeaderStatusUpdateEvent>
overit.geocallapp.wfm.bundler.bl.task.BTBundler<BundleHeaderStatusUpdateEvent>
overit.geocallapp.wfm.bundler.bl.header.task.BTBundleHeaderStatusUpdate
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(BundleHeaderStatusUpdateEvent.class)
public class BTBundleHeaderStatusUpdate
extends BTBundler<BundleHeaderStatusUpdateEvent>
Business task in order to update the status of a
When the
BOBundleHeader. When the
BundleHeaderStatusUpdateEvent is launched the BT notices the
call and updates the status of the BOBundleHeader basing on the
event's input and the related rules. Error Code:
- Since:
- 10.1
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckValidStatus(Long newStatus, Long oldStatus) Checks whether theBundlestatus change is permitted and therefore if the update can be executed or not.protected voidexecute(BundleHeaderStatusUpdateEvent event, PoolKit poolKit) Updates theBOBundleHeaderonly if the givenBundleHeaderStatusUpdateInputcontains a permitted change of status.protected BundleloadBundle(Long bundleId, PoolKit poolKit) Loads theBundlerelated to the given id.protected voidnotifyStatusChange(Bundle bundle, PoolKit poolKit) Notifies theBundleHeaderStatusUpdateEventby calling theBundleNotificationEvent.Prepares the filter in order to correctly load theBOBundleHeaderto update.Prepares the data to update, i.e. the value of the new status for theBOBundleHeader.protected voidupdate(BundleHeaderStatusUpdateInput input, PoolKit poolKit) Performs the update of theBOBundleHeaderwith the validated change of status.Methods inherited from class overit.geocallapp.wfm.bundler.bl.task.BTBundler
getException, isValidExecution, throwExceptionIfInvalidMethods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask
body, checkValidExecution, getEventMethods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTBundleHeaderStatusUpdate
public BTBundleHeaderStatusUpdate()
-
-
Method Details
-
execute
protected void execute(BundleHeaderStatusUpdateEvent event, PoolKit poolKit) throws DAException, DAValidateException Updates theBOBundleHeaderonly if the givenBundleHeaderStatusUpdateInputcontains a permitted change of status.- Specified by:
executein classValidExecutionBusinessTask<BundleHeaderStatusUpdateEvent>- Parameters:
event- theBundleHeaderStatusUpdateEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
update
protected void update(BundleHeaderStatusUpdateInput input, PoolKit poolKit) throws DAException, DAValidateException Performs the update of theBOBundleHeaderwith the validated change of status.- Parameters:
input- the givenBundleHeaderStatusUpdateInputcontaining all the needed bundle header datapoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
checkValidStatus
Checks whether theBundlestatus change is permitted and therefore if the update can be executed or not.- Parameters:
newStatus- the new bundle status, it cannot be nulloldStatus- the old bundle status- Throws:
DAValidateException- the DA validate exception
-
prepareFilterData
Prepares the filter in order to correctly load theBOBundleHeaderto update.- Parameters:
input- theBundleHeaderStatusUpdateInput- Returns:
- the hash map that is going to be used as filter
-
prepareUpdateData
Prepares the data to update, i.e. the value of the new status for theBOBundleHeader.- Parameters:
input- theBundleHeaderStatusUpdateInput- Returns:
- the hash map that is going to be used to update the bundle status
-
loadBundle
Loads theBundlerelated to the given id.- Parameters:
bundleId- theBundleidpoolKit- thePoolKit- Returns:
- the loaded
Bundle - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
notifyStatusChange
protected void notifyStatusChange(Bundle bundle, PoolKit poolKit) throws DAException, DAValidateException Notifies theBundleHeaderStatusUpdateEventby calling theBundleNotificationEvent.- Parameters:
bundle- theBundlepoolKit- thePoolKit- Throws:
DAExceptionDAValidateException
-