Package com.avoka.tm.svc
Class GroovyServiceInvoker
java.lang.Object
com.avoka.tm.svc.GroovyServiceInvoker
Provides a 'Groovy Service' type service invoker class.
Please note Fluent Service can only invoke Dynamic Groovy Services if the install time Groovy Secure API restriction is not enforced.
Examples
Please find the groovy service invoker examples below.
Invoke "Reference Lookup" Service
The example below invokes a "Reference Lookup" Groovy Service with a map of parameters and returns a result object.
import com.avoka.tm.svc.* def params = [:] params.refNumber = ... def result = new GroovyServiceInvoker() .setServiceName("Ref Lookup") .setClientCode("maguire") .setVersion("0.2.1") .invoke(params)
- Since:
- 5.0.0
-
Constructor Summary
ConstructorDescriptionCreate a groovy service invoker object.GroovyServiceInvoker
(SvcDef svcDef) Create a 'Groovy Service' invoker object. -
Method Summary
Modifier and TypeMethodDescriptioninvoke()
Invoke the service specified by the service definition name, version and client code and return the resulting object.Invoke the service specified by the service definition name, version and client code, with the given params and return the resulting object.setClientCode
(String clientCode) Set the service definition organization client code to invoke.setServiceName
(String serviceName) Set the service definition name to invoke.Set the service definition to invoke.setVersion
(String version) Set the service definition version to invoke.setVersionNumber
(int versionNumber) Deprecated.Set flag to invoke the service with highest version number.
-
Constructor Details
-
GroovyServiceInvoker
public GroovyServiceInvoker()Create a groovy service invoker object. -
GroovyServiceInvoker
Create a 'Groovy Service' invoker object.- Parameters:
svcDef
- the 'Groovy Service' type service definition to invoke (required)
-
-
Method Details
-
setSvcDef
Set the service definition to invoke.- Parameters:
svcDef
- the service definition- Returns:
- the groovy service invoker
-
setServiceName
Set the service definition name to invoke.- Parameters:
serviceName
- the service definition name to invoke- Returns:
- the groovy service invoker
-
setVersionNumber
Deprecated.Set the service definition version number to invoke.- Parameters:
versionNumber
- service definition version number to invoke- Returns:
- the groovy service invoker
-
setVersion
Set the service definition version to invoke.- Parameters:
version
- service definition version to invoke (required)- Returns:
- the groovy service invoker
- Since:
- 17.10.0
-
setClientCode
Set the service definition organization client code to invoke.- Parameters:
clientCode
- service definition client code to invoke- Returns:
- the groovy service invoker
-
withHighestVersion
Set flag to invoke the service with highest version number.- Returns:
- the service invoker
-
invoke
Invoke the service specified by the service definition name, version and client code, with the given params and return the resulting object.- Parameters:
params
- the map of parameter to invoke the groovy service with- Returns:
- invoke the service and return the resulting object
-
invoke
Invoke the service specified by the service definition name, version and client code and return the resulting object.- Returns:
- invoke the service and return the resulting object
-