Package com.avoka.tm.svc
Class FluentFuncInvoker
java.lang.Object
com.avoka.tm.svc.FluentFuncInvoker
Provides a Fluent Function Invoker class for executing 'Fluent Function' types services. Please note this class does not support invoking 'Delivery Functions' as these need to be executed by internal TM services to ensure the transaction state transitions are managed correctly.
Examples
Please find the fluent function invoker examples below.
Executing in a Form Function
The example below illustrates calling a Fluent Function inside another function handler. Please note
how you can simply pass the FuncParam
parameter into the function being called and return the
resulting FuncResult
object.
import com.avoka.tm.func.* import com.avoka.tm.util.* import com.avoka.tm.vo.* import jakarta.servlet.http.* class FluentFunction { public Logger logger // Perform Fluent Function call. FuncResult invoke(FuncParam param) { FuncResult result = new FluentFuncInvoker() .setServiceName("Account Verification") .setVersion("1.0.1") .invoke(param) return result } }
Please Note: if the service version number is not specified then the service for the transaction organization, service name and current version will be resolved.
- Since:
- 17.10.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionInvoke the fluent function and return the function result.Set the function logger.setServiceName
(String serviceName) Set the function service name to invoke.setVersion
(String version) Set the function version to invoke.
-
Constructor Details
-
FluentFuncInvoker
public FluentFuncInvoker()
-
-
Method Details
-
setServiceName
Set the function service name to invoke.- Parameters:
serviceName
- the function service name to invoke (required)- Returns:
- the fluent function invoker
-
setVersion
Set the function version to invoke.- Parameters:
version
- function version to invoke (required)- Returns:
- the fluent function invoker
-
setLogger
Set the function logger.- Parameters:
logger
- the function logger- Returns:
- the fluent function invoker
- Since:
- 17.10.3
-
invoke
Invoke the fluent function and return the function result.- Parameters:
funcParam
- the function parameter- Returns:
- the function result
-