Class BTAssetAttachmentInsert
java.lang.Object
overit.geocall.bl.BusinessTask<AssetAttachmentInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<AssetAttachmentInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<AssetAttachmentInsertEvent>
overit.geocallapp.wfm.orchestrator.assets.bl.attachments.BTAssetAttachmentInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(AssetAttachmentInsertEvent.class)
public class BTAssetAttachmentInsert
extends ValidPermissionBusinessTask<AssetAttachmentInsertEvent>
Business task in order to insert a
When the
BOAttachment related to an asset. When the
AssetAttachmentInsertEvent is launched the BT notices the call and
inserts the BOAttachment related to the given asset. 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(AssetAttachmentInsertEvent event, PoolKit poolKit) Executes the asset attachment insert operation.getIntegrationService(PoolKit poolKit) Retrieves theAssetsIntegrationServiceinstance.booleanDetermines if this task is valid for execution.protected voidvalidate(AssetAttachmentInsertInput input, PoolKit poolKit) Validates the input for the asset 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
-
BTAssetAttachmentInsert
public BTAssetAttachmentInsert()
-
-
Method Details
-
execute
protected void execute(AssetAttachmentInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Executes the asset attachment insert operation. This method performs the following steps:- Creates a new attachment object with the asset reference
- Launches a
AttachmentInsertEventto complete the insert process - Writes the created attachment ID to the event journal
- Specified by:
executein classValidExecutionBusinessTask<AssetAttachmentInsertEvent>- Parameters:
event- TheAssetAttachmentInsertEventcontaining the asset 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
protected void validate(AssetAttachmentInsertInput input, PoolKit poolKit) throws DAValidateException, DAException Validates the input for the asset attachment insert operation. This method performs the following checks:- Verifies that the asset ID is not null
- Loads the asset to ensure it exists
- Checks if an attachment with the same UUID already exists for the asset
- Parameters:
input- TheAssetAttachmentInsertInputcontaining the input datapoolKit- ThePoolKitproviding access to the data layer- Throws:
DAException- If a data access error occurs during the operationDAValidateException- If validation of the data fails
-
getIntegrationService
Retrieves theAssetsIntegrationServiceinstance. 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
AssetsIntegrationServiceinstance - 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
-