Class BTBundleOperationAdd
java.lang.Object
overit.geocall.bl.BusinessTask<BundleOperationAddEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<BundleOperationAddEvent>
overit.geocallapp.wfm.bundler.bl.task.BTBundler<BundleOperationAddEvent>
overit.geocallapp.wfm.orchestrator.workorders.bl.bundler.bundle.task.BTBundleOperationAdd
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(BundleOperationAddEvent.class)
public class BTBundleOperationAdd
extends BTBundler<BundleOperationAddEvent>
Business task in order to add a list of
When the
BOBundleOperation to a Bundle. When the
BundleOperationAddEvent is launched the BT notices the call
and adds all the BOBundleOperations to the Bundle basing on the event's input. Permission:
Error Code:
Codes.OPERATION_NOT_PERMITTEDCodes.Bundler.BUNDLE_NOT_SCHEDULABLECodes.Bundler.BUNDLE_OPERATION_NOT_FOUND_IN_BUNDLECodes.Bundler.BUNDLE_OPERATION_NOT_SCHEDULABLE
Visibility:
- bundle headers associated to the same current user's operation center
- Since:
- 20.1
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcalculateBundleAttributes(Bundle bundle, PoolKit poolKit) Calculates the scheduling attributes for the currentBundle.protected voidChecks if the user has the required permission.protected List<BOBundleOperation> createBundleOperations(Bundle bundle, List<Long> workOrderOperationIds, PoolKit poolKit) Creates a newBOBundleOperationfor everyBOWorkOrderOperationof the given list.protected voiddeleteSkillDivisions(Bundle bundle, PoolKit poolKit) Deletes all the existing relation between the skill divisions and the givenBundle.protected voiddeleteSkills(Bundle bundle, PoolKit poolKit) Deletes all the existing relation between the skills and the givenBundle.protected voidexecute(BundleOperationAddEvent event, PoolKit poolKit) Starting from the givenBundleOperationAddEventinput, the correspondingBOBundleOperationis created and added to theBundle.protected WorkOrdersIntegrationServicegetIntegrationService(PoolKit poolKit) Retrieves theWorkOrdersIntegrationServiceinstance.protected BOBundleOperationinsertBundleOperation(Bundle bundle, Long workOrderOperationId, PoolKit poolKit) Inserts a newBOBundleOperationfor the givenBOWorkOrderOperation.protected LonginsertSkill(BOBundleSkill bundleSkill, PoolKit poolKit) Inserts the relation between the currentBundleand a skill.protected LonginsertSkillDivision(BOBundleSkillDivision bundleSkillDivision, PoolKit poolKit) Inserts the relation between the currentBundleand a skill division.protected voidlinkWorkOrderOperations(Bundle bundle, PoolKit poolKit) Creates the new links for theBOWorkOrderOperations of the givenBundle.protected BundleloadBundle(Long bundleId, PoolKit poolKit) Loads theBundlerelated to the given id.protected List<BOWorkOrderOperation> loadValidWorkOrderOperations(List<Long> workOrderOperationIds, PoolKit poolKit) Loads theBOWorkOrderOperations related to the given ids and checks if they are valid for bundling.protected voidnotifyBundleOperation(BOBundleOperation bundleOperation, PoolKit poolKit) Notifies the addition of the givenBOBundleOperation.protected voidrecalculateLinks(Bundle bundle, PoolKit poolKit) Recalculates the links between theBOWorkOrderOperations by unlinking them and relinking them together with the newly added one.protected LongsaveBundle(Bundle bundle, PoolKit poolKit) Saves theBundleand adds the relation with the skills and skill divisions.protected List<BOWorkOrderOperation> searchWorkOrderOperations(List<Long> workOrderOperationIds, PoolKit poolKit) Loads the list ofBOWorkOrderOperationrelated to the given list of ids.protected voidunlinkWorkOrderOperations(Bundle bundle, PoolKit poolKit) Unlinks of the parentBOWorkOrderOperationfrom all its children.protected voidupdateBundle(Bundle bundle, PoolKit poolKit) Updates theBundle, recalculates all its attributes, including the skills and skill divisions.protected voidvalidate(BundleOperationAddInput input, Bundle bundle) Validates the input before adding the bundle operation.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
-
BTBundleOperationAdd
public BTBundleOperationAdd()
-
-
Method Details
-
execute
protected void execute(BundleOperationAddEvent event, PoolKit poolKit) throws DAException, DAValidateException Starting from the givenBundleOperationAddEventinput, the correspondingBOBundleOperationis created and added to theBundle.- Specified by:
executein classValidExecutionBusinessTask<BundleOperationAddEvent>- Parameters:
event- theBundleOperationAddEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
checkUserPermissions
Checks if the user has the required permission.- Throws:
DAValidateException- 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
-
createBundleOperations
protected List<BOBundleOperation> createBundleOperations(Bundle bundle, List<Long> workOrderOperationIds, PoolKit poolKit) throws DAValidateException, DAException Creates a newBOBundleOperationfor everyBOWorkOrderOperationof the given list.- Parameters:
bundle- theBundleworkOrderOperationIds- list ofBOWorkOrderOperationidspoolKit- thePoolKit- Returns:
- the list of created
BOBundleOperation - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadValidWorkOrderOperations
protected List<BOWorkOrderOperation> loadValidWorkOrderOperations(List<Long> workOrderOperationIds, PoolKit poolKit) throws DAValidateException, DAException Loads theBOWorkOrderOperations related to the given ids and checks if they are valid for bundling.- Parameters:
workOrderOperationIds- theBOWorkOrderOperationidspoolKit- thePoolKit- Returns:
- the loaded
BOWorkOrderOperation - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
searchWorkOrderOperations
protected List<BOWorkOrderOperation> searchWorkOrderOperations(List<Long> workOrderOperationIds, PoolKit poolKit) throws DAValidateException, DAException Loads the list ofBOWorkOrderOperationrelated to the given list of ids.- Parameters:
workOrderOperationIds- list ofBOWorkOrderOperationidspoolKit- thePoolKit- Returns:
- the list of loaded
BOWorkOrderOperation - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
validate
Validates the input before adding the bundle operation.- Parameters:
input- theBundleOperationAddInputbundle- theBundle- Throws:
DAValidateException- the DA validate exception
-
insertBundleOperation
protected BOBundleOperation insertBundleOperation(Bundle bundle, Long workOrderOperationId, PoolKit poolKit) throws DAValidateException, DAException Inserts a newBOBundleOperationfor the givenBOWorkOrderOperation.- Parameters:
bundle- theBundleworkOrderOperationId- theBOWorkOrderOperationidpoolKit- thePoolKit- Returns:
- the created
BOBundleOperation - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
updateBundle
Updates theBundle, recalculates all its attributes, including the skills and skill divisions.- Parameters:
bundle- theBundlepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
recalculateLinks
protected void recalculateLinks(Bundle bundle, PoolKit poolKit) throws DAValidateException, DAException Recalculates the links between theBOWorkOrderOperations by unlinking them and relinking them together with the newly added one.- Parameters:
bundle- the currentBundlepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
unlinkWorkOrderOperations
protected void unlinkWorkOrderOperations(Bundle bundle, PoolKit poolKit) throws DAValidateException, DAException Unlinks of the parentBOWorkOrderOperationfrom all its children.- Parameters:
bundle- theBundlepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
linkWorkOrderOperations
protected void linkWorkOrderOperations(Bundle bundle, PoolKit poolKit) throws DAValidateException, DAException Creates the new links for theBOWorkOrderOperations of the givenBundle.- Parameters:
bundle- theBundlepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
calculateBundleAttributes
protected void calculateBundleAttributes(Bundle bundle, PoolKit poolKit) throws DAValidateException, DAException Calculates the scheduling attributes for the currentBundle.- Parameters:
bundle- the currentBundlepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
saveBundle
Saves theBundleand adds the relation with the skills and skill divisions.- Parameters:
bundle- theBundlepoolKit- thePoolKit- Returns:
- the saved
Bundleid - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
deleteSkills
Deletes all the existing relation between the skills and the givenBundle.- Parameters:
bundle- theBundlepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
deleteSkillDivisions
protected void deleteSkillDivisions(Bundle bundle, PoolKit poolKit) throws DAValidateException, DAException Deletes all the existing relation between the skill divisions and the givenBundle.- Parameters:
bundle- theBundlepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
insertSkill
protected Long insertSkill(BOBundleSkill bundleSkill, PoolKit poolKit) throws DAValidateException, DAException Inserts the relation between the currentBundleand a skill.- Parameters:
bundleSkill- theBOBundleSkillpoolKit- thePoolKit- Returns:
- the inserted
BOBundleSkillid - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
insertSkillDivision
protected Long insertSkillDivision(BOBundleSkillDivision bundleSkillDivision, PoolKit poolKit) throws DAValidateException, DAException Inserts the relation between the currentBundleand a skill division.- Parameters:
bundleSkillDivision- theBOBundleSkillDivisionpoolKit- thePoolKit- Returns:
- the inserted
BOBundleSkillDivisionid - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
notifyBundleOperation
protected void notifyBundleOperation(BOBundleOperation bundleOperation, PoolKit poolKit) throws DAValidateException, DAException Notifies the addition of the givenBOBundleOperation.- Parameters:
bundleOperation- theBOBundleOperationpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getIntegrationService
protected WorkOrdersIntegrationService getIntegrationService(PoolKit poolKit) throws DAValidateException Retrieves theWorkOrdersIntegrationServiceinstance. If the instance hasn't been created yet, it will be created and stored for future use.- Parameters:
poolKit- ThePoolKit.- Returns:
- The
WorkOrdersIntegrationServiceinstance. - Throws:
DAValidateException- If any validation error occurs.
-