Class BTWorkOrderHeaderUpdate
java.lang.Object
overit.geocall.bl.BusinessTask<WorkOrderHeaderUpdateEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<WorkOrderHeaderUpdateEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<WorkOrderHeaderUpdateEvent>
overit.geocallapp.wfm.workorders.bl.header.task.BTWorkOrderHeaderUpdate
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(WorkOrderHeaderUpdateEvent.class)
public class BTWorkOrderHeaderUpdate
extends ValidPermissionBusinessTask<WorkOrderHeaderUpdateEvent>
Business task in order to update a
BOWorkOrderHeader.Required fields:
- work order id
Permission:
Error Code:
Codes.UNMODIFIABLE_PROPERTYCodes.WorkOrderHeader.UNMODIFIABLE_TYPE_FOR_STATECodes.WorkOrderHeader.UNMODIFIABLE_STATUSCodes.WorkOrderHeader.NO_OPERATIONSCodes.PROPERTY_REQUIREDCodes.INVALID_PROPERTY_VALUECodes.INVALID_DATE_INTERVAL_AFTER
Visibility:
- the work order header required must be associated to the same current user's operation center
- Since:
- 16.0
- See Also:
- GCApi:
- task
-
Field Summary
FieldsFields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidalignTypeForeignKeys(BOWorkOrderHeader workOrderHeaderOld, BOWorkOrderHeader workOrderHeaderNew, PoolKit poolKit) Check if the type is editable.protected voidexecute(WorkOrderHeaderUpdateEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected booleanisAppointmentEditable(BOWorkOrderHeader workOrderHeaderOld, List<BOWorkOrderOperation> operations) Checks if the appointment is editable, evaluating work order status and operations type.booleanDetermines whether the current state is valid for execution.protected voidmanageAppointmentDates(BOWorkOrderHeader workOrderHeaderOld, BOWorkOrderHeader workOrderHeaderNew, List<BOWorkOrderOperation> operations) Manage the appointment dates, evaluating if work order can be updated or notprotected voidupdate(BOWorkOrderHeader workOrderHeaderNew, boolean isHistory, PoolKit poolKit) 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
-
Field Details
-
invalidStatusForAppointment
-
-
Constructor Details
-
BTWorkOrderHeaderUpdate
public BTWorkOrderHeaderUpdate()
-
-
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(WorkOrderHeaderUpdateEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<WorkOrderHeaderUpdateEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
update
protected void update(BOWorkOrderHeader workOrderHeaderNew, boolean isHistory, PoolKit poolKit) throws DAException, DAValidateException - Throws:
DAExceptionDAValidateException
-
alignTypeForeignKeys
protected void alignTypeForeignKeys(BOWorkOrderHeader workOrderHeaderOld, BOWorkOrderHeader workOrderHeaderNew, PoolKit poolKit) throws DAValidateException, DAException Check if the type is editable. If the type is changed, evaluate the request type, service type and technical object type- Parameters:
workOrderHeaderOld- theBOWorkOrderHeadercurrently saved in the dbworkOrderHeaderNew- theBOWorkOrderHeaderwith new valuespoolKit- thePoolKit- Throws:
DAValidateException- if the type can not be editedDAException- if something went wrong
-
manageAppointmentDates
protected void manageAppointmentDates(BOWorkOrderHeader workOrderHeaderOld, BOWorkOrderHeader workOrderHeaderNew, List<BOWorkOrderOperation> operations) throws DAValidateException Manage the appointment dates, evaluating if work order can be updated or not- Parameters:
workOrderHeaderOld- theBOWorkOrderHeadercurrently saved in the dbworkOrderHeaderNew- theBOWorkOrderHeaderwith new valuesoperations- the operations associated with this work order- Throws:
DAValidateException- if the appointment dates can not be edited
-
isAppointmentEditable
protected boolean isAppointmentEditable(BOWorkOrderHeader workOrderHeaderOld, List<BOWorkOrderOperation> operations) throws DAValidateException Checks if the appointment is editable, evaluating work order status and operations type.- Parameters:
workOrderHeaderOld- theBOWorkOrderHeadercurrently saved in the dboperations- the operations associated with this work order- Returns:
- true if the appointment is editable
- Throws:
DAValidateException- the DA validate exception
-