Class BTImmediateSchedulingTeamExclusion
java.lang.Object
overit.geocall.bl.BusinessTask<ImmediateSchedulingTeamExclusionEvent>
overit.geocallapp.wfm.orchestrator.scheduling.bl.immediatescheduling.teamexclusion.task.BTImmediateSchedulingTeamExclusion
- All Implemented Interfaces:
Serializable,Tool
- Direct Known Subclasses:
BTImmediateSchedulingTeamExclusionByAssignedWO,BTImmediateSchedulingTeamExclusionByClockingType,BTImmediateSchedulingTeamExclusionByCrewShell,BTImmediateSchedulingTeamExclusionByDistance,BTImmediateSchedulingTeamExclusionByLastSync,BTImmediateSchedulingTeamExclusionByShift,BTImmediateSchedulingTeamExclusionBySkill,BTImmediateSchedulingTeamExclusionByWORequirement
public abstract class BTImmediateSchedulingTeamExclusion
extends BusinessTask<ImmediateSchedulingTeamExclusionEvent>
Abstract business task for immediate scheduling team exclusion.
This task provides a template for filtering teams based on specific exclusion criteria.
Concrete implementations must provide the
filter(overit.geocallapp.wfm.scheduling.bl.immediatescheduling.teamexclusion.event.ImmediateSchedulingTeamExclusionOutput, overit.geocallapp.wfm.scheduling.bl.immediatescheduling.teamexclusion.event.ImmediateSchedulingTeamExclusionInput, overit.geocall.da.PoolKit) method to apply their specific logic.
The task:
1. Reads the output from the journal (or creates initial output if first)
2. Calls the abstract filter(overit.geocallapp.wfm.scheduling.bl.immediatescheduling.teamexclusion.event.ImmediateSchedulingTeamExclusionOutput, overit.geocallapp.wfm.scheduling.bl.immediatescheduling.teamexclusion.event.ImmediateSchedulingTeamExclusionInput, overit.geocall.da.PoolKit) method implemented by subclasses
3. Removes teams without compatible work orders
4. Writes the updated output to the journal
The output contains:
- List of alive teams
- Team-work order compatibility matrix (progressively refined by each filter)
Multiple tasks listen to the same event with different priorities, creating a chain
of filters that progressively reduce the list of eligible teams and refine the compatibility matrix.
Each concrete task is responsible for its own logging of excluded resources.- Since:
- 22.0
- See Also:
- GCApi:
- task
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbody(ImmediateSchedulingTeamExclusionEvent event, PoolKit poolKit) Implements this method to write the specific task logic to handle the input parameter.Creates the initial team compatibility matrix where all teams can handle all work orders.protected abstract voidfilter(ImmediateSchedulingTeamExclusionOutput output, ImmediateSchedulingTeamExclusionInput input, PoolKit poolKit) Applies the specific exclusion filter logic.protected SchedulingIntegrationServicegetIntegrationService(PoolKit poolKit) Returns theSchedulingIntegrationServiceused to access other domains.protected ImmediateSchedulingTeamExclusionOutputGets the output from the journal or creates initial output.protected voidrecordResourceExclusions(List<Long> excludedTeams, Map<Long, List<Long>> teamCompositionByTeamId, Long processingId, Long reasonId, PoolKit poolKit) Records resource exclusions for excluded teams.protected voidRemoves teams from foremanByAliveTeam if they cannot handle any work order.Methods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Field Details
-
integrationService
-
-
Constructor Details
-
BTImmediateSchedulingTeamExclusion
public BTImmediateSchedulingTeamExclusion()
-
-
Method Details
-
body
protected void body(ImmediateSchedulingTeamExclusionEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:BusinessTaskImplements this method to write the specific task logic to handle the input parameter.- Specified by:
bodyin classBusinessTask<ImmediateSchedulingTeamExclusionEvent>- Parameters:
event- the object upon which the task will works onpoolKit- the poolkit containing the reference to the database connection that can be used- Throws:
DAException- in case of database errorDAValidateException- in case of database validation error
-
getOutput
protected ImmediateSchedulingTeamExclusionOutput getOutput(ImmediateSchedulingTeamExclusionEvent event) Gets the output from the journal or creates initial output. If this is the first filter in the chain, creates initial output with: - All teams from input (in foremanByAliveTeam map) - Full team compatibility matrix (all teams can handle all work orders) Otherwise, reads from the journal where the previous filter wrote the result.- Parameters:
event- the event- Returns:
- the output
-
createInitialTeamCompatibilityMatrix
protected Map<Long,Set<Long>> createInitialTeamCompatibilityMatrix(ImmediateSchedulingTeamExclusionInput input) Creates the initial team compatibility matrix where all teams can handle all work orders.- Parameters:
input- the event input- Returns:
- the initial team compatibility matrix (team ID → set of work order operation IDs)
-
removeTeamsWithoutWorkOrders
Removes teams from foremanByAliveTeam if they cannot handle any work order. Checks the teamWorkOrderCompatibility matrix and removes teams with empty sets. Also synchronizes the foremanWorkshiftByAliveTeam map to keep only alive teams.- Parameters:
output- the output to update
-
filter
protected abstract void filter(ImmediateSchedulingTeamExclusionOutput output, ImmediateSchedulingTeamExclusionInput input, PoolKit poolKit) throws DAException, DAValidateException Applies 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 byremoveTeamsWithoutWorkOrders(overit.geocallapp.wfm.scheduling.bl.immediatescheduling.teamexclusion.event.ImmediateSchedulingTeamExclusionOutput)if they have no compatible work orders.- 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:
DAException- if a data access error occursDAValidateException- if a validation error occurs
-
getIntegrationService
protected SchedulingIntegrationService getIntegrationService(PoolKit poolKit) throws DAValidateException Returns theSchedulingIntegrationServiceused to access other domains.- Parameters:
poolKit- thePoolKit- Returns:
- the
SchedulingIntegrationServiceused to access services and events in other domains - Throws:
DAValidateException- thrown if there are data related loading errors
-
recordResourceExclusions
protected void recordResourceExclusions(List<Long> excludedTeams, Map<Long, List<Long>> teamCompositionByTeamId, Long processingId, Long reasonId, PoolKit poolKit) throws DAException, DAValidateExceptionRecords resource exclusions for excluded teams.This method:
- Takes a list of excluded team IDs
- Converts teams to resources using teamCompositionByTeamId map
- Launches a
ImmediateSchedulingResourceExclusionBatchInsertEventwith all resources and the given reason
- Parameters:
excludedTeams- list of excluded team IDsteamCompositionByTeamId- map of team ID → list of resource IDsprocessingId- the processing IDreasonId- the exclusion reason IDpoolKit- the pool kit- Throws:
DAException- if a data access error occursDAValidateException- if a validation error occurs
-