Class BTWorkOrderGenerateCode
java.lang.Object
overit.geocall.bl.BusinessTask<WorkOrderGenerateCodeEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<WorkOrderGenerateCodeEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<WorkOrderGenerateCodeEvent>
overit.geocallapp.wfm.orchestrator.workorders.bl.task.BTWorkOrderGenerateCode
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(WorkOrderGenerateCodeEvent.class)
public class BTWorkOrderGenerateCode
extends ValidPermissionBusinessTask<WorkOrderGenerateCodeEvent>
Business task in order to generate a
BOWorkOrderHeader Code.
When the WorkOrderGenerateCodeEvent is launched the BT notices the
call and generate a new Work Order code based on the event's input.
Permission:
- 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 voidexecute(WorkOrderGenerateCodeEvent event, PoolKit pk) Executes the actual business logic after validation has passed.protected StringgenerateCode(Long operationCenterId, PoolKit poolKit) Method that generates work order's code by concatenating operation center's code and sequential number, ex. given operation center's code C01 and sequential number 1 -> CO100001.protected WorkOrdersIntegrationServicegetIntegrationService(PoolKit poolKit) Returns the integration service.booleanDetermines 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
-
integrationService
-
-
Constructor Details
-
BTWorkOrderGenerateCode
public BTWorkOrderGenerateCode()
-
-
Method Details
-
execute
protected void execute(WorkOrderGenerateCodeEvent event, PoolKit pk) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<WorkOrderGenerateCodeEvent>- Parameters:
event- the input event to processpk- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
generateCode
protected String generateCode(Long operationCenterId, PoolKit poolKit) throws DAValidateException, DAException Method that generates work order's code by concatenating operation center's code and sequential number, ex. given operation center's code C01 and sequential number 1 -> CO100001.- Parameters:
operationCenterId- operation center id, filter of the searchpoolKit- thePoolKit- Returns:
- the work order code
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getIntegrationService
protected WorkOrdersIntegrationService getIntegrationService(PoolKit poolKit) throws DAValidateException Returns the integration service.- Parameters:
poolKit- thePoolKit- Returns:
- the integration service
- Throws:
DAValidateException- the DA validate 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
-