Dynamic Data Service

   Journey Manager (JM) Previously known as Transact Manager (TM). |   System Manager / DevOps |  5.1 & Higher This feature is related to 5.1 and higher.

Manager comes with the dynamic data service (DDS) to retrieve required data dynamically, often from external systems. This service can be called by forms to obtain data dynamically while they are being filled in, for example, data lookup or validation using external services. The dynamic data service performs a lookup using a GroovyGroovy is a powerful scripting language which runs on the Java Virtual Machine. Across theJourney platform, Groovy is used to create services in Manager. These services are primarily used to create plug-in style systems that interact with Manager. script configured as one of the service's parameters. You can easily change the lookup behavior by modifying this service parameter, without a restart or rebuild of your Manager server.

Maestro forms use DDS as one of the methods to obtain form data dynamically. For more information, see dynamic data in forms.

To configure the dynamic data service:

  1. Select Services > All Services.
  2. Locate a service and click Edit.
  3. Configure the standard service settings using the Dynamic Data service type as the Service Type and the Fluent Dynamic Data template as the Service Template. Select a relevant service connection to use to connect to the external service.
  4. Select the Groovy Script tab and update a Groovy script to make use of a service connection. You can use either Transact Fluent API or Core Transact API depending on the service template you have selected. The snippets of both APIs are shown below:
  5. Transact Fluent API

    String invoke(SvcDef svcDef, Txn txn, HttpServletRequest request, User user) {
    	def endPoint = svcDef.svcConn.endpoint

    Core Transact API

    def serviceConnection = serviceDefinition.connection
    def endPoint = serviceConnection.endpointValue
  6. Select the Parameters Edit tab to edit the service configuration.
  7. Click Groovy Script Edit Parameter to create and update parameters used withing the script.
  8. You can retrieve a parameter using the following code:

    Transact Fluent API

    String invoke(SvcDef svcDef, Txn txn, HttpServletRequest request, User user) {
    	def zipConnectionName = svcDef
    		.get('GetInfoByZip Connection Name')

    Core Transact API

    def zipConnectionName = serviceParameters.get('GetInfoByZip Connection Name')
  9. Configure the Unit Test and Test Parameters tabs.
  10. Click Save to update the changes.

DDS services require a request log key, which is session specific, to be provided unless the services run in test mode. This provides some protection against CSRFCross-site request forgery (CSRF), also known as one-click attack or session riding, is a type of malicious exploit of a website where unauthorized commands are transmitted from a user that the web application trusts.. DDS services are not directly related to forms, so you can call any within your organization unless the setting to enable calling after submission is set the submission related to the requestlog are not be in a finished state. Form Functions has a stronger security model when they are mapped to the form definition. For more information CSRF, see how to configure modules.

Next, learn how to configure a service with multiple endpoints to external services.