Class BTUnbundling
java.lang.Object
overit.geocall.bl.BusinessTask<UnbundlingEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<UnbundlingEvent>
overit.geocallapp.wfm.bundler.bl.task.BTBundler<UnbundlingEvent>
overit.geocallapp.wfm.orchestrator.workorders.bl.bundler.bundling.task.BTUnbundling
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
Business task in order to cancel a list of given
When the
Bundle with all
their BOBundleOperations. When a BOBundleOperation is
cancelled, its status becomes BOBundleOperationStatus.Values.CANCELLED
and the link with the related BOWorkOrderOperation is broken. When the
UnbundlingEvent is launched the BT notices the call and
performs the cancellation for every Bundle within the list that is in
BOBundleStatus.Values.SCHEDULABLE status.Required fields:
- a list of bundle id
Permission:
Error Code:
Codes.OPERATION_NOT_PERMITTEDCodes.Bundler.BUNDLE_ALREADY_CANCELLEDCodes.Bundler.ONLY_SCHEDULABLE_BUNDLES_CAN_BE_CANCELLEDCodes.Bundler.BUNDLE_LOCKED
Visibility:
- bundling operations that belong to the same current user's operation center
- appointment associated to the specified bundle operation
- Since:
- 10.1
- See Also:
- GCApi:
- task
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcancelBundleOperations(Bundle bundle, PoolKit poolKit) Cancels all the not yet cancelledBOBundleOperationby changing their status and breaking the link between them and the relatedBOWorkOrderOperation.protected voidchangeBundleOperationsStatus(BOBundleOperation bundleOperation, PoolKit poolKit) Changes the status of everyBOBundleOperationtoBOBundleOperationStatus.Values.CANCELLEDby callingBundleOperationStatusUpdateEvent.protected booleancheckBundleStatusSchedulable(Bundle bundle) Checks if currentBundlestatus isBOBundleStatus.Values.SCHEDULABLEin order to permit the unbundling.protected voidChecks whether the current user has the permission to create/cancel aBundle.protected voidexecute(UnbundlingEvent event, PoolKit poolKit) Executes the unbundling process for the all givenBundles that areBOBundleStatus.Values.SCHEDULABLE, by calling the canceling process on all the relatedBOBundleOperation.protected BundleloadBundle(Long bundleId, PoolKit poolKit) Loads theBundlerelated to the given id.protected voidnotifyUnbundling(Bundle bundle, PoolKit poolKit) Notifies the unbundling process by callingBundleNotificationEventwithBundleNotificationAction.UNBUNDLEaction.protected voidunlinkBundleOperations(List<BOBundleOperation> bundleOperationList, PoolKit poolKit) Removes the link between the list of currentBOBundleOperationand each relatedBOWorkOrderOperation.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
-
Field Details
-
LOG
-
-
Constructor Details
-
BTUnbundling
public BTUnbundling()
-
-
Method Details
-
execute
protected void execute(UnbundlingEvent event, PoolKit poolKit) throws DAException, DAValidateException Executes the unbundling process for the all givenBundles that areBOBundleStatus.Values.SCHEDULABLE, by calling the canceling process on all the relatedBOBundleOperation.- Specified by:
executein classValidExecutionBusinessTask<UnbundlingEvent>- Parameters:
event- theUnbundlingEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
loadBundle
Loads theBundlerelated to the given id.- Parameters:
bundleId- theBundleidpoolKit- thePoolKit- Returns:
- the loaded
Bundle - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
cancelBundleOperations
protected void cancelBundleOperations(Bundle bundle, PoolKit poolKit) throws DAValidateException, DAException Cancels all the not yet cancelledBOBundleOperationby changing their status and breaking the link between them and the relatedBOWorkOrderOperation.- Parameters:
bundle- the currentBundlepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
changeBundleOperationsStatus
protected void changeBundleOperationsStatus(BOBundleOperation bundleOperation, PoolKit poolKit) throws DAValidateException, DAException Changes the status of everyBOBundleOperationtoBOBundleOperationStatus.Values.CANCELLEDby callingBundleOperationStatusUpdateEvent.- Parameters:
bundleOperation- the currentBOBundleOperationpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
unlinkBundleOperations
protected void unlinkBundleOperations(List<BOBundleOperation> bundleOperationList, PoolKit poolKit) throws DAValidateException, DAException Removes the link between the list of currentBOBundleOperationand each relatedBOWorkOrderOperation.- Parameters:
bundleOperationList- current list ofBOBundleOperationpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
checkUserPermission
Checks whether the current user has the permission to create/cancel aBundle.- Throws:
DAValidateException- the DA validate exception
-
checkBundleStatusSchedulable
Checks if currentBundlestatus isBOBundleStatus.Values.SCHEDULABLEin order to permit the unbundling. If the status isBOBundleStatus.Values.CANCELLEDno exception is thrown, but the unbundling process is stopped.- Parameters:
bundle- the currentBundle- Returns:
- true, if bundle status is schedulable
- Throws:
DAValidateException- the DA validate exception
-
notifyUnbundling
protected void notifyUnbundling(Bundle bundle, PoolKit poolKit) throws DAException, DAValidateException Notifies the unbundling process by callingBundleNotificationEventwithBundleNotificationAction.UNBUNDLEaction.- Parameters:
bundle- the list ofBundlepoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-