Class BTWorkOrderHeaderInsert
java.lang.Object
overit.geocall.bl.BusinessTask<WorkOrderHeaderInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<WorkOrderHeaderInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<WorkOrderHeaderInsertEvent>
overit.geocallapp.wfm.workorders.bl.header.task.BTWorkOrderHeaderInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(WorkOrderHeaderInsertEvent.class)
public class BTWorkOrderHeaderInsert
extends ValidPermissionBusinessTask<WorkOrderHeaderInsertEvent>
Business task to insert a work order header.
The new work order is created in a draft state.
The new work order is created in a draft state.
Permission:
Error Code:
- 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 StringcalculateNewCode(Long operationCenterId, Long workOrderId, PoolKit poolKit) Method that calculate the work order code if the code in input is null.protected voidcheckCode(BOWorkOrderHeader header, PoolKit poolKit) Method that check the code, these checks are done only if the code is an input propertyprotected voidexecute(WorkOrderHeaderInsertEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected LonginsertWoHeader(BOWorkOrderHeader header, PoolKit poolKit) Insert theBOWorkOrderHeaderand generate a new code if the input code is nullbooleanDetermines whether the current state is valid for execution.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
-
helper
-
-
Constructor Details
-
BTWorkOrderHeaderInsert
public BTWorkOrderHeaderInsert()
-
-
Method Details
-
execute
protected void execute(WorkOrderHeaderInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<WorkOrderHeaderInsertEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
checkCode
protected void checkCode(BOWorkOrderHeader header, PoolKit poolKit) throws DAValidateException, DAException Method that check the code, these checks are done only if the code is an input property- Parameters:
header- the work order input headerpoolKit- thePoolKit- Throws:
DAValidateExceptionDAException
-
insertWoHeader
protected Long insertWoHeader(BOWorkOrderHeader header, PoolKit poolKit) throws DAValidateException, DAException Insert theBOWorkOrderHeaderand generate a new code if the input code is null- Parameters:
header- theBOWorkOrderHeaderto insertpoolKit- thePoolKit- Throws:
DAExceptionDAValidateException
-
calculateNewCode
protected String calculateNewCode(Long operationCenterId, Long workOrderId, PoolKit poolKit) throws DAException, DAValidateException Method that calculate the work order code if the code in input is null. If the operation center is null the calculated code will be a default one, if the operation center is not null then the eventWorkOrderGenerateCodeEventwill be called.- Parameters:
operationCenterId- the operation center idworkOrderId- the work order idpoolKit- thePoolKit- Returns:
- a string with the new work order code
- Throws:
DAException- theDAExceptiongeneric error thrown if there are code related errorsDAValidateException- theDAValidateExceptionthrown if there are data related loading errors
-
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
-