Class BTTechnicalObjectInsert
java.lang.Object
overit.geocall.bl.BusinessTask<TechnicalObjectInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidExecutionBusinessTask<TechnicalObjectInsertEvent>
overit.geocallapp.utilities.core.bl.common.validexecution.ValidPermissionBusinessTask<TechnicalObjectInsertEvent>
overit.geocallapp.wfm.core.bl.technicalobject.task.BTTechnicalObjectInsert
- All Implemented Interfaces:
Serializable,Tool,ValidExecution
@Event(TechnicalObjectInsertEvent.class)
public class BTTechnicalObjectInsert
extends ValidPermissionBusinessTask<TechnicalObjectInsertEvent>
Business task in order to insert a
When the
TechnicalObject. When the
TechnicalObjectInsertEvent is launched
the BT notices the call and inserts the TechnicalObject basing on the event's input. Required fields header:
- Code
- Type
Permission:
Error Code:
Codes.PROPERTY_REQUIRED: Property {0} is required.Codes.C270_0071: Code {0} is already been used.Codes.C270_1370: Error saving address: unspecified address id
- 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 voidcheckUniqueCode(BOTechnicalObjectHeader technicalObjectHeader, PoolKit poolKit) Verify that doesn't exist a technical object with the given code.protected voidexecute(TechnicalObjectInsertEvent event, PoolKit poolKit) Inserts a newTechnicalObjectwith all its needed components, i.e. the master data along with the address informations and the feature values.protected LonginsertAddress(TechnicalObjectInsertEvent event, Long headerId, PoolKit poolKit) protected LonginsertHeader(TechnicalObjectInsertEvent event, PoolKit poolKit) booleanDetermines whether the current state is valid for execution.protected voidnotifyTechnicalObjectInsertUpdate(Long technicalObjectId, PoolKit poolKit) Notifies the system about the insertion or update of a technical object.protected voidupdateTimezone(BOTechnicalObjectHeader technicalObjectHeader, PoolKit poolKit) Define the technical object time zone, and align the creation date with the founded time zoneprotected voidvalidate(TechnicalObject technicalObject, PoolKit poolKit) 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
-
BTTechnicalObjectInsert
public BTTechnicalObjectInsert()
-
-
Method Details
-
execute
protected void execute(TechnicalObjectInsertEvent event, PoolKit poolKit) throws DAException, DAValidateException Inserts a newTechnicalObjectwith all its needed components, i.e. the master data along with the address informations and the feature values. The id of the just inserted object is written into the journal of the event.- Specified by:
executein classValidExecutionBusinessTask<TechnicalObjectInsertEvent>- Parameters:
event- theTechnicalObjectInsertEventpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
notifyTechnicalObjectInsertUpdate
protected void notifyTechnicalObjectInsertUpdate(Long technicalObjectId, PoolKit poolKit) throws DAException, DAValidateException Notifies the system about the insertion or update of a technical object.- Parameters:
technicalObjectId- The ID of the technical object that was inserted or updatedpoolKit- The pool kit to use for database operations- Throws:
DAException- If a data access error occursDAValidateException- If validation fails during the notification process
-
validate
protected void validate(TechnicalObject technicalObject, PoolKit poolKit) throws DAValidateException - Throws:
DAValidateException
-
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
-
insertHeader
protected Long insertHeader(TechnicalObjectInsertEvent event, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-
checkUniqueCode
protected void checkUniqueCode(BOTechnicalObjectHeader technicalObjectHeader, PoolKit poolKit) throws DAValidateException, DAException Verify that doesn't exist a technical object with the given code.- Parameters:
technicalObjectHeader- the technical object header to checkpoolKit- thePoolKit- Throws:
DAValidateException- if already exists a technical object with the same code of the given oneDAException- the DA exception
-
updateTimezone
protected void updateTimezone(BOTechnicalObjectHeader technicalObjectHeader, PoolKit poolKit) throws DAException, DAValidateException Define the technical object time zone, and align the creation date with the founded time zone- Parameters:
technicalObjectHeader- the technical object headerpoolKit- thePoolKit- Throws:
DAException- the DA exceptionDAValidateException- the DA validate exception
-
insertAddress
protected Long insertAddress(TechnicalObjectInsertEvent event, Long headerId, PoolKit poolKit) throws DAValidateException, DAException - Throws:
DAValidateExceptionDAException
-