Class BTWorkOrderOperationUnlink
java.lang.Object
overit.geocall.bl.BusinessTask<WorkOrderOperationUnlinkEvent>
overit.geocallapp.wfm.workorders.bl.operation.task.BTWorkOrderOperationUnlink
- All Implemented Interfaces:
Serializable,Tool
@Event(WorkOrderOperationUnlinkEvent.class)
public class BTWorkOrderOperationUnlink
extends BusinessTask<WorkOrderOperationUnlinkEvent>
Business task in order to unlink a parent
When the
BOWorkOrderOperation from its linked operations. When the
WorkOrderOperationUnlinkEvent is launched
the BT notices the call and unlinks the BOWorkOrderOperation basing on the event's input. - Since:
- 10.0
- See Also:
- GCApi:
- task
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbody(WorkOrderOperationUnlinkEvent event, PoolKit poolKit) Updates the parent operation and every single linked one by removing 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 voidupdateLinkedOperations(Long linkedOperationId, PoolKit poolKit) Updates the linked operation removing the link to the parent.protected voidupdateParent(Long parentId, List<Long> linkedOperations, PoolKit poolKit) Updates parent operation.Methods inherited from class overit.geocall.bl.BusinessTask
start, start, startAlone, startInBackground
-
Constructor Details
-
BTWorkOrderOperationUnlink
public BTWorkOrderOperationUnlink()
-
-
Method Details
-
body
protected void body(WorkOrderOperationUnlinkEvent event, PoolKit poolKit) throws DAException, DAValidateException Updates the parent operation and every single linked one by removing the link between them.- Specified by:
bodyin classBusinessTask<WorkOrderOperationUnlinkEvent>- Parameters:
event- theWorkOrderOperationUnlinkEventpoolKit- 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 business object
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
updateParent
protected void updateParent(Long parentId, List<Long> linkedOperations, PoolKit poolKit) throws DAException, DAValidateException Updates parent operation.- Parameters:
parentId- the parent operationlinkedOperations- the list of linked work order operationspoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
updateLinkedOperations
protected void updateLinkedOperations(Long linkedOperationId, PoolKit poolKit) throws DAException, DAValidateException Updates the linked operation removing the link to the parent.- Parameters:
linkedOperationId- the 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- the pool kit- 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
-