Class BTBundleSchedulingRecalculation
java.lang.Object
overit.geocall.bl.BusinessTask<BundleSchedulingRecalculationEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<BundleSchedulingRecalculationEvent>
overit.geocallapp.wfm.bundler.bl.task.BTBundler<BundleSchedulingRecalculationEvent>
overit.geocallapp.wfm.core.bl.schedule.bundler.task.BTBundleSchedulingRecalculation
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(BundleSchedulingRecalculationEvent.class)
public class BTBundleSchedulingRecalculation
extends BTBundler<BundleSchedulingRecalculationEvent>
Business task in order to recalculate the scheduling relations between
the given list of
The
When the
BOWorkOrderOperations that are part of a Bundle. The
BundleSchedulingRecalculationEvent is called when a BOWorkOrderOperation is unlinked from a schedulated Bundle and therefore
the "parent-children" relations between all its other BOWorkOrderOperation changed. When the
BundleSchedulingRecalculationEvent is launched
the BT notices the call and recalculate the scheduling relations basing on the event's input. - Since:
- 10.1
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidalignWorkShiftSchedulings(Set<Long> workShiftIds, PoolKit poolKit) Aligns all the needed scheduling informations that are related to the givenBOWorkShift.protected voidcancelUnlinkedSchedulings(List<Long> parents, PoolKit poolKit) Cancels the given schedulings that are related to the given unlinkedBOWorkOrderOperationsprotected voidexecute(BundleSchedulingRecalculationEvent event, PoolKit poolKit) Executes the recalculation of scheduling relations.protected DBViewloadActiveSchedulings(List<Long> operations, PoolKit poolKit) Loads the not cancelled schedulings related to the list of remainingBOWorkOrderOperations.recalculateLinks(List<Long> linkedOperations, Bundle bundle, PoolKit poolKit) Recalculates the new links between the remaining schedulings.Unlinks the schedulings related to the givenBOWorkOrderOperation.protected voidUpdates the scheduling with the given informations.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
-
BTBundleSchedulingRecalculation
public BTBundleSchedulingRecalculation()
-
-
Method Details
-
execute
protected void execute(BundleSchedulingRecalculationEvent event, PoolKit poolKit) throws DAException, DAValidateException Executes the recalculation of scheduling relations.- Specified by:
executein classValidExecutionBusinessTask<BundleSchedulingRecalculationEvent>- Parameters:
event- theBundleSchedulingRecalculationEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
cancelUnlinkedSchedulings
protected void cancelUnlinkedSchedulings(List<Long> parents, PoolKit poolKit) throws DAException, DAValidateException Cancels the given schedulings that are related to the given unlinkedBOWorkOrderOperations- Parameters:
parents- list of schedulings to cancelpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
recalculateLinks
protected Set<Long> recalculateLinks(List<Long> linkedOperations, Bundle bundle, PoolKit poolKit) throws DAException, DAValidateException Recalculates the new links between the remaining schedulings.- Parameters:
linkedOperations- list of remainingBOWorkOrderOperationsbundle- the currentBundlepoolKit- thePoolKit- Returns:
- the set of
BOWorkShifts related to the elaborated schedulings - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
unlink
protected List<Long> unlink(Long unlinkingOperation, PoolKit poolKit) throws DAException, DAValidateException Unlinks the schedulings related to the givenBOWorkOrderOperation.- Parameters:
unlinkingOperation- theBOWorkOrderOperationto unlinkpoolKit- thePoolKit- Returns:
- a list of related schedulings
- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception- See Also:
-
loadActiveSchedulings
protected DBView loadActiveSchedulings(List<Long> operations, PoolKit poolKit) throws DAException, DAValidateException Loads the not cancelled schedulings related to the list of remainingBOWorkOrderOperations. Only schedulings associated with the last appointment for each operation are returned.- Parameters:
operations- list of remainingBOWorkOrderOperationspoolKit- thePoolKit- Returns:
- the related schedulings
- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
update
protected void update(Long id, Long parent, String children, Long duration, PoolKit poolKit) throws DAException, DAValidateException Updates the scheduling with the given informations.- Parameters:
id- the id of the scheduling to considerparent- the parent of the schedulingchildren- the children of the schedulingduration- the duration of the scheduling (null if the of the scheduling is a child)poolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
alignWorkShiftSchedulings
protected void alignWorkShiftSchedulings(Set<Long> workShiftIds, PoolKit poolKit) throws DAException, DAValidateException Aligns all the needed scheduling informations that are related to the givenBOWorkShift.- Parameters:
workShiftIds- theBOWorkShiftidpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-