Class BTSingleResourceTeamShiftUpsert
java.lang.Object
overit.geocall.bl.BusinessTask<SingleResourceTeamShiftUpsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<SingleResourceTeamShiftUpsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<SingleResourceTeamShiftUpsertEvent>
overit.geocallapp.wfm.orchestrator.workforce.bl.team.shift.task.BTSingleResourceTeamShiftUpsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(SingleResourceTeamShiftUpsertEvent.class)
public class BTSingleResourceTeamShiftUpsert
extends ValidPermissionBusinessTask<SingleResourceTeamShiftUpsertEvent>
Business task in order to insert/update a
If the given
BOTeamShift related to a single BOResource. If the given
BOResource already has a BOTeamShift
The upsert process is divided in two alternative steps:
- if the given
BOResourceis already associated to aBOTeamShift(with a validBOTeamShiftResource), theBOTeamShiftis updated with the given input data - otherwise a new
BOTeamShift(with a relatedBOTeamShiftResource) is created
- Since:
- 17.0
- See Also:
- GCApi:
- task
-
Field Summary
Fields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidexecute(SingleResourceTeamShiftUpsertEvent event, PoolKit poolKit) Insert/updates theBOTeamShiftand the relatedBOResource.protected WorkforceIntegrationServicegetIntegrationService(PoolKit poolKit) Return theWorkforceIntegrationServiceused for access to other domainsprotected LonginsertTeamShift(BOWorkShift workShift, BOResource resource, PoolKit poolKit) protected LonginsertTeamShiftResourceRelation(Long teamShiftId, BOResource resource, PoolKit poolKit) booleanDetermines whether the current state is valid for execution.loadNotSingleTeam(PoolKit poolKit) Loads all the team that have a cardinality grater than 1.protected List<BOTeamShiftResource> loadNotSingleTeamShiftRelations(BOWorkShift workShift, BOResource resource, PoolKit poolKit) Loads all the team shift related to a non-single team that the resource is part of.protected List<BOTeamShiftResource> loadTeamShiftResourceRelations(Collection<Long> teamShifts, BOResource resource, PoolKit poolKit) protected List<BOTeamShift> loadTeamShifts(BOWorkShift workShift, Collection<Long> teamIds, PoolKit poolKit) Loads theBOTeamShiftrelated to the givenBOWorkShiftand team.protected voidupdateTeamShift(BOTeamShift teamShift, BOWorkShift workShift, BOResource resource, PoolKit poolKit) Updates theBOTeamShiftwith the given data.Methods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
checkValidExecution, getException, throwExceptionIfInvalidMethods inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask
body, getEventMethods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTSingleResourceTeamShiftUpsert
public BTSingleResourceTeamShiftUpsert()
-
-
Method Details
-
isValidExecution
public boolean isValidExecution()Description copied from interface:ValidExecutionDetermines whether the current state is valid for execution.- Returns:
- true if execution is valid, false otherwise
-
execute
protected void execute(SingleResourceTeamShiftUpsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Insert/updates theBOTeamShiftand the relatedBOResource.- Specified by:
executein classValidExecutionBusinessTask<SingleResourceTeamShiftUpsertEvent>- Parameters:
event- theSingleResourceTeamShiftUpsertEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
loadTeamShifts
protected List<BOTeamShift> loadTeamShifts(BOWorkShift workShift, Collection<Long> teamIds, PoolKit poolKit) throws DAValidateException, DAException Loads theBOTeamShiftrelated to the givenBOWorkShiftand team.- Parameters:
workShift- theBOWorkShiftteamIds- theBOResourcepoolKit- thePoolKit- Returns:
- the loaded
BOTeamShift - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadNotSingleTeamShiftRelations
protected List<BOTeamShiftResource> loadNotSingleTeamShiftRelations(BOWorkShift workShift, BOResource resource, PoolKit poolKit) throws DAValidateException, DAException Loads all the team shift related to a non-single team that the resource is part of.- Parameters:
workShift- theBOWorkShiftresource- theBOResourcepoolKit- thePoolKit- Returns:
- a list of
BOTeamShiftResourcerelations - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadNotSingleTeam
Loads all the team that have a cardinality grater than 1.- Parameters:
poolKit- thePoolKit- Returns:
- a list of
BOTeamwith cardinality grater than 1 - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadTeamShiftResourceRelations
protected List<BOTeamShiftResource> loadTeamShiftResourceRelations(Collection<Long> teamShifts, BOResource resource, PoolKit poolKit) throws DAValidateException, DAException - Parameters:
teamShifts-resource- theBOResourcepoolKit- thePoolKit- Returns:
- a list of
BOTeamShiftResource - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
insertTeamShift
protected Long insertTeamShift(BOWorkShift workShift, BOResource resource, PoolKit poolKit) throws DAValidateException, DAException - Parameters:
workShift- the currentBOWorkShiftresource- the givenBOResourcepoolKit- thePoolKit- Returns:
- the team shift id
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
insertTeamShiftResourceRelation
protected Long insertTeamShiftResourceRelation(Long teamShiftId, BOResource resource, PoolKit poolKit) throws DAValidateException, DAException - Parameters:
teamShiftId- theBOTeamShiftresource- theBOResourcepoolKit- thePoolKit- Returns:
- the relation id
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
updateTeamShift
protected void updateTeamShift(BOTeamShift teamShift, BOWorkShift workShift, BOResource resource, PoolKit poolKit) throws DAValidateException, DAException Updates theBOTeamShiftwith the given data.- Parameters:
teamShift- theBOTeamShiftto updateworkShift- theBOWorkShiftresource- theBOResourcepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getIntegrationService
protected WorkforceIntegrationService getIntegrationService(PoolKit poolKit) throws DAValidateException Return theWorkforceIntegrationServiceused for access to other domains- Parameters:
poolKit- thePoolKit- Returns:
- Throws:
DAValidateException
-