Journey Manager (JM) The transaction engine for the platform. | System Manager / DevOps | All versions This feature is related to all versions.
Manager allows you to create and configure job action services. When a collaboration job's action is processed, an action service is run. A collaboration job usually specifies an action service from one of the available inbuilt action services. This allows a developer to create their own job action and job expiry services using GroovyGroovy is a powerful scripting language which runs on the Java Virtual Machine. Across theTemenos Journey Manager platform, Groovy is used to create services in Manager. These services are primarily used to create plug-in style systems that interact with Manager. scripts.
To create a job action service:
To configure a job action service:
"actions": [
{
"name": "Individual Tasks",
"type": "Job Task Assign",
"properties": [
{ "name": "Task Assign Repeating", "value": "true" },
{ "name": "Task Assign Repeat Item", "value": "$func.invoke('Repeating Get Item', ${formDataMap.itemDelimited}, ${assignRepeatIndex})" },
{ "name": "Task Type", "value": "Review" }
]
}
The $func.invoke
method executes the Repeating Get Item service (invoking it by the name) with two parameters.
If you want to invoke same job action multiple times as part of single step, give them different job action names, for example, "name": "Individual Tasks 2"
, but define the same service name, for example,"serviceName": "Repeating Claimable"
. If you do not define the service name explicitly, it expects the job action name to match the service name. It's not allowed to have 2 or more job actions with the same name in one job step.
import com.avoka.tm.util.*
import com.avoka.tm.vo.*
import groovy.transform.TypeChecked
import javax.servlet.http.*
import org.apache.commons.lang3.StringUtils
@TypeChecked
class FluentGroovyService {
// Injected at runtime
public Logger logger
/*
* Perform a groovy service invocation
*
* return: the result object
*/
Object invoke(SvcDef svcDef, HttpServletRequest request, User user, Map params) {
JobAction jobAction = (JobAction) params.jobAction
return invoke(svcDef, request, user, jobAction, params)
}
Object invoke(SvcDef svcDef, HttpServletRequest request, User user, JobAction jobAction, Map params) {
logger.info params
List<String> args = (List<String>) params.args
def result = "Not Found"
if( StringUtils.isNotEmpty(args[0]) &&
StringUtils.isNotEmpty(args[1]) &&
args[1].isNumber()) {
def itemDelimited = args[0]
// note repeat index from TM is 1 based not 0 based
def repeatIndex = args[1].toInteger() - 1
logger.info "itemDelimited: " + itemDelimited
logger.info "repeatIndex: " + repeatIndex
def items = itemDelimited.tokenize('|')
logger.info "items: " + items
result = items[repeatIndex.toInteger()]
logger.info "result Item: " + result
}
return result
}
}
You can download the complete code example here.
Next, learn how to view all job services.