Class BTSkillCacheLoad
java.lang.Object
overit.geocall.bl.BusinessTask<SkillCacheLoadEvent>
overit.geocallapp.wfm.core.bl.schedule.cache.skill.task.BTSkillCacheLoad
- All Implemented Interfaces:
Serializable,Tool
@Event(SkillCacheLoadEvent.class)
public class BTSkillCacheLoad
extends BusinessTask<SkillCacheLoadEvent>
Business task to load a
When the
SkillCacheLoadEvent object. When the
SkillCacheLoadEvent event is launched the BT notices the
call and load the BTSkillCacheLoad object basing on the event's input. - Since:
- 18.0
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbody(SkillCacheLoadEvent skillCacheLoadEvent, PoolKit poolKit) Implements this method to write the specific task logic to handle the input parameter.protected SkillCachebuildSkillCacheByTeamShiftComposition(SkillCacheLoadInput input, Set<Long> crewShellDummyUsers, PoolKit poolKit) buildTeamSkillsByWorkshift(SkillCacheLoadInput input, Map<String, Set<Long>> teamCompositions, Map<Long, DBView> skillsByUser, Set<Long> crewShellDummyUsers) Builds team skills mapping for each workshift based on team compositions and user skills.getCrewShellDummyUsers(Collection<BOWorkShift> workshifts, PoolKit poolKit) getSkillsByUser(Collection<Long> resources, PoolKit poolKit) Retrieves skills data for the specified user resources.getTeamComposition(Collection<Long> users, Date startDate, Date endDate, PoolKit poolKit) Retrieves team composition data for the specified users within the given date range.Methods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTSkillCacheLoad
public BTSkillCacheLoad()
-
-
Method Details
-
body
protected void body(SkillCacheLoadEvent skillCacheLoadEvent, 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<SkillCacheLoadEvent>- Parameters:
skillCacheLoadEvent- 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
-
getCrewShellDummyUsers
protected Set<Long> getCrewShellDummyUsers(Collection<BOWorkShift> workshifts, PoolKit poolKit) throws DAException, DAValidateException - Throws:
DAExceptionDAValidateException
-
buildSkillCacheByTeamShiftComposition
protected SkillCache buildSkillCacheByTeamShiftComposition(SkillCacheLoadInput input, Set<Long> crewShellDummyUsers, PoolKit poolKit) throws DAException, DAValidateException - Throws:
DAExceptionDAValidateException
-
getTeamComposition
protected Map<String,Set<Long>> getTeamComposition(Collection<Long> users, Date startDate, Date endDate, PoolKit poolKit) throws DAException, DAValidateException Retrieves team composition data for the specified users within the given date range. Creates a mapping of user+day keys to sets of team member IDs.- Parameters:
users- the collection of user IDs to get team composition forstartDate- the start date for the search periodendDate- the end date for the search periodpoolKit- the pool kit for database operations- Returns:
- a map where keys are "userId|date" strings and values are sets of team member IDs
- Throws:
DAException- if a database access error occursDAValidateException- if validation fails
-
getSkillsByUser
protected Map<Long,DBView> getSkillsByUser(Collection<Long> resources, PoolKit poolKit) throws DAException Retrieves skills data for the specified user resources. Queries the database for user skills and organizes them by user ID.- Parameters:
resources- the collection of user resource IDs to get skills forpoolKit- the pool kit for database operations- Returns:
- a map where keys are user IDs and values are DBView objects containing skill data
- Throws:
DAException- if a database access error occurs
-
buildTeamSkillsByWorkshift
protected Map<Long,overit.geocallapp.wfm.scheduler.skills.TeamSkills> buildTeamSkillsByWorkshift(SkillCacheLoadInput input, Map<String, Set<Long>> teamCompositions, Map<Long, DBView> skillsByUser, Set<Long> crewShellDummyUsers) Builds team skills mapping for each workshift based on team compositions and user skills. Combines team composition data with individual user skills to create TeamSkills objects for each workshift.- Parameters:
input- the skill cache load input containing workshift informationteamCompositions- the map of team compositions by user+date keysskillsByUser- the map of skills data by user IDcrewShellDummyUsers- the set of crew shell dummy user IDs- Returns:
- a map where keys are workshift IDs and values are TeamSkills objects
-