Class InstanceUpdateService
java.lang.Object
com.aquima.interactions.framework.service.instance.InstanceServiceBase
com.aquima.interactions.framework.service.instance.InstanceUpdateService
- All Implemented Interfaces:
ICacheableParametersObjectService<InstanceUpdateParameters>
,IService
public class InstanceUpdateService
extends InstanceServiceBase
implements ICacheableParametersObjectService<InstanceUpdateParameters>
AQ_Instance_Update implementation.
It is responsible for the following:
- Searches for one or more
IEntityInstance
of typeInstanceServiceParameters.getEntityName()
; - If
InstanceUpdateParameters.getEntitySelector()
is empty and the entity type is defined as singleton, tries to get the singleton instance. Throws aServiceException
if the definition is not found. - If
InstanceUpdateParameters.getEntitySelector()
is empty and the entity type is not defined as singleton, tries to get the active instance of the specified type. Throws aServiceException
if not found. - Otherwise evaluates
InstanceUpdateParameters.getEntitySelector()
as an expression an applies the algorithm for each returned instance. - If
InstanceUpdateParameters.shouldClearBeforeExecute()
is true it will clear the instances for before settings the updated values. - When the
InstanceServiceParameters.getAttributeRelations()
is empty it takes theInstanceServiceParameters.getAttributes()
List and sets each attribute to the entity instance. - When the
InstanceServiceParameters.getAttributeRelations()
is empty it takes theInstanceServiceParameters.getRelations()
List and sets each relation to the entity instance.
- Since:
- 9.6
- Author:
- Radu Batori
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Logger
getParametersObject
(IServiceContext context) Parse the parameters into a cacheable object.handle
(IServiceContext context) The handle method of the service is allowed to make changes to the interfaces passed along with the IServiceContext.handle
(IServiceContext context, InstanceUpdateParameters parameters) The handle method of the service is allowed to make changes to the interfaces passed along with the IServiceContext.Methods inherited from class com.aquima.interactions.framework.service.instance.InstanceServiceBase
setAttributeRelations, setAttributes, setRelations
-
Constructor Details
-
InstanceUpdateService
public InstanceUpdateService()
-
-
Method Details
-
handle
Description copied from interface:IService
The handle method of the service is allowed to make changes to the interfaces passed along with the IServiceContext. This means the service context is changed accordingly.- Specified by:
handle
in interfaceIService
- Parameters:
context
- the context in which the service is called and allowed to make changes.- Returns:
- The result of this service, may be null.
- Throws:
ServiceException
- When an expected exception occurs and the portal should display certain messages.Exception
- When an unexpected exception occurs and the portal should display a standard message.
-
handle
Description copied from interface:ICacheableParametersObjectService
The handle method of the service is allowed to make changes to the interfaces passed along with the IServiceContext. This means the service context is changed accordingly.- Specified by:
handle
in interfaceICacheableParametersObjectService<InstanceUpdateParameters>
- Parameters:
context
- the context in which the service is called and allowed to make changes.parameters
- cached object that contain parameters- Returns:
- The result of this service, may be null.
-
getParametersObject
Description copied from interface:ICacheableParametersObjectService
Parse the parameters into a cacheable object. Do NOT parse expressions as these can change in other invocations of the handle- Specified by:
getParametersObject
in interfaceICacheableParametersObjectService<InstanceUpdateParameters>
- Parameters:
context
- the context in which the service is called and allowed to make changes.- Returns:
- a cacheable object that is not null
-
getLogger
- Specified by:
getLogger
in classInstanceServiceBase
- Returns:
- The Logger instance for the subclass.
-