Class BTTaskStateUpdate
java.lang.Object
overit.geocall.bl.BusinessTask<TaskStateUpdateEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<TaskStateUpdateEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<TaskStateUpdateEvent>
overit.geocallapp.wfm.core.bl.timesheet.timesheettask.task.BTTaskStateUpdate
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(TaskStateUpdateEvent.class)
public class BTTaskStateUpdate
extends ValidPermissionBusinessTask<TaskStateUpdateEvent>
Business task in order to update the state of the given
When the
BOTask. When the
TaskStateUpdateEvent is launched
the BT notices the call and updates the BOTask state basing on the event's input. - Since:
- 9.2
- 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 voidcancelLinkedTask(Long linkedTaskId, PoolKit pk) If the current task is being deleted, its linked task must be deleted as well.protected voidcheckBeforeUpdate(BOTask task, PoolKit pk) protected voidexecute(TaskStateUpdateEvent event, PoolKit pk) Updates theBOTaskstate, i.e. no other field of the timesheet task is going to be updated by this process.booleanDetermines whether the current state is valid for execution.prepareFilterData(BOTask task) Prepares the filter data in order to load the correct record to update.prepareUpdateData(BOTask task) Prepares the data that is going to be updated in the selected timesheet task.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
-
BTTaskStateUpdate
public BTTaskStateUpdate()
-
-
Method Details
-
execute
protected void execute(TaskStateUpdateEvent event, PoolKit pk) throws DAException, DAValidateException Updates theBOTaskstate, i.e. no other field of the timesheet task is going to be updated by this process.- Specified by:
executein classValidExecutionBusinessTask<TaskStateUpdateEvent>- Parameters:
event- the eventpk- the pool kit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
prepareFilterData
Prepares the filter data in order to load the correct record to update.- Parameters:
task- theBOTaskto update- Returns:
- the hash map that is going to be used as filter to update the task
-
prepareUpdateData
Prepares the data that is going to be updated in the selected timesheet task. Only the state of the timesheet task can be updated by this process, therefore all the other fields are removed.- Parameters:
task- theBOTaskwhich contains the update data (only the state)- Returns:
- the hash map that is going to be used as new values to update the task
-
checkBeforeUpdate
- Throws:
DAValidateExceptionDAException
-
cancelLinkedTask
protected void cancelLinkedTask(Long linkedTaskId, PoolKit pk) throws DAValidateException, DAException If the current task is being deleted, its linked task must be deleted as well.- Parameters:
linkedTaskId- the id of the linked task to deletepk- the poolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
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
-