Class BTBundleOperationStatusChange
java.lang.Object
overit.geocall.bl.BusinessTask<BundleOperationStatusChangeEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<BundleOperationStatusChangeEvent>
overit.geocallapp.wfm.bundler.bl.task.BTBundler<BundleOperationStatusChangeEvent>
overit.geocallapp.wfm.bundler.bl.header.task.BTBundleOperationStatusChange
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(BundleOperationStatusChangeEvent.class)
public class BTBundleOperationStatusChange
extends BTBundler<BundleOperationStatusChangeEvent>
Business task in order to change the
When the
BOBundleHeader state. When the
BundleOperationStatusChangeEvent is launched
the BT notices the call and changes the BOBundleHeader state basing on the event's input. - Since:
- 10.1
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckAllBundleOperations(List<BOBundleOperation> bundleOperations, Predicate<BOBundleOperation> condition) Checks if everyBOBundleOperationmatches the given condition.protected booleancheckAllStatus(List<BOBundleOperation> bundleOperations, Long state) Checks whether the state of everyBOBundleOperationis equal to the given one.protected booleancheckEitherStatus(List<BOBundleOperation> bundleOperations, Set<Long> validStatus) Checks whether the status of everyBOBundleOperationis equal to at least one of the two given value.protected voidexecute(BundleOperationStatusChangeEvent event, PoolKit poolKit) Starting from the status of everyBOBundleOperation, it determines the new status of the relatedBOBundleHeaderprotected LonggetNewBundleStatus(Bundle bundle, Long operationNewStatus) Returns the correct new status for theBundlestarting from the one of the givenBOBundleOperation.protected LonggetNewBundleStatusFromInProgress(List<BOBundleOperation> operationList, Long operationNewStatus) Returns the newBundlestatus from a statusBOBundleStatus.Values.IN_PROGRESSprotected LonggetNewBundleStatusFromPlanned(List<BOBundleOperation> operationList, Long operationNewStatus) Returns the newBundlestatus from a statusBOBundleStatus.Values.PLANNED.protected LonggetNewBundleStatusFromSchedulable(List<BOBundleOperation> operationList, Long operationNewStatus) Returns the newBundlestatus from a statusBOBundleStatus.Values.SCHEDULABLE.protected BundleloadBundle(Long bundleId, PoolKit poolKit) Loads the relatedBundlefrom the given id.protected voidupdateBundleHeader(Long bundleId, Long bundleNewStatus, Long bundleOldStatus, PoolKit poolKit) Updates theBOBundleHeaderby callingBundleHeaderStatusUpdateEventMethods 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
-
BTBundleOperationStatusChange
public BTBundleOperationStatusChange()
-
-
Method Details
-
execute
protected void execute(BundleOperationStatusChangeEvent event, PoolKit poolKit) throws DAException, DAValidateException Starting from the status of everyBOBundleOperation, it determines the new status of the relatedBOBundleHeader- Specified by:
executein classValidExecutionBusinessTask<BundleOperationStatusChangeEvent>- Parameters:
event- theBundleOperationStatusChangeEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
loadBundle
Loads the relatedBundlefrom the given id.- Parameters:
bundleId- theBundleidpoolKit- thePoolKit- Returns:
- the bundle
Bundle - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getNewBundleStatus
Returns the correct new status for theBundlestarting from the one of the givenBOBundleOperation.- Parameters:
bundle- theBundleoperationNewStatus- theBOBundleOperationnew status- Returns:
- the new
Bundlestatus
-
getNewBundleStatusFromSchedulable
protected Long getNewBundleStatusFromSchedulable(List<BOBundleOperation> operationList, Long operationNewStatus) Returns the newBundlestatus from a statusBOBundleStatus.Values.SCHEDULABLE.- Parameters:
operationList- list ofBOBundleOperationelementsoperationNewStatus- theBOBundleOperationnew status- Returns:
- the new
Bundlestatus
-
checkAllStatus
Checks whether the state of everyBOBundleOperationis equal to the given one.- Parameters:
bundleOperations- list ofBOBundleOperationstate- theBOBundleOperationStatusid needed for the comparison- Returns:
- true, if all operations are in the same state as the given one
-
checkEitherStatus
protected boolean checkEitherStatus(List<BOBundleOperation> bundleOperations, Set<Long> validStatus) Checks whether the status of everyBOBundleOperationis equal to at least one of the two given value.- Parameters:
bundleOperations- list ofBOBundleOperationvalidStatus- the list of validBOBundleOperationStatusid needed for the comparison- Returns:
- true, if all operations are equal to at least one of the two given value
-
checkAllBundleOperations
protected boolean checkAllBundleOperations(List<BOBundleOperation> bundleOperations, Predicate<BOBundleOperation> condition) Checks if everyBOBundleOperationmatches the given condition.- Parameters:
bundleOperations- list ofBOBundleOperationcondition- thePredicateused as condition- Returns:
- true, if every
BOBundleOperationmatches the predicate
-
getNewBundleStatusFromPlanned
protected Long getNewBundleStatusFromPlanned(List<BOBundleOperation> operationList, Long operationNewStatus) Returns the newBundlestatus from a statusBOBundleStatus.Values.PLANNED.- Parameters:
operationList- list ofBOBundleOperationoperationNewStatus- theBOBundleOperationnew status- Returns:
- the new
Bundlestatus
-
getNewBundleStatusFromInProgress
protected Long getNewBundleStatusFromInProgress(List<BOBundleOperation> operationList, Long operationNewStatus) Returns the newBundlestatus from a statusBOBundleStatus.Values.IN_PROGRESS- Parameters:
operationList- list ofBOBundleOperationoperationNewStatus- theBOBundleOperationnew status- Returns:
- the new
Bundlestatus
-
updateBundleHeader
protected void updateBundleHeader(Long bundleId, Long bundleNewStatus, Long bundleOldStatus, PoolKit poolKit) throws DAValidateException, DAException Updates theBOBundleHeaderby callingBundleHeaderStatusUpdateEvent- Parameters:
bundleId- theBOBundleHeaderidbundleNewStatus- theBundlenew statusbundleOldStatus- theBundleold statuspoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-