Class BTAssetInsert
java.lang.Object
overit.geocall.bl.BusinessTask<AssetInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<AssetInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<AssetInsertEvent>
overit.geocallapp.wfm.assets.bl.task.BTAssetInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(AssetInsertEvent.class)
public class BTAssetInsert
extends ValidPermissionBusinessTask<AssetInsertEvent>
Business task in order to insert a
When the
Required fields header:
BOAsset. When the
AssetInsertEvent is launched
the BT notices the call and inserts the BOAsset basing on the event's input. Required fields header:
- Code
- Type
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 voidcheckUniqueCode(BOAsset asset, PoolKit poolKit) Verifies that the code of the given asset is unique.protected voidexecute(AssetInsertEvent event, PoolKit poolKit) Inserts a newBOAsset.protected LonginsertAsset(AssetInsertInput input, PoolKit poolKit) Inserts the given asset.protected voidinsertFakeContact(Long addressId, PoolKit poolKit) Inserts the given contacts.booleanDetermines whether the current state is valid for execution.protected voidupdateDefaultRoot(BOAsset asset, PoolKit poolKit) Update the asset root with the id value if the root is nullprotected voidupdateTimezone(BOAsset asset, PoolKit poolKit) Defines the asset time zone and aligns the creation date with it.protected voidvalidate(AssetInsertInput input, PoolKit poolKit) 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
-
BTAssetInsert
public BTAssetInsert()
-
-
Method Details
-
execute
protected void execute(AssetInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Inserts a newBOAsset. The id of the just inserted object is written into the journal of the event.- Specified by:
executein classValidExecutionBusinessTask<AssetInsertEvent>- Parameters:
event- theAssetInsertEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validate
protected void validate(AssetInsertInput input, PoolKit poolKit) throws DAValidateException, DAException Validates the data before the insertion.- Parameters:
input- theAssetInsertInputpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA 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
-
insertAsset
protected Long insertAsset(AssetInsertInput input, PoolKit poolKit) throws DAValidateException, DAException Inserts the given asset.- Parameters:
input- theAssetInsertInputpoolKit- thePoolKit- Returns:
- the id of the inserted
BOAsset - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
checkUniqueCode
protected void checkUniqueCode(BOAsset asset, PoolKit poolKit) throws DAValidateException, DAException Verifies that the code of the given asset is unique.- Parameters:
asset- the asset to checkpoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
updateTimezone
protected void updateTimezone(BOAsset asset, PoolKit poolKit) throws DAException, DAValidateException Defines the asset time zone and aligns the creation date with it.- Parameters:
asset- the assetpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
updateDefaultRoot
protected void updateDefaultRoot(BOAsset asset, PoolKit poolKit) throws DAException, DAValidateException Update the asset root with the id value if the root is null- Parameters:
asset- theBOAssetto updatepoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
insertFakeContact
protected void insertFakeContact(Long addressId, PoolKit poolKit) throws DAValidateException, DAException Inserts the given contacts.- Parameters:
addressId- address id to link the contactspoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-