Journey Manager (JM) The transaction engine for the platform. | Form Builder Platform Developer | 17.10 This feature was introduced in 17.10.
Manager allows you to edit a Groovy script, which implements the desired business logic of a Transact function. As you create a new Transact function, Manager generate a default Groovy script, so you must modify it.
You can test your Groovy script or a part of the script using the Groovy console.
To edit the Groovy script:
While working on the script, you can use some basic editing options, such as:
import com.avoka.tm.func.*
import com.avoka.tm.util.*
import com.avoka.tm.vo.*
import javax.servlet.http.*
class FluentFunction {
// Injected at runtime
public Logger logger
/*
* Perform Fluent Function call.
*
* returns: FuncResult
*/
FuncResult invoke(FuncParam param) {
def formDoc = new XmlDoc(param.appDoc)
formDoc.setText('/AvokaSmartForm/Applicant/FirstName', 'John')
formDoc.setText('/AvokaSmartForm/Applicant/LastName', 'Smith')
formDoc.setText('/AvokaSmartForm/Applicant/Email', '[email protected]')
formDoc.setText('/AvokaSmartForm/Applicant/Mobile', '0401010101')
FormFuncResult result = new FormFuncResult()
result.includeFormData = true
return result
}
}
We recommend writing a Groovy script in your favorite IDEA, such as Eclipse or IntelliJ, and then copy and paste it into the Groovy Script tab.
As you are working on the script, we recommend Creating a Groovy unit test script right away to test its implementation.
If the Groovy script uses some configurable parameters, add them in the Parameters tab. The example below shows the new three parameters: tokenTimeout, tokenLength, phoneExtractName
.
The Groovy script snippet below shows how to use the new three parameters.
int tokenTimeout = inputParams.svcDef.paramsMap["tokenTimeout"]
int codeLength = inputParams.svcDef.paramsMap["tokenLength"]
String ref = (String) inputParams.svcDef.paramsMap["phoneExtractName"]
The parameters’ values can be changed any time without any Groovy script modifications.
Next, learn how to configure Transact function parameters edit.