Class BTCustomerInsert
java.lang.Object
overit.geocall.bl.BusinessTask<CustomerInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<CustomerInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<CustomerInsertEvent>
overit.geocallapp.wfm.core.bl.technicalobject.task.BTCustomerInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(CustomerInsertEvent.class)
public class BTCustomerInsert
extends ValidPermissionBusinessTask<CustomerInsertEvent>
Task to insert a Customer, including the main
TechnicalObject with
its BOMeters and BOContacts. Permission:
- Since:
- 9.2
- 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(CustomerInsertEvent event, PoolKit poolKit) Executes the actual business logic after validation has passed.protected voidinsertContacts(CustomerInsertEvent event, Long addressId, PoolKit poolKit) Insert the given contactsprotected voidinsertMeters(CustomerInsertEvent event, Long addressId, PoolKit poolKit) Insert the customer's metersbooleanDetermines whether the current state is valid for execution.protected LongloadAddressId(Long headerId, PoolKit poolKit) Load the id of the new addressMethods 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
-
BTCustomerInsert
public BTCustomerInsert()
-
-
Method Details
-
execute
protected void execute(CustomerInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Description copied from class:ValidExecutionBusinessTaskExecutes the actual business logic after validation has passed.- Specified by:
executein classValidExecutionBusinessTask<CustomerInsertEvent>- Parameters:
event- the input event to processpoolKit- thePoolKit- Throws:
DAException- if a data access error occurs during executionDAValidateException- if validation fails during execution
-
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
-
loadAddressId
protected Long loadAddressId(Long headerId, PoolKit poolKit) throws DAValidateException, DAException Load the id of the new address- Parameters:
headerId- the just created header idpoolKit- the Pool-kit to keep the transaction- Returns:
- the id of the new address id
- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
insertMeters
protected void insertMeters(CustomerInsertEvent event, Long addressId, PoolKit poolKit) throws DAValidateException, DAException Insert the customer's meters- Parameters:
event- input eventaddressId- the id of the address associated to the customerpoolKit- the Pool-kit to keep the transaction- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
insertContacts
protected void insertContacts(CustomerInsertEvent event, Long addressId, PoolKit poolKit) throws DAValidateException, DAException Insert the given contacts- Parameters:
event- input eventaddressId- the id of the address associated to the customerpoolKit- the Pool-kit to keep the transaction- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-