Class ActivateInstance
java.lang.Object
com.aquima.interactions.framework.service.instance.ActivateInstance
- All Implemented Interfaces:
IService
Service to activate a single instance.
- entity-name: The name of entity to get all instances.
- relation: An expression that returns a list of instances once evaluated.
- condition: Condition applied to all instances to get one instance.
If no instance could be activated due to
- no instance could be found or
- multiple instances were found
AQU-2979: when a condition parameter is provided and multiple instances are found, a (random) instance is activated.
- Since:
- 5.1
- Author:
- Jon van Leuven
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
activateInstance
(IEntityInstance instance, IServiceContext context) This method is called when one instance is found and activates the instance.handle
(IServiceContext context) The handle method of the service is allowed to make changes to the interfaces passed along with the IServiceContext.protected void
multipleInstancesFound
(IEntityInstance[] instances, IServiceContext context) This method is called when multiple instances were found to activate and logs a warning Override this method to act when this situation occurs.protected void
noInstanceFound
(IServiceContext context) This method is called when no instance could be found to activate and logs a warning Override this method to act when this situation occurs.
-
Constructor Details
-
ActivateInstance
public ActivateInstance()
-
-
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.AppException
-
noInstanceFound
This method is called when no instance could be found to activate and logs a warning Override this method to act when this situation occurs.- Parameters:
context
- The current service context.
-
multipleInstancesFound
This method is called when multiple instances were found to activate and logs a warning Override this method to act when this situation occurs.- Parameters:
instances
- Array containing all the instances that were found.context
- The current service context.
-
activateInstance
This method is called when one instance is found and activates the instance.- Parameters:
instance
- The instances that was found and is about to be activated.context
- The current service context.
-