Class BTAccountContactInsert
java.lang.Object
overit.geocall.bl.BusinessTask<AccountContactInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<AccountContactInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<AccountContactInsertEvent>
overit.geocallapp.wfm.accounts.bl.account.contact.task.BTAccountContactInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(AccountContactInsertEvent.class)
public class BTAccountContactInsert
extends ValidPermissionBusinessTask<AccountContactInsertEvent>
Business task in order to insert a
BOAccountContact. Required fields:
- address
- 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 LongPerforms the needed operation by calling theBTAccountContactHistory.protected voidexecute(AccountContactInsertEvent event, PoolKit poolKit) Inserts the givenBOAccountContactand writes the newly generated id into the event journal.protected Longinsert(BOAccountContact contact, PoolKit poolKit) Performs the insertion of the givenBOAccountContact.booleanDetermines whether the current state is valid for execution.protected BOAccountContactloadExistingContact(BOAccountContact contact, PoolKit poolKit) Loads the existing contact with the not valid contact values.protected Longupdate(BOAccountContact contact, BOAccountContact existingContact, PoolKit poolKit) Performs the update of the givenBOAccountContact.protected voidvalidate(BOAccountContact contact, 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
-
BTAccountContactInsert
public BTAccountContactInsert()
-
-
Method Details
-
execute
protected void execute(AccountContactInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Inserts the givenBOAccountContactand writes the newly generated id into the event journal. If theBOAccountContactwas already inserted without a proper contact value, it updates theBOAccountContactwith the input values.- Specified by:
executein classValidExecutionBusinessTask<AccountContactInsertEvent>- Parameters:
event- theAccountContactInsertEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
validate
protected void validate(BOAccountContact contact, PoolKit poolKit) throws DAValidateException, DAException Validates the data before the insertion.- Parameters:
contact- theBOAccountContactcontaining the new valuespoolKit- thePoolKit- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
loadExistingContact
protected BOAccountContact loadExistingContact(BOAccountContact contact, PoolKit poolKit) throws DAValidateException, DAException Loads the existing contact with the not valid contact values. If there is already a contact of this type and with this address, that has a valid contact value, an error is thrown.- Parameters:
contact- theBOAccountContactcontaining the update datapoolKit- thePoolKit- Returns:
- the already existing
BOAccountContact - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
insert
protected Long insert(BOAccountContact contact, PoolKit poolKit) throws DAException, DAValidateException Performs the insertion of the givenBOAccountContact.- Parameters:
contact- theBOAccountContactto insertpoolKit- thePoolKit- Returns:
- the
BOAccountContactid - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
update
protected Long update(BOAccountContact contact, BOAccountContact existingContact, PoolKit poolKit) throws DAException, DAValidateException Performs the update of the givenBOAccountContact.- Parameters:
contact- theBOAccountContactcontaining the update valuespoolKit- thePoolKit- Returns:
- the
BOAccountContactid - Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
doOperation
protected Long doOperation(Command command, Map<String, Object> data, PoolKit poolKit) throws DAException, DAValidateExceptionPerforms the needed operation by calling theBTAccountContactHistory.- Parameters:
command- the commanddata- the datapoolKit- thePoolKit- Returns:
- the
BOAccountContactid - 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
-