Class BTWorkOrderHeaderOperationCenterAssignment
java.lang.Object
overit.geocall.bl.BusinessTask<WorkOrderHeaderOperationCenterAssignmentEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<WorkOrderHeaderOperationCenterAssignmentEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<WorkOrderHeaderOperationCenterAssignmentEvent>
overit.geocallapp.wfm.workorders.bl.header.task.BTWorkOrderHeaderOperationCenterAssignment
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(WorkOrderHeaderOperationCenterAssignmentEvent.class)
public class BTWorkOrderHeaderOperationCenterAssignment
extends ValidPermissionBusinessTask<WorkOrderHeaderOperationCenterAssignmentEvent>
Business task in order to assign an operation center and create a new code.
When the
When the
WorkOrderHeaderOperationCenterAssignmentEvent is launched the BT notices the call
and loads the BOWorkOrderHeader basing on the event's input.
After validating it, it will create the new code and finally update the operation center and the work order code Required fields:
- work order header id
- operation center
Permission:
- Since:
- 18.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 voidcheckNotNull(Long operationCenter, Long workOrderId) Check required propertiesprotected voidexecute(WorkOrderHeaderOperationCenterAssignmentEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected StringgetNewCode(Long operationCenter, PoolKit poolKit) Launches theWorkOrderGenerateCodeEventevent to generate a new codebooleanDetermines whether the current state is valid for execution.protected voidupdateWorkOrder(PoolKit poolKit, Long operationCenter, BOWorkOrderHeader workOrder) Update the operation center and code fields of the work orderprotected voidvalidation(BOWorkOrderHeader workOrder) Check that the work order status is DRAFTMethods 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
-
BTWorkOrderHeaderOperationCenterAssignment
public BTWorkOrderHeaderOperationCenterAssignment()
-
-
Method Details
-
execute
protected void execute(WorkOrderHeaderOperationCenterAssignmentEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<WorkOrderHeaderOperationCenterAssignmentEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
checkNotNull
Check required properties- Parameters:
operationCenter- the operation centerworkOrderId- the work order id- Throws:
DAValidateException
-
validation
Check that the work order status is DRAFT- Parameters:
workOrder- theBOWorkOrderHeader- Throws:
DAValidateException
-
updateWorkOrder
protected void updateWorkOrder(PoolKit poolKit, Long operationCenter, BOWorkOrderHeader workOrder) throws DAValidateException, DAException Update the operation center and code fields of the work order- Parameters:
poolKit-operationCenter- the operation centerworkOrder- theBOWorkOrderHeader- Throws:
DAValidateExceptionDAException
-
getNewCode
protected String getNewCode(Long operationCenter, PoolKit poolKit) throws DAValidateException, DAException Launches theWorkOrderGenerateCodeEventevent to generate a new code- Parameters:
operationCenter- the operation centerpoolKit- the poolkit- Returns:
- the new code
- Throws:
DAValidateExceptionDAException
-
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
-