Class BTWorkOrderOperationAddressesRetrieve
java.lang.Object
overit.geocall.bl.BusinessTask<WorkOrderOperationAddressesRetrieveEvent>
overit.geocallapp.wfm.workorders.bl.operation.task.BTWorkOrderOperationAddressesRetrieve
- All Implemented Interfaces:
Serializable,Tool
@Event(WorkOrderOperationAddressesRetrieveEvent.class)
public class BTWorkOrderOperationAddressesRetrieve
extends BusinessTask<WorkOrderOperationAddressesRetrieveEvent>
Business Task to get address IDs for work order operations.
For each work order operation, returns the address ID using priority:
- Scheduling address (AWOOSCHEDULEID_AADD) if exists
- Operation address (AWOOID_AADD) if scheduling address doesn't exist
- Header address (AWORID_AADD) if neither scheduling nor operation address exist
- Since:
- 22.0
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbody(WorkOrderOperationAddressesRetrieveEvent workOrderOperationAddressEvent, PoolKit poolKit) Implements this method to write the specific task logic to handle the input parameter.buildAddressMap(List<BOWorkOrderOperation> operations, Map<Long, BOWorkOrderHeader> headersById) Build address map with priority: scheduling > operation > header.protected Map<Long, BOWorkOrderHeader> loadHeaders(List<Long> headerIds, PoolKit poolKit) Load work order headers by IDs and return as map.protected List<BOWorkOrderOperation> loadOperations(List<Long> operationIds, PoolKit poolKit) Load work order operations by IDs.Methods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTWorkOrderOperationAddressesRetrieve
public BTWorkOrderOperationAddressesRetrieve()
-
-
Method Details
-
body
protected void body(WorkOrderOperationAddressesRetrieveEvent workOrderOperationAddressEvent, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:BusinessTaskImplements this method to write the specific task logic to handle the input parameter.- Specified by:
bodyin classBusinessTask<WorkOrderOperationAddressesRetrieveEvent>- Parameters:
workOrderOperationAddressEvent- the object upon which the task will works onpoolKit- the poolkit containing the reference to the database connection that can be used- Throws:
DAException- in case of database errorDAValidateException- in case of database validation error
-
loadOperations
protected List<BOWorkOrderOperation> loadOperations(List<Long> operationIds, PoolKit poolKit) throws DAValidateException, DAException Load work order operations by IDs.- Throws:
DAValidateExceptionDAException
-
loadHeaders
protected Map<Long,BOWorkOrderHeader> loadHeaders(List<Long> headerIds, PoolKit poolKit) throws DAValidateException, DAException Load work order headers by IDs and return as map.- Throws:
DAValidateExceptionDAException
-
buildAddressMap
protected Map<Long,Long> buildAddressMap(List<BOWorkOrderOperation> operations, Map<Long, BOWorkOrderHeader> headersById) Build address map with priority: scheduling > operation > header.- Parameters:
operations- the work order operationsheadersById- map of header ID to header- Returns:
- map of operation ID to address ID
-