Class BTImmediateSchedulingTeamExclusionByShift
java.lang.Object
overit.geocall.bl.BusinessTask<ImmediateSchedulingTeamExclusionEvent>
overit.geocallapp.wfm.orchestrator.scheduling.bl.immediatescheduling.teamexclusion.task.BTImmediateSchedulingTeamExclusion
overit.geocallapp.wfm.orchestrator.scheduling.bl.immediatescheduling.teamexclusion.task.BTImmediateSchedulingTeamExclusionByShift
- All Implemented Interfaces:
Serializable,Tool
@Event(value=ImmediateSchedulingTeamExclusionEvent.class,
priority=10)
public class BTImmediateSchedulingTeamExclusionByShift
extends BTImmediateSchedulingTeamExclusion
Business Task for filtering teams based on shift management rules and unavailability.
Excludes teams that:
- Have a shift that starts too late (after now + shiftStartExclTimeInterval)
- Have a shift that ends too soon (before now + shiftEndExclTimeInterval)
- Have foreman with unavailability (work shift exceptions) overlapping with current time
- Since:
- 22.0
- See Also:
-
Field Summary
Fields inherited from class overit.geocallapp.wfm.orchestrator.scheduling.bl.immediatescheduling.teamexclusion.task.BTImmediateSchedulingTeamExclusion
integrationService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildWorkshiftByResourceId(List<BOWorkShift> foremanWorkShifts, List<BOWorkShift> assistantWorkShifts) Builds a map of workshift IDs by resource ID for ALL team members (foreman + assistants).buildWorkshiftsByTeam(List<BOWorkShift> workShifts, Map<Long, Long> foremanByTeam) Builds a map of workshift IDs by team ID.protected voidexcludeByUnavailability(ImmediateSchedulingTeamExclusionOutput output, Long shiftEndExclTimeInterval, ImmediateSchedulingTeamExclusionInput input, Date date, PoolKit poolKit) protected voidfilter(ImmediateSchedulingTeamExclusionOutput output, ImmediateSchedulingTeamExclusionInput input, PoolKit poolKit) Applies the specific exclusion filter logic.protected List<BOWorkShift> getAssistantWorkshifts(Map<Long, Long> foremanByTeam, Map<Long, List<Long>> teamCompositionByTeamId, List<BOWorkShift> foremanWorkShifts, Date maxShiftStart, Date minShiftEnd, ImmediateSchedulingTeamExclusionInput input, PoolKit poolKit) Loads workshifts for all assistant resources.getTeamsWithCompleteWorkshifts(Map<Long, Long> foremanByTeam, Map<Long, List<Long>> teamCompositionByTeamId, Map<Long, Long> workshiftByResourceId) Returns the set of team IDs where ALL members (foreman + assistants) have valid workshifts.protected List<BOWorkShiftException> protected List<BOWorkShift> getWorkshifts(List<Long> foremenIds, Date maxShiftStart, Date minShiftEnd, ImmediateSchedulingTeamExclusionInput input, PoolKit poolKit) Methods inherited from class overit.geocallapp.wfm.orchestrator.scheduling.bl.immediatescheduling.teamexclusion.task.BTImmediateSchedulingTeamExclusion
body, createInitialTeamCompatibilityMatrix, getIntegrationService, getOutput, recordResourceExclusions, removeTeamsWithoutWorkOrdersMethods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTImmediateSchedulingTeamExclusionByShift
public BTImmediateSchedulingTeamExclusionByShift()
-
-
Method Details
-
filter
protected void filter(ImmediateSchedulingTeamExclusionOutput output, ImmediateSchedulingTeamExclusionInput input, PoolKit poolKit) throws DAValidateException, DAException Description copied from class:BTImmediateSchedulingTeamExclusionApplies the specific exclusion filter logic. Implementations should: 1. Remove teams from output.getForemanByAliveTeam() that should be excluded 2. Remove incompatible work orders from output.getTeamWorkOrderCompatibility() 3. Log the excluded resources with appropriate messages Note: Teams are automatically removed byBTImmediateSchedulingTeamExclusion.removeTeamsWithoutWorkOrders(overit.geocallapp.wfm.scheduling.bl.immediatescheduling.teamexclusion.event.ImmediateSchedulingTeamExclusionOutput)if they have no compatible work orders.- Specified by:
filterin classBTImmediateSchedulingTeamExclusion- Parameters:
output- the current output from previous filters (modify foremanByAliveTeam and teamWorkOrderCompatibility)input- the event input containing scheduling model and reference datepoolKit- the pool kit- Throws:
DAValidateException- if a validation error occursDAException- if a data access error occurs
-
getWorkshifts
protected List<BOWorkShift> getWorkshifts(List<Long> foremenIds, Date maxShiftStart, Date minShiftEnd, ImmediateSchedulingTeamExclusionInput input, PoolKit poolKit) throws DAException, DAValidateException - Throws:
DAExceptionDAValidateException
-
getAliveResources
-
buildWorkshiftsByTeam
protected Map<Long,Long> buildWorkshiftsByTeam(List<BOWorkShift> workShifts, Map<Long, Long> foremanByTeam) Builds a map of workshift IDs by team ID.This method creates a mapping from team ID to the corresponding workshift ID (ARSHID) for the current day, using the foreman as an intermediary.
- Parameters:
workShifts- the list of workshifts loaded during filteringforemanByTeam- the map of team ID to foreman resource ID- Returns:
- the map of team ID → workshift ID (ARSHID)
-
getAssistantWorkshifts
protected List<BOWorkShift> getAssistantWorkshifts(Map<Long, Long> foremanByTeam, Map<Long, throws DAException, DAValidateExceptionList<Long>> teamCompositionByTeamId, List<BOWorkShift> foremanWorkShifts, Date maxShiftStart, Date minShiftEnd, ImmediateSchedulingTeamExclusionInput input, PoolKit poolKit) Loads workshifts for all assistant resources.- Parameters:
foremanByTeam- the map of team ID to foreman resource IDteamCompositionByTeamId- the map of team ID to list of resource IDs (foreman + assistants)foremanWorkShifts- the list of foreman workshiftsmaxShiftStart- the maximum shift start dateminShiftEnd- the minimum shift end dateinput- the inputpoolKit- the pool kit- Returns:
- the list of assistant workshifts
- Throws:
DAException- if a database error occursDAValidateException- if validation fails
-
buildWorkshiftByResourceId
protected Map<Long,Long> buildWorkshiftByResourceId(List<BOWorkShift> foremanWorkShifts, List<BOWorkShift> assistantWorkShifts) Builds a map of workshift IDs by resource ID for ALL team members (foreman + assistants).- Parameters:
foremanWorkShifts- the list of foreman workshiftsassistantWorkShifts- the list of assistant workshifts- Returns:
- the map of resource ID → workshift ID
-
getTeamsWithCompleteWorkshifts
protected Set<Long> getTeamsWithCompleteWorkshifts(Map<Long, Long> foremanByTeam, Map<Long, List<Long>> teamCompositionByTeamId, Map<Long, Long> workshiftByResourceId) Returns the set of team IDs where ALL members (foreman + assistants) have valid workshifts.A team is considered to have complete workshifts if:
- The foreman has a valid workshift
- ALL assistants in the team composition have valid workshifts
If any member of the team is missing a workshift, the entire team is excluded.
- Parameters:
foremanByTeam- the map of team ID to foreman resource IDteamCompositionByTeamId- the map of team ID to list of resource IDs (foreman + assistants)workshiftByResourceId- the map of resource ID to workshift ID- Returns:
- the set of team IDs with complete workshifts
-