Execution context

Almost every method in service implementation contract receives an instance of com.hcl.unica.cms.model.request.ExecutionContext class.

This object contains all the contextual information that is necessary for a service to perform its operation. The following are the methods in ExecutionContext class, which can be used to obtain various types of information during service execution:
  • T getRequest()

    This method can be used to obtain the input, or request, object passed to the service when it is executed using execute method on the ServiceGateway interface. (The T return type is the type parameter corresponding to the generic argument used for defining the service.)

  • Map<String, Object> getAttributes()

    Returns additional attributes pertaining to the current service execution, such as HTTP response status & headers for current HTTP call.

    Note: Content-Type HTTP header is populated as contentType key due to special considerations in underlying framework.
  • ServiceConfig getServiceConfig()

    This method returns an instance of com.hcl.unica.cms.integration.config.ServiceConfig class. This object holds the configurations made in the service meta information file for the respective service.

  • InstanceConfig getInstanceConfig()

    This method returns an instance of com.hcl.unica.cms.integration.config.InstanceConfig class. This object contains all the configurations made in Unica Platform for the target system (instance in this method name refers to the target system instance, and not the service instance). In case of multi-partitioned configurations, this object will be appropriately populated by Asset Picker to hold partition specific configuration. To know the various instance configuration settings in Unica Platform, see Unica Asset Picker Admin Guide.

  • void setAttributes(Map<String, Object>)

    Use of this method is limited to Asset Picker only. Avoid using this method with the Plugins.