Transact Services Overview
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 Journey Manager (JM) Service Definitions Help tabService.groovy
: the Service groovy script source fileServiceTest.groovy
: the Unit Test groovy script
A simple example project service structure is shown below.
- src
- com
- maguire
- helloworld
- service-def.json
- service-help.html
- HelloWorld.groovy
- HelloWorldTest.groovy
- helloworld
- maguire
- com
The service-def.json
file refers to other resources in the project.
Service Definition
The Groovy Service Definition is provided in a service-def.json
file. A simple example is shown below.
{
"name": "Hello World",
"type": "Fluent 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. Any missing configuration attributes and parameters are provided by the svcpackage
task when you create a service archive. The service definition's type
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 shown in the Fluent Dynamic Data service example below. This example includes a clientCode
attribute for the Organization that owns the service.
The serviceConnection
attribute is used to resolve a JM 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 JM server a new one will be created with the given name and of type "HTTP Endpoint"
.
{
"name": "TrackMe DD",
"description": "Identity Verification Dynamic Data Service",
"type": "Fluent 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 attributes to your service definition. Attributes are optional unless otherwise indicated.
Attribute | Description |
---|---|
name | String Required. Service definition name. |
description | String Service definition description. |
type | String Required. Service type. |
version | Number Required. Service version number. |
tmMinVersion | String (Maximum length 20 characters)The minimum JM version required for the service. Formatted as a valid version string - see Version Attributes. |
legacyGroovy | Boolean Whether the service uses legacy mode unsecure Groovy API. |
serviceConnection | String The name of the service connection. |
clientCode | String The client code, note this should generally be specified in svcupload Task. |
parameters[] | Object See Service Parameters below. |
Service Parameters
You can add arbitrary service parameters to your service definition. When you do so you need to specify the parameter attributes. Attributes are optional unless otherwise indicated.
Attribute | Description |
---|---|
name | String Service parameter name. |
description | String Service parameter description. |
type | String Service parameter type. Valid values are |
value | Variable type - dependent on type .Service parameter value. |
filePath | String Service parameter value loaded from the specified path. |
fileIncludes[] | String A list of groovy script source files to prepend to the Groovy service script file when packaging. |
bind | Boolean Specifies whether to inject the service parameter into the Java service object. |
readOnly | Boolean Specifies whether the service parameter is read only on the server and cannot be edited in Transact Manager. |
required | Boolean Specifies the service parameter is required to create the Java service object. |
clearOnExport | String Specifies the service parameter value will be cleared when exported from a JM system. |
unitTest | String Specifies the service parameter is for unit testing only. |
As a minimum, you need to specify the parameter attributes name
, type
, value
and bind
. Always set the bind
attribute to false
if you are creating an arbitrary service parameter.
Service Scaffolding Templates
Services are best created using the svc-scaffold
Ant task.
Transact Function templates
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