Service JSON Definition
In Transact Manager, services are software modules configured to perform specific business-related functionality, usually by executing Groovy scripts, and often used to call external services hosted on premise or on cloud.
Example
An example Service definition file is shown below.
{
"name": "GetAccounts",
"description": "TODO...",
"type": "Fluent Function",
"version": "0.1.0",
"clientCode": "maguire",
"serviceConnection": "Accounts",
"tmMinVersion": "17.10.0",
"parameters": [
{
"name": "groovyScript",
"filePath": "GetAccounts.groovy",
"fileIncludes": [],
"bind": true,
"required": false,
"clearOnExport": false,
"readOnly": false
},
{
"name": "Unit Test Script",
"filePath": "GetAccountsTest.groovy",
"fileIncludes": [],
"bind": false,
"required": false,
"clearOnExport": false,
"readOnly": false,
"unitTest": true
},
{
"name": "Help Doc",
"type": "HTML",
"filePath": "service-help.html",
"bind": false,
"required": false,
"clearOnExport": false,
"readOnly": false
},
{
"name": "Test XML Data",
"type": "String",
"filePath": "test-data.xml",
"bind": false,
"required": false,
"clearOnExport": false,
"readOnly": false,
"unitTest": true
}
]
}
Schema
Service definitions must comply with the following schema.
Fields are optional unless otherwise indicated.
| Field | Description |
|---|---|
name | stringRequired. The Service's name. |
description | stringA brief description of the Service. |
clientCode | stringRequired. |
legacyGroovy | booleanRequired. |
type | stringRequired. The service type is dependent on the value of the If
If
|
version | stringRequired. The Service version number. For information about version numbers, see Version Attributes. |
tmMinVersion | stringThe minimum version of Transact Manager required to run the Service. For information about version numbers, see Version Attributes. |
serviceConnection | stringA service connection name. |
parameters[] | Object (Service Parameter)Required. Zero or more Parameter objects. |
Service Parameter
Fields are optional unless otherwise indicated.
| Field | Description |
|---|---|
name | stringRequired. The parameter's name |
description | stringA brief description of the parameter. |
type | stringRequired. Must be one of the following:
|
bind | booleanRequired. Inject the parameter value into the "creates service" object. |
clearOnExport | booleanRequired. Whether to clear the parameter's Set to |
readOnly | booleanRequired. Whether the service parameter is editable. |
required | booleanRequired. Whether the |
unitTest | booleanSet to To override a service parameter value with one configured as Unit Test service parameter, set the value manually in the Unit Test Class by adding it to the |
value | stringThe parameter's value. This (or |
filePath | stringA file path: replaces |
fileIncludes | string[]An array of filenames. The contents of each file will be appended to the |