Class BTWorkOrderAttachmentInsert
java.lang.Object
overit.geocall.bl.BusinessTask<WorkOrderAttachmentInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<WorkOrderAttachmentInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<WorkOrderAttachmentInsertEvent>
overit.geocallapp.wfm.orchestrator.workorders.bl.attachment.task.BTWorkOrderAttachmentInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(WorkOrderAttachmentInsertEvent.class)
public class BTWorkOrderAttachmentInsert
extends ValidPermissionBusinessTask<WorkOrderAttachmentInsertEvent>
Business task in order to insert a
When the
BOAttachment related to a work order. When the
WorkOrderAttachmentInsertEvent is launched the BT notices the call and
inserts the BOAttachment related to the given work order. Error Code:
Codes.Attachment.ALREADY_EXISTS
Permission:
- Since:
- 20.0
- See Also:
- GCApi:
- task
-
Field Summary
Fields inherited from class overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask
LOG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidexecute(WorkOrderAttachmentInsertEvent event, PoolKit poolKit) Executes the work order attachment insert operation.getIntegrationService(PoolKit poolKit) Retrieves theWorkOrdersIntegrationServiceinstance.booleanDetermines if this task is valid for execution.protected BOAddressloadAddress(Long addressId, PoolKit poolKit) Loads an address by its ID.protected BOWorkOrderHeaderloadWorkOrderHeader(Long workOrderId, PoolKit poolKit) Loads a work order header by its id.voidvalidate(WorkOrderAttachmentInsertInput input, PoolKit poolKit) Validates the input parameters for the work order attachment insert operation.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
-
Constructor Details
-
BTWorkOrderAttachmentInsert
public BTWorkOrderAttachmentInsert()
-
-
Method Details
-
execute
protected void execute(WorkOrderAttachmentInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Executes the work order attachment insert operation. This method performs the following steps:- Loads the work order header using the ID from the event input
- Loads the address associated with the work order
- Creates a new attachment object with the work order and technical object references
- Launches a
AttachmentInsertEventto complete the insert process - Writes the created attachment ID to the event journal
- Specified by:
executein classValidExecutionBusinessTask<WorkOrderAttachmentInsertEvent>- Parameters:
event- TheWorkOrderAttachmentInsertEventcontaining the work order IDpoolKit- ThePoolKitproviding access to the data layer- Throws:
DAException- If a data access error occurs during the operationDAValidateException- If validation of the data fails
-
validate
public void validate(WorkOrderAttachmentInsertInput input, PoolKit poolKit) throws DAValidateException, DAException Validates the input parameters for the work order attachment insert operation.- Parameters:
input- TheWorkOrderAttachmentInsertInputcontaining the work order IDpoolKit- ThePoolKitproviding access to the data layer- Throws:
DAValidateException- If validation of the data failsDAException
-
loadWorkOrderHeader
protected BOWorkOrderHeader loadWorkOrderHeader(Long workOrderId, PoolKit poolKit) throws DAException, DAValidateException Loads a work order header by its id.- Parameters:
workOrderId- The id of the work order to loadpoolKit- ThePoolKitproviding access to the data layer- Returns:
- The
BOWorkOrderHeaderfor the specified work order id - Throws:
DAException- If a data access error occurs during the operationDAValidateException- If validation of the data fails
-
loadAddress
protected BOAddress loadAddress(Long addressId, PoolKit poolKit) throws DAException, DAValidateException Loads an address by its ID.- Parameters:
addressId- The ID of the address to loadpoolKit- ThePoolKitproviding access to the data layer- Returns:
- The
BOAddressfor the specified address ID - Throws:
DAException- If a data access error occurs during the operationDAValidateException- If validation of the data fails
-
getIntegrationService
public WorkOrdersIntegrationService getIntegrationService(PoolKit poolKit) throws DAValidateException Retrieves theWorkOrdersIntegrationServiceinstance. If the instance hasn't been created yet, it will be created and stored for future use.- Parameters:
poolKit- ThePoolKitproviding access to the data layer- Returns:
- The
WorkOrdersIntegrationServiceinstance - Throws:
DAValidateException- If validation of the data fails during service creation
-
isValidExecution
public boolean isValidExecution()Determines if this task is valid for execution. This method always returns true, indicating that this task can be executed without additional permission checks beyond those performed by the base class.- Returns:
trueindicating that the task is always valid for execution
-