Class BTBundleCreate
java.lang.Object
overit.geocall.bl.BusinessTask<BundleCreateEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<BundleCreateEvent>
overit.geocallapp.wfm.bundler.bl.task.BTBundler<BundleCreateEvent>
overit.geocallapp.wfm.orchestrator.workorders.bl.bundler.bundling.task.BTBundleCreate
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
Business task in order to create a
When the
Bundle. When the
BundleCreateEvent is launched the BT notices the call and
creates the Bundle basing on the event's input.
The Bundle creation includes the setting-up of its components:
- the
BOBundleHeader - the list of
BOWorkOrderOperationthat are going to be grouped by this bundle - the list of related
BOBundleOperation, which represents the link between theBundleand eachBOBundleOperation
Bundle is added into the event's journal. - Since:
- 10.1
- See Also:
- GCApi:
- task
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcalculateBundleAttributes(Bundle bundle, BundleEntitiesCache cache, PoolKit poolKit) Performs the calculation of theBundleattributes.protected List<BOBundleOperation> createBundleOperations(Bundle bundle, List<Long> workOrderOperationsId, PoolKit poolKit) For everyBOWorkOrderOperationof the given list, a newBOBundleOperationis created (respecting the original work order list order).protected AggregateBundleRequirementcreateBundleRequirements(Bundle bundle, List<Long> workOrderOperationsId, PoolKit poolKit) Creates theAggregateBundleRequirementby aggregating all theBOOperationRequirements that are related to the given work order operations.protected BOBundleHeadercreateHeader(BundleCreateInput input, PoolKit poolKit) Creates a newBOBundleHeaderwith the stateBOBundleStatus.Values.SCHEDULABLEand all the other basic informations.protected voidexecute(BundleCreateEvent event, PoolKit poolKit) Creates a newBundlestarting from theBundleCreateInputand writes the id of the newly createdBOBundleHeaderinto the event journal.protected WorkOrdersIntegrationServicegetIntegrationService(PoolKit poolKit) protected LonginsertHeader(BOBundleHeader bundleHeader, PoolKit poolKit) Performs the insertion of the preparedBOBundleHeader.protected LonginsertOperation(BOBundleOperation bundleOperation, PoolKit poolKit) Performs the insertion of the preparedBOBundleOperation.protected LonginsertSkill(BOBundleSkill bundleSkill, PoolKit poolKit) Performs the insertion of the preparedBOBundleSkill.protected LonginsertSkillDivision(BOBundleSkillDivision bundleSkillDivision, PoolKit poolKit) Performs the insertion of the preparedBOBundleSkillDivision.protected voidnotifyBundleCreation(Bundle bundle, PoolKit poolKit) Notifies the creation of theBundle.protected LongsaveBundle(Bundle bundle, PoolKit poolKit) Performs the insertion of the preparedBOBundleHeaderand all theBOBundleOperations.protected voidsaveBundleRequirements(AggregateBundleRequirement aggregate, PoolKit poolKit) Saves the aggregate bundle requirements by converting them to individualBOBundleRequirementobjects and inserting them usingBundleRequirementInsertEvent.protected voidupdateWorkOrderOperations(Bundle bundle, PoolKit poolKit) Saves the id of theBOBundleHeaderinto eachBOWorkOrderOperationof the list by and callingWorkOrderOperationLinkEvent.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
-
OPERATION_ORDER
public static final long OPERATION_ORDER- See Also:
-
-
Constructor Details
-
BTBundleCreate
public BTBundleCreate()
-
-
Method Details
-
execute
protected void execute(BundleCreateEvent event, PoolKit poolKit) throws DAException, DAValidateException Creates a newBundlestarting from theBundleCreateInputand writes the id of the newly createdBOBundleHeaderinto the event journal.- Specified by:
executein classValidExecutionBusinessTask<BundleCreateEvent>- Parameters:
event- theBundleCreateEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
createBundleRequirements
protected AggregateBundleRequirement createBundleRequirements(Bundle bundle, List<Long> workOrderOperationsId, PoolKit poolKit) throws DAException, DAValidateException Creates theAggregateBundleRequirementby aggregating all theBOOperationRequirements that are related to the given work order operations.- Parameters:
bundle- theBundleworkOrderOperationsId- the list of work order operations IDpoolKit- thePoolKit- Returns:
- the
AggregateBundleRequirement - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
saveBundleRequirements
protected void saveBundleRequirements(AggregateBundleRequirement aggregate, PoolKit poolKit) throws DAException, DAValidateException Saves the aggregate bundle requirements by converting them to individualBOBundleRequirementobjects and inserting them usingBundleRequirementInsertEvent.- Parameters:
aggregate- theAggregateBundleRequirementcontaining all requirements to savepoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
createHeader
protected BOBundleHeader createHeader(BundleCreateInput input, PoolKit poolKit) throws DAValidateException, DAException Creates a newBOBundleHeaderwith the stateBOBundleStatus.Values.SCHEDULABLEand all the other basic informations.- Parameters:
input- theBundleCreateInputwhich contains all the needed bundle header's informationspoolKit- thePoolKit- Returns:
- the
BOBundleHeaderin which all the needed info were set - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
createBundleOperations
protected List<BOBundleOperation> createBundleOperations(Bundle bundle, List<Long> workOrderOperationsId, PoolKit poolKit) throws DAValidateException, DAException For everyBOWorkOrderOperationof the given list, a newBOBundleOperationis created (respecting the original work order list order).- Parameters:
bundle- theBundleworkOrderOperationsId- list ofBOWorkOrderOperationidspoolKit- thePoolKit- Returns:
- the list of loaded
BOWorkOrderOperation - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception- See Also:
-
calculateBundleAttributes
protected void calculateBundleAttributes(Bundle bundle, BundleEntitiesCache cache, PoolKit poolKit) throws DAValidateException, DAException Performs the calculation of theBundleattributes.- Parameters:
bundle- theBundlecache- theBundleEntitiesCachepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
saveBundle
Performs the insertion of the preparedBOBundleHeaderand all theBOBundleOperations. After that, it also saves all the related information into theBundle.- Parameters:
bundle- theBundlepoolKit- thePoolKit- Returns:
- the generated
Bundleid - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
insertHeader
protected Long insertHeader(BOBundleHeader bundleHeader, PoolKit poolKit) throws DAValidateException, DAException Performs the insertion of the preparedBOBundleHeader.- Parameters:
bundleHeader- theBOBundleHeaderpoolKit- thePoolKit- Returns:
- the generated
BOBundleHeaderid - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
insertOperation
protected Long insertOperation(BOBundleOperation bundleOperation, PoolKit poolKit) throws DAValidateException, DAException Performs the insertion of the preparedBOBundleOperation.- Parameters:
bundleOperation- theBOBundleOperationpoolKit- thePoolKit- Returns:
- the generated
BOBundleOperationid - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
insertSkill
protected Long insertSkill(BOBundleSkill bundleSkill, PoolKit poolKit) throws DAValidateException, DAException Performs the insertion of the preparedBOBundleSkill.- Parameters:
bundleSkill- theBOBundleSkillpoolKit- thePoolKit- Returns:
- the generated
BOBundleSkillid - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
insertSkillDivision
protected Long insertSkillDivision(BOBundleSkillDivision bundleSkillDivision, PoolKit poolKit) throws DAValidateException, DAException Performs the insertion of the preparedBOBundleSkillDivision.- Parameters:
bundleSkillDivision- theBOBundleSkillDivisionpoolKit- thePoolKit- Returns:
- the generated
BOBundleSkillDivisionid - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
updateWorkOrderOperations
protected void updateWorkOrderOperations(Bundle bundle, PoolKit poolKit) throws DAValidateException, DAException Saves the id of theBOBundleHeaderinto eachBOWorkOrderOperationof the list by and callingWorkOrderOperationLinkEvent.- Parameters:
bundle- theBundlepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
notifyBundleCreation
protected void notifyBundleCreation(Bundle bundle, PoolKit poolKit) throws DAException, DAValidateException Notifies the creation of theBundle.- Parameters:
bundle- theBundlepoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
getIntegrationService
protected WorkOrdersIntegrationService getIntegrationService(PoolKit poolKit) throws DAValidateException - Throws:
DAValidateException
-