Class ProcessEnabledActionHandler

java.lang.Object
com.aquima.interactions.portal.model.process.wrapper.ProcessEnabledActionHandler
All Implemented Interfaces:
IActionHandler

public class ProcessEnabledActionHandler extends Object implements IActionHandler
An action handler wrapper which provides information about the intended session in which it should be executed.
Since:
9.9
Author:
Petru Galanton
  • Constructor Details

    • ProcessEnabledActionHandler

      public ProcessEnabledActionHandler(IActionHandler delegate, boolean forTaskSession)
      Creates a new instance.
      Parameters:
      delegate - the wrapped action handler
      forTaskSession - indicates whether this action handler should execute in the main ProcessEnabledSession or in the sub-session of the task (when available)
  • Method Details

    • isReadOnly

      public boolean isReadOnly()
      Description copied from interface: IActionHandler
      This method indicates if the action handler does not modify any profile data.
      Specified by:
      isReadOnly in interface IActionHandler
      Returns:
      boolean indicating if the handler does not modify any profile data.
    • handle

      public IActionResult handle(IActionContext context) throws Exception
      Description copied from interface: IActionHandler
      This method will be called from the portal session to handle an action request from the client. The method returns an Action result object which can be used by the client to act upon this result.
      Specified by:
      handle in interface IActionHandler
      Parameters:
      context - The portal context of the current session.
      Returns:
      The result of the handle method, may be null.
      Throws:
      Exception - When an unexpected exception occurs.
    • isForTaskSession

      public boolean isForTaskSession()
      Indicates whether this action handler should execute in the main session or in the sub-session created for a started task.
      Returns:
      true if the action handler should execute in the task session, false if the action handler should execute in the main session
    • forMainSession

      public static ProcessEnabledActionHandler forMainSession(IActionHandler handler)
      Returns a wrapper for the given action handler, which executes in the main session of a ProcessEnabledSession, even if an AQ_ExecuteTask service call is currently executing in the main session.
      Parameters:
      handler - the handler to be executed
      Returns:
      the handler wrapper
    • forTaskSession

      public static ProcessEnabledActionHandler forTaskSession(IActionHandler handler)
      Returns a wrapper for the given handler which executes in the task session of a ProcessEnabledSession, if an AQ_ExecuteTask service call is currently executing in the main session. If an AQ_ExecuteTask service call is currently not executing, the handler will not be executed.
      Parameters:
      handler - the handler to be executed
      Returns:
      the handler wrapper