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