Services Guide
Transact Services and functions are contained in individual project folders and include 4 key files:
service-def.json
- the Groovy Service definitionservice-help.html
- the Help Doc file for display in the Transact Manager Service Definitions Help tabService.groovy
- the Service groovy script source fileServiceTest.groovy
- the Unit Test groovy script
A simple example project service structure is provided below:
[project]
|
+-[src]
|
+-[com]
|
+-[maguire]
|
+- [helloworld]
|
+- service-def.json
|
+- service-help.html
|
+- HelloWorld.groovy
|
+- HelloWorldTest.groovy
The service-def.json
file itself point to other resources in the project.
Service Definition
The Groovy Service Definition is provided in a service-def.json
file. A simple example is provided below:
{
"name": "Hello World",
"type": "Groovy Service",
"version": 1,
"tmMinVersion": "5.0.0",
"legacyGroovy": false,
"parameters": [
{
"name": "groovyScript",
"filePath": "HelloWorld.groovy"
},
{
"name": "Unit Test Script",
"filePath": "HelloWorldTest.groovy",
"unitTest": true
}
]
}
The service definition file specifies the bare minimum configuration necessary to create a valid service archive. An missing configuration attributes and parameters are provided by the svcpackage
task when you create a service archive. The service definition serviceType
attribute is used to resolve the missing attributes and parameters from the standard service and function templates.
In your service definition file you can override default service template attributes and parameters.
A larger example is Dynamic Data service example is provided below. This example includes a clientCode
attribute for the Organization which owns the service.
The serviceConnection
attribute is used to resolve a TM Service Connection entity at runtime. Service Connections are used to store common remote connection details used by multiple services. If the named service connection does not exist on the TM server an new one will be created with the given name and of type 'HTTP Endpoint'.
{
"name": "TrackMe DD",
"description": "Identity Verification Dynamic Data Service",
"type": "Dynamic Data",
"version": 1,
"tmMinVersion": "5.0.0",
"legacyGroovy": false,
"serviceConnection": "TrackMe Connection",
"clientCode": "Maguire"
"parameters": [
{
"name": "TrackMe Account Key",
"description": "TrackMe Account Key",
"value": "ABC-123",
"type": "String",
"bind": false
},
{
"name": "groovyScript",
"filePath": "TrackMeDD.groovy",
"fileIncludes": [
"../common/trackme-utils.groovy",
"../common/data-utils.groovy"
],
"readOnly": true
},
{
"name": "Unit Test Script",
"filePath": "TrackMeDDTest.groovy",
"readOnly": true,
"unitTest": true
}
]
}
Service Attributes
You can add arbitrary service parameters to your service definition. When you do so you need to specify the parameter attributes:
name
- service definition name (required)description
- service definition description (optional)type
- service type (required)version
- service version number (required)tmMinVersion
- the minimum TM version required for the service (optional)legacyGroovy
- specify the service uses legacy mode unsecure Groovy API (optional)serviceConnection
- the name of the service connection (optional)clientCode
- the client code, note this should generally be specified in svcupload Task (optional)
Service Parameters
You can add arbitrary service parameters to your service definition. When you do so you need to specify the parameter attributes:
name
- service parameter namedescription
- service parameter descriptiontype
- service parameter type [ String | Boolean | Number | HTML | JSON | Password ]value
- service parameter valuefilePath
- service parameter value loaded from the specified pathfileIncludes
- list of groovy script source files to prepend the Groovy service script file when packagingbind
- specifies whether to inject the service parameter into the Java service objectreadOnly
- specifies whether the service parameter is read only on the server and cannot be edited in Transact Managerrequired
- specifies the service parameter is required to create the Java service objectclearOnExport
- specifies the service parameter value will be cleared when exported from a TM systemunitTest
- specifies the service parameter is for unit testing only
As a minimum you need to specify the parameter attributes name
, type
, value
and bind
. Please always set the bind
attribute to be false if you are creating an arbitrary service parameter.
Service Scaffolding Templates
Services are best created using the svc-scaffold task.
Transact Function templates
- Delivery Function
- Fluent Function
Fluent Service templates
- Delivery Function
- Fluent Function
- Fluent Delivery Process
- Fluent Delivery Process with Checkpoints
- Fluent Dynamic Data
- Fluent Email Service
- Fluent Form Prefill
- Fluent Form Saved Processor
- Fluent Form Security Filter
- Fluent Form Version Selector
- Fluent Groovy Service
- Fluent Groovy Service - REST Data Loader
- Fluent Job Action
- Fluent Render Receipt
- Fluent Receipt Number
- Fluent Scheduled Service
- Fluent Submission Preprocessor
- Fluent Submission Completed Processor
- Fluent Submission Data Validator
- Fluent Task Expiry
- Fluent Tracking Number
- Fluent Transaction History Publisher
- Fluent Virus Scan
Collaboration Job templates
- Job Controller - Customer Onboarding
- Job Controller - 1 Step Review
- Job Controller - 2 Step Review
Legacy Groovy Service templates
- Groovy Delivery Process
- Groovy Dynamic Data
- Groovy Email Service
- Groovy Form Prefill
- Groovy Form Saved Processor
- Groovy Form Security Filter
- Groovy Form Version Selector
- Groovy Service
- Groovy Job Action
- Groovy Render Receipt
- Groovy Receipt Number
- Groovy Scheduled Service
- Groovy Submission Preprocessor
- Groovy Submission Completed Processor
- Groovy Submission Data Validator
- Groovy Task Expiry
- Groovy Tracking Number