Class BTBundleCreateFromPartialOperations
java.lang.Object
overit.geocall.bl.BusinessTask<BundleNotificationEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<BundleNotificationEvent>
overit.geocallapp.wfm.bundler.bl.task.BTBundler<BundleNotificationEvent>
overit.geocallapp.wfm.orchestrator.workorders.bl.bundler.bundle.task.BTBundleCreateFromPartialOperations
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(BundleNotificationEvent.class)
public class BTBundleCreateFromPartialOperations
extends BTBundler<BundleNotificationEvent>
Business task to create a new bundle from operations with partial outcomes.
When the
The process follows these steps:
When the
BundleNotificationEvent is launched with a BundleNotificationAction.HEADER_STATUS_CHANGE action,
the BT notices the call and checks if the bundle has been closed. If so, it identifies operations with partial outcomes
and creates a new bundle from them if the bundling rule allows automatic bundling of partial operations. The process follows these steps:
- Verifies the notification action is a header status change
- Checks if the bundle status is closed
- Identifies operations with partial outcomes by examining their intervention outcomes
- Validates the bundling rule has the "auto bundle partial operations" flag enabled
- Creates a new bundle using
BundlingEventwith the partial operations
- Since:
- 21.0
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateNewBundle(List<Long> workOrderOperationIds, BundlingRule bundlingRule, Bundle parentBundle, PoolKit poolKit) Creates a new bundle from work order operations with partial outcomes.protected voidexecute(BundleNotificationEvent event, PoolKit poolKit) Creates a new bundle from operations with partial outcomes when a bundle is closed.protected WorkOrdersIntegrationServicegetIntegrationService(PoolKit poolKit) Returns the integration service.getWorkOrderOperationsWithPartialOutcome(Collection<Long> bundleOperationIds, PoolKit poolKit) Gets work order operations with partial outcomes from the bundle.loadAppointments(Collection<Long> bundleOperationIds, PoolKit poolKit) Loads the list of all theBOAppointments related to the given list of bundle operations.protected BundlingRuleloadBundlingRule(Long bundlingRuleId, PoolKit poolKit) Loads the bundling rule from the given id.protected BOOutcomeReasonloadOutcomeReason(Long outcomeReason, PoolKit poolKit) Loads the outcome reason from the given id.protected BOOutcomeReasonTypeloadReasonType(Long outcomeReasonType, PoolKit poolKit) Loads the reason type from the given id.protected List<InterventionAggregate> searchInterventionAggregate(Collection<Long> appointmentIds, PoolKit poolKit) Search the list ofInterventionAggregateby the given filter.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
-
BTBundleCreateFromPartialOperations
public BTBundleCreateFromPartialOperations()
-
-
Method Details
-
execute
protected void execute(BundleNotificationEvent event, PoolKit poolKit) throws DAException, DAValidateException Creates a new bundle from operations with partial outcomes when a bundle is closed. This method processes bundle notification events and automatically creates new bundles from operations that have partial outcomes, provided the bundling rule allows it.- Specified by:
executein classValidExecutionBusinessTask<BundleNotificationEvent>- Parameters:
event- theBundleNotificationEventcontaining the bundle notification datapoolKit- thePoolKitfor database operations- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
getWorkOrderOperationsWithPartialOutcome
protected List<Long> getWorkOrderOperationsWithPartialOutcome(Collection<Long> bundleOperationIds, PoolKit poolKit) throws DAException, DAValidateException Gets work order operations with partial outcomes from the bundle.- Parameters:
bundleOperationIds- the bundle operation idspoolKit- thePoolKit- Returns:
- list of operations with partial outcomes
- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
createNewBundle
protected void createNewBundle(List<Long> workOrderOperationIds, BundlingRule bundlingRule, Bundle parentBundle, PoolKit poolKit) throws DAException, DAValidateException Creates a new bundle from work order operations with partial outcomes.- Parameters:
workOrderOperationIds- the list of work order operations with partial outcomesbundlingRule- theBundlingRuleparentBundle- the parent bundlepoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
searchInterventionAggregate
protected List<InterventionAggregate> searchInterventionAggregate(Collection<Long> appointmentIds, PoolKit poolKit) throws DAValidateException, DAException Search the list ofInterventionAggregateby the given filter.- Parameters:
appointmentIds- the appointment idspoolKit- thePoolKit- Returns:
- the loaded list of intervention aggregate
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadAppointments
protected List<Long> loadAppointments(Collection<Long> bundleOperationIds, PoolKit poolKit) throws DAValidateException, DAException Loads the list of all theBOAppointments related to the given list of bundle operations.- Parameters:
bundleOperationIds- list of bundle operation idspoolKit- thePoolKit- Returns:
- a list of
BOAppointmentids - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadOutcomeReason
protected BOOutcomeReason loadOutcomeReason(Long outcomeReason, PoolKit poolKit) throws DAValidateException, DAException Loads the outcome reason from the given id.- Parameters:
outcomeReason- the outcome reason idpoolKit- thePoolKit- Returns:
- the loaded outcome reason
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadReasonType
protected BOOutcomeReasonType loadReasonType(Long outcomeReasonType, PoolKit poolKit) throws DAValidateException, DAException Loads the reason type from the given id.- Parameters:
outcomeReasonType- the outcome reason type idpoolKit- thePoolKit- Returns:
- the loaded outcome reason type
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadBundlingRule
protected BundlingRule loadBundlingRule(Long bundlingRuleId, PoolKit poolKit) throws DAValidateException, DAException Loads the bundling rule from the given id.- Parameters:
bundlingRuleId- the bundling rule idpoolKit- thePoolKit- Returns:
- the loaded bundling rule
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getIntegrationService
protected WorkOrdersIntegrationService getIntegrationService(PoolKit poolKit) throws DAValidateException Returns the integration service.- Parameters:
poolKit- thePoolKit- Returns:
- the integration service
- Throws:
DAValidateException- the DA validate exception
-