Class BTCrewShellUpdate
java.lang.Object
overit.geocall.bl.BusinessTask<CrewShellUpdateEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<CrewShellUpdateEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<CrewShellUpdateEvent>
overit.geocallapp.wfm.crewshell.bl.task.BTCrewShellManagement<CrewShellUpdateEvent>
overit.geocallapp.wfm.core.bl.crewshell.task.BTCrewShellUpdate
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(CrewShellUpdateEvent.class)
public class BTCrewShellUpdate
extends BTCrewShellManagement<CrewShellUpdateEvent>
Business task in order to update a
When the
BOCrewShell object. When the
CrewShellUpdateEvent event is launched the BT notices the
call and inserts the BOCrewShell object basing on the event's input. - Since:
- 16.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 voidaddTombstone(BOCrewShell oldCrewShell, BOCrewShell crewShell, PoolKit poolKit) Adds a tombstone for theBOCrewShellobject (i.e., the crew shell) if it is activated.protected voidcheckDisable(BOCrewShell crewShell, PoolKit poolKit) Checks if theBOCrewShellobject (i.e., the crew shell) can be deactivated.protected voidexecute(CrewShellUpdateEvent event, PoolKit pk) Executes the actual business logic after validation has passed.protected BOSchedulingUsergetDummyUser(Long dummyUser, PoolKit poolKit) Retrieves theBOSchedulingUserobject (i.e., the dummy user) associated with theBOCrewShellobject (i.e., the event input)booleanDetermines whether the current state is valid for execution.protected voidupdateDummyUser(BOCrewShell crewShell, PoolKit poolKit) Updates theBOSchedulingUserobject (i.e., the dummy user) associated with theBOCrewShellobject (i.e., the event input)Methods inherited from class overit.geocallapp.wfm.crewshell.bl.task.BTCrewShellManagement
retrieveCrewShellsByCode, validateCodeDuplication, validateCrewSize, validateFieldsLength, validateMandatoryFieldsMethods 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
-
BTCrewShellUpdate
public BTCrewShellUpdate()
-
-
Method Details
-
isValidExecution
public boolean isValidExecution()Description copied from interface:ValidExecutionDetermines whether the current state is valid for execution.- Specified by:
isValidExecutionin interfaceValidExecution- Overrides:
isValidExecutionin classBTCrewShellManagement<CrewShellUpdateEvent>- Returns:
- true if execution is valid, false otherwise
-
execute
protected void execute(CrewShellUpdateEvent event, PoolKit pk) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<CrewShellUpdateEvent>- Parameters:
event- the input event to processpk- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
updateDummyUser
protected void updateDummyUser(BOCrewShell crewShell, PoolKit poolKit) throws DAException, DAValidateException Updates theBOSchedulingUserobject (i.e., the dummy user) associated with theBOCrewShellobject (i.e., the event input)- Parameters:
crewShell- theBOCrewShellobject (i.e., the event input)poolKit- thePoolKitpoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
getDummyUser
protected BOSchedulingUser getDummyUser(Long dummyUser, PoolKit poolKit) throws DAException, DAValidateException Retrieves theBOSchedulingUserobject (i.e., the dummy user) associated with theBOCrewShellobject (i.e., the event input)- Parameters:
dummyUser- theBOCrewShellobject's dummyUser field valuepoolKit- thePoolKitpoolKit- Returns:
- the
BOSchedulingUserobject - Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
checkDisable
protected void checkDisable(BOCrewShell crewShell, PoolKit poolKit) throws DAValidateException, DAException Checks if theBOCrewShellobject (i.e., the crew shell) can be deactivated. It cannot be deactivated if it has scheduled activities, therefore, it throws aDAValidateExceptionobject (i.e., Codes.CREW_SHELL_ACTIVITIES_SCHEDULED).- Parameters:
crewShell- theBOCrewShellobjectpoolKit- thePoolKitpoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-
addTombstone
protected void addTombstone(BOCrewShell oldCrewShell, BOCrewShell crewShell, PoolKit poolKit) throws DAException, DAValidateException Adds a tombstone for theBOCrewShellobject (i.e., the crew shell) if it is activated.- Parameters:
oldCrewShell- the previous state of theBOCrewShellobject before updatecrewShell- the current state of theBOCrewShellobject after updatepoolKit- thePoolKitpoolKit- Throws:
DAValidateException- if there is a data validation exceptionDAException- if a genericExceptionobject is thrown
-