• Platform
    • Manager
    • Maestro
    • Exchange
    • Workspaces
    • Analytics
    • Springboard
    • API
Transact Services Guide (TSG)

Transact Services Guide (TSG)

  • Getting Started
  • Groovy Guide
  • Service Development
  • Groovy Services API
  • REST API

›Groovy Services API

Getting Started

  • Introduction

Groovy Guide

  • Groovy Guide
  • Groovy Declarations
  • Control Statements

Service Development

  • Service Development
  • Transaction Processing Sequence
  • Service Logging
  • Remote Service Calls
  • Fluent Security Configuration
  • Third-party Libraries

Groovy Services API

  • Groovy Services API
  • Fluent Function
  • Delivery Function
  • Form Version Selector
  • Form Security Filter
  • Form Prefill
  • Tracking Number
  • Form Dynamic Data
  • Submission Preprocessor
  • Receipt Number
  • Form Saved Processor
  • Submission Data Validator
  • Submission Completed Processor
  • Render Receipt Service
  • Delivery Process
  • Task Expiry Process
  • Email Service
  • Job Action
  • Scheduled Service
  • Groovy Service
  • SSO Revalidation
  • SSO Get Authentication Token
  • SSO Authentication OK Response
  • SSO Authentication Provider
  • Transaction History Publisher
  • Virus Scan

REST API

  • REST API
  • REST Application Package API
  • REST Delivery API
  • REST Form Groups API
  • REST Groovy Service Invoke v2
  • REST Service Definitions API
  • REST Tasks API
  • REST TestCenter API
  • REST TPac API
  • REST Transactions API
  • REST Transaction History API

Workspaces API

  • Workspaces API
  • Filters
  • Sort
  • Workspaces Category API
  • Workspaces Current User API
  • Workspaces Extract Name API
  • Workspaces Form API
  • Workspaces Group API
  • Workspaces Job API
  • Workspaces Org API
  • Workspaces Property Name API
  • Workspaces Space API
  • Workspaces Txn API
  • Workspaces User API

Tracking Number

The Tracking Number (tracking code) service is used to generate tracking codes for form transactions. The generated tracking code is included in the form XML data, and is also displayed on associated transaction pages and emails.

The generated Tracking Number value should contain alphanumeric values only and use upper case letters.

IMPORTANT NOTE: generated tracking numbers must be globally unique in the Temenos Journey platform database. If your service returns a non unique tracking number an error will occur when the system tries to create a transaction record. The Fluent SDK provides a TrackingCodeBuilder to generate and test tracking numbers.

This service is configured via the Form Details tab under the Tracking Code section.

Service Invoke Parameters

Parameter Description Nullable
svcDef the service definition value object, see SvcDef no
form the transaction record value object, see Form no
request the servlet HttpServletRequest yes
user the authenticated user, see User yes

Script Result

The service should return a non blank globally unique tracking number value.

Error Handling

If an error occurs invoking your Tracking Number Groovy script the error will be logged in the Journey Manager database error log, the user will be redirected to the error page on the form space. The transaction will be rolled back, and no transaction record will be created. Please ensure any generated tracking numbers are unique.

Service Template

This section shows service template Groovy script.

import com.avoka.core.groovy.GroovyLogger as logger
import com.avoka.tm.svc.*
import com.avoka.tm.vo.*
import javax.servlet.http.*

class FluentTrackingNumberService {

    /*
     * Perform a transaction tracking number (tracking code) generation
     *
     * return: a globally unique tracking number value, values longer than 100 characters will be trimmed
     */
    String invoke(SvcDef svcDef, Form form, HttpServletRequest request, User user) {

        return new TrackingCodeBuilder()
            .setPrefix(form.formCode + "-")
            .setPostfix("-TEST")
            .build()
    }
}

Unit Test Template

This section shows unit test template Groovy script.

import com.avoka.core.groovy.GroovyLogger as logger
import com.avoka.tm.svc.*
import com.avoka.tm.test.*
import com.avoka.tm.util.*
import com.avoka.tm.vo.*
import org.junit.Test

class UnitTest extends AbstractJUnitTest {

    /*
     * Perform service unit test
     *
     * throws exception if unit test fails
     */
    @Test
    void testTrackingCodeBuilder() throws Exception {

        Form form = new MockVoBuilder().createForm()
        MockRequest request = new MockRequest()

        Map params = [
            "svcDef": svcDef,
            "form": form,
            "request": request,
            "user": null
        ]

        String trackingCode = (String) new ServiceInvoker(svcDef).invoke(params)

        logger.info "Tracking Code: " + trackingCode

        // Test any business logic performed
        assert trackingCode != null
        assert trackingCode.startsWith(form.formCode + "-")
        assert trackingCode.endsWith("-TEST")
    }
}
← Form PrefillForm Dynamic Data →

Terms & Conditions

Privacy Policy

Cookie Policy

Copyright © 2003-2022 Temenos Headquarters SA