Class BTWorkShiftExceptionInsert
java.lang.Object
overit.geocall.bl.BusinessTask<WorkShiftExceptionInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<WorkShiftExceptionInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<WorkShiftExceptionInsertEvent>
overit.geocallapp.wfm.calendars.bl.workshift.exception.task.BTWorkShiftExceptionInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(WorkShiftExceptionInsertEvent.class)
public class BTWorkShiftExceptionInsert
extends ValidPermissionBusinessTask<WorkShiftExceptionInsertEvent>
Business task in order to insert a
When the
BOWorkShiftException. When the
WorkShiftExceptionInsertEvent is launched the BT notices the call and
inserts the BOWorkShiftException basing on the event's input. Error Code:
- 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 voidcompleteWorkShiftExceptionData(BOWorkShiftException workShiftException, PoolKit poolKit) Validates the start day and the end day.protected voidexecute(WorkShiftExceptionInsertEvent event, PoolKit poolKit) Writes the ID of the insertedBOWorkShiftExceptionobject into the event journal.protected List<BOWorkShift> getWorkShifts(BOWorkShiftException workShiftException, PoolKit poolKit) Extracts the list ofBOWorkShiftrelated to a given resource for a certain day.booleanDetermines whether the current state is valid for execution.protected List<BOWorkShift> loadOverlappingWorkShifts(BOWorkShiftException workShiftException, PoolKit poolKit) Loads the list of specificBOWorkShiftby using aBOWorkShiftException.protected BOWorkShiftExceptionClassloadWorkShiftExceptionClass(BOWorkShiftExceptionType workShiftExceptionType, PoolKit poolKit) protected BOWorkShiftExceptionTypeloadWorkShiftExceptionType(BOWorkShiftException input, PoolKit poolKit) protected voidnofityInsert(BOWorkShiftException workShiftException, PoolKit poolKit) protected voidupdateRelation(BOWorkShiftException workShiftException, PoolKit poolKit) protected voidvalidate(BOWorkShiftException input, List<BOWorkShift> workShiftList, PoolKit poolKit) Checks whether the insertion is possible by performing some validations on the givenBOWorkShiftException.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
-
BTWorkShiftExceptionInsert
public BTWorkShiftExceptionInsert()
-
-
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(WorkShiftExceptionInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Writes the ID of the insertedBOWorkShiftExceptionobject into the event journal.- Specified by:
executein classValidExecutionBusinessTask<WorkShiftExceptionInsertEvent>- Parameters:
event- theWorkShiftExceptionInsertEventpoolKit- thePoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionis thrown
-
getWorkShifts
protected List<BOWorkShift> getWorkShifts(BOWorkShiftException workShiftException, PoolKit poolKit) throws DAValidateException, DAException Extracts the list ofBOWorkShiftrelated to a given resource for a certain day.- Parameters:
workShiftException- theBOWorkShiftExceptionpoolKit- thePoolKit- Returns:
- the list of work shifts related to a given resource for a certain day
- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionis thrown
-
validate
protected void validate(BOWorkShiftException input, List<BOWorkShift> workShiftList, PoolKit poolKit) throws DAException, DAValidateException Checks whether the insertion is possible by performing some validations on the givenBOWorkShiftException.- Parameters:
input- theBOWorkShiftExceptionTypepoolKit- thePoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionis thrown
-
loadWorkShiftExceptionClass
protected BOWorkShiftExceptionClass loadWorkShiftExceptionClass(BOWorkShiftExceptionType workShiftExceptionType, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
loadWorkShiftExceptionType
protected BOWorkShiftExceptionType loadWorkShiftExceptionType(BOWorkShiftException input, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
loadOverlappingWorkShifts
protected List<BOWorkShift> loadOverlappingWorkShifts(BOWorkShiftException workShiftException, PoolKit poolKit) throws DAValidateException, DAException Loads the list of specificBOWorkShiftby using aBOWorkShiftException.- Parameters:
workShiftException- theBOWorkShiftExceptionpoolKit- thePoolKit- Returns:
- the list of overlapping work shifts
- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionis thrown
-
completeWorkShiftExceptionData
protected void completeWorkShiftExceptionData(BOWorkShiftException workShiftException, PoolKit poolKit) throws DAException, DAValidateException Validates the start day and the end day.- Parameters:
workShiftException- theBOWorkShiftExceptionpoolKit- thePoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionis thrown
-
nofityInsert
protected void nofityInsert(BOWorkShiftException workShiftException, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
updateRelation
protected void updateRelation(BOWorkShiftException workShiftException, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-