Class ActivateInstance

java.lang.Object
com.aquima.interactions.framework.service.instance.ActivateInstance
All Implemented Interfaces:
IService

public class ActivateInstance extends Object implements 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.

entity-name or relation is required, condition is optional

If no instance could be activated due to

  • no instance could be found or
  • multiple instances were found
a warning is logged.

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
  • Field Details

  • Constructor Details

    • ActivateInstance

      public ActivateInstance()
  • Method Details

    • handle

      public IServiceResult handle(IServiceContext context)
      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 interface IService
      Parameters:
      context - the context in which the service is called and allowed to make changes.
      Returns:
      The result of this service, may be null.
    • noInstanceFound

      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.
      Parameters:
      context - The current service context.
    • multipleInstancesFound

      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.
      Parameters:
      instances - Array containing all the instances that were found.
      context - The current service context.
    • activateInstance

      protected void activateInstance(IEntityInstance instance, IServiceContext context)
      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.