Class BTAssetChildInsert
java.lang.Object
overit.geocall.bl.BusinessTask<AssetChildInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<AssetChildInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<AssetChildInsertEvent>
overit.geocallapp.wfm.assets.bl.task.BTAssetChildInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(AssetChildInsertEvent.class)
public class BTAssetChildInsert
extends ValidPermissionBusinessTask<AssetChildInsertEvent>
Business task in order to insert a
BOAsset as child of another given one.
When the AssetChildInsertEvent is launched
the BT notices the call and inserts the BOAsset basing on the event's input.
Permission:
Error Code:
- Since:
- 16.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 voidcheckNoLoop(Long parentRootId, Long childId, PoolKit pk) Check that no loops form when insertingprotected voidexecute(AssetChildInsertEvent event, PoolKit poolKit) Inserts the givenBOAssetas child of the given parent one.booleanDetermines whether the current state is valid for execution.protected BOAssetLoads theBOAssetfrom the given id.protected voidupdateAsset(BOAsset asset, PoolKit poolKit) Updates the givenBOAsset.protected voidvalidate(AssetChildInsertInput input) Validates the data before the insertion.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
-
BTAssetChildInsert
public BTAssetChildInsert()
-
-
Method Details
-
execute
protected void execute(AssetChildInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Inserts the givenBOAssetas child of the given parent one.- Specified by:
executein classValidExecutionBusinessTask<AssetChildInsertEvent>- Parameters:
event- theAssetChildInsertEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
isValidExecution
public boolean isValidExecution()Description copied from interface:ValidExecutionDetermines whether the current state is valid for execution.- Returns:
- true if execution is valid, false otherwise
-
validate
Validates the data before the insertion.- Parameters:
input- theAssetChildInsertInput- Throws:
DAValidateException- the DA validate exception
-
loadAsset
Loads theBOAssetfrom the given id.- Parameters:
id- theBOAssetidpoolKit- thePoolKit- Returns:
- the loaded
BOAsset - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
checkNoLoop
protected void checkNoLoop(Long parentRootId, Long childId, PoolKit pk) throws DAValidateException, DAException Check that no loops form when inserting- Parameters:
parentRootId- the parent root id of asset childchildId- the given id of asset childpk- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
updateAsset
Updates the givenBOAsset.- Parameters:
asset- theBOAssetto updatepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-