Class BTWorkOrderOperationLink
java.lang.Object
overit.geocall.bl.BusinessTask<WorkOrderOperationLinkEvent>
overit.geocallapp.wfm.workorders.bl.operation.task.BTWorkOrderOperationLink
- All Implemented Interfaces:
Serializable,Tool
@Event(WorkOrderOperationLinkEvent.class)
public class BTWorkOrderOperationLink
extends BusinessTask<WorkOrderOperationLinkEvent>
Business task in order to link a
When the
BOWorkOrderOperation (parent) with a set of other linked operations. When the
WorkOrderOperationLinkEvent is launched
the BT notices the call and links the BOWorkOrderOperation basing on the event's input. - Since:
- 10.0
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbody(WorkOrderOperationLinkEvent event, PoolKit poolKit) Updates the parent operation and the linked ones in order to create the link between them.protected BOWorkOrderOperationloadWorkOrderOperation(Long operationId, PoolKit poolKit) Loads the work order operation with work order operation identifier.prepareFilterData(BOWorkOrderOperation operation) Prepares the filter data in order to load the correct record to update.prepareUpdateData(BOWorkOrderOperation operation) Prepares the data that is going to be updated in the selected work order operation.protected voidupdate(BOWorkOrderOperation operation, PoolKit poolKit) Performs the database update.protected voidupdateLinkedOperation(Long parentId, Long linkedOperationId, PoolKit poolKit) Updates the linked operation setting its parent.protected voidupdateParent(Long parentId, List<Long> linkedOperations, PoolKit poolKit) Updates the parent operation setting the link with all the linked operation ids.Methods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTWorkOrderOperationLink
public BTWorkOrderOperationLink()
-
-
Method Details
-
body
protected void body(WorkOrderOperationLinkEvent event, PoolKit poolKit) throws DAException, DAValidateException Updates the parent operation and the linked ones in order to create the link between them.- Specified by:
bodyin classBusinessTask<WorkOrderOperationLinkEvent>- Parameters:
event- theWorkOrderOperationLinkEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
loadWorkOrderOperation
protected BOWorkOrderOperation loadWorkOrderOperation(Long operationId, PoolKit poolKit) throws DAValidateException, DAException Loads the work order operation with work order operation identifier.- Parameters:
operationId- the work order operation idpoolKit- thePoolKit- Returns:
- the work order operation
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
updateParent
protected void updateParent(Long parentId, List<Long> linkedOperations, PoolKit poolKit) throws DAException, DAValidateException Updates the parent operation setting the link with all the linked operation ids.- Parameters:
parentId- the parent idlinkedOperations- list of linked work order operationspoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
updateLinkedOperation
protected void updateLinkedOperation(Long parentId, Long linkedOperationId, PoolKit poolKit) throws DAException, DAValidateException Updates the linked operation setting its parent.- Parameters:
parentId- the parent idlinkedOperationId- list of linked work order operationspoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
update
protected void update(BOWorkOrderOperation operation, PoolKit poolKit) throws DAException, DAValidateException Performs the database update.- Parameters:
operation- the operationpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
prepareFilterData
Prepares the filter data in order to load the correct record to update.- Parameters:
operation- theBOWorkOrderOperationto update- Returns:
- the map that is going to be used as filter to update the operation
-
prepareUpdateData
Prepares the data that is going to be updated in the selected work order operation. Only the parent and the linked operations set can be updated by this process, therefore all the other fields are removed.- Parameters:
operation- theBOWorkOrderOperationto update- Returns:
- the map that is going to be used as new values to update the operation
-