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 | string Required. The Service's name. |
description | string A brief description of the Service. |
clientCode | string Required. |
legacyGroovy | boolean Required. |
type | string Required. The service type is dependent on the value of the If
If
|
version | string Required. The Service version number. For information about version numbers, see Version Attributes. |
tmMinVersion | string The minimum version of Transact Manager required to run the Service. For information about version numbers, see Version Attributes. |
serviceConnection | string A service connection name. |
parameters[] | Object (Service Parameter) Required. Zero or more Parameter objects. |
Service Parameter
Fields are optional unless otherwise indicated.
Field | Description |
---|---|
name | string Required. The parameter's name |
description | string A brief description of the parameter. |
type | string Required. Must be one of the following:
|
bind | boolean Required. Inject the parameter value into the "creates service" object. |
clearOnExport | boolean Required. Whether to clear the parameter's Set to |
readOnly | boolean Required. Whether the service parameter is editable. |
required | boolean Required. Whether the |
unitTest | boolean Set 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 | string The parameter's value. This (or |
filePath | string A file path: replaces |
fileIncludes | string[] An array of filenames. The contents of each file will be appended to the |