Class ScriptInvoker
java.lang.Object
com.flowable.serviceregistry.engine.impl.invoker.AbstractServiceInvoker
com.flowable.serviceregistry.engine.impl.invoker.script.ScriptInvoker
- All Implemented Interfaces:
ServiceInvoker
The script invoker is a service invoker based on either a groovy or juel script.
- Author:
- Micha Kiener
-
Field Summary
Fields inherited from class com.flowable.serviceregistry.engine.impl.invoker.AbstractServiceInvoker
objectMapper, serviceRegistryEngineConfiguration
-
Constructor Summary
ConstructorDescriptionScriptInvoker
(ServiceRegistryEngineConfiguration serviceRegistryEngineConfiguration, com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionprotected VariableContainer
executeScriptAndGetResult
(ServiceDefinitionModel serviceDefinition, ServiceOperation serviceOperation, ServiceInvocationContext context) Executes the service definition using the scripting engines and the language defined in the script based service definition.invoke
(ServiceDefinitionModel serviceDefinition, ServiceOperation serviceOperation, ServiceInvocationContext serviceInvocationContext) invokeList
(ServiceDefinitionModel serviceDefinition, ServiceOperation serviceOperation, ServiceInvocationContext serviceInvocationContext) Methods inherited from class com.flowable.serviceregistry.engine.impl.invoker.AbstractServiceInvoker
completeInputParameter, createAndInitializeServiceInvocationVariablesContainer
-
Field Details
-
KEY
- See Also:
-
SCRIPT_CONTENT
- See Also:
-
SCRIPT_LANGUAGE
- See Also:
-
-
Constructor Details
-
ScriptInvoker
public ScriptInvoker(ServiceRegistryEngineConfiguration serviceRegistryEngineConfiguration, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
invoke
public ServiceInvocationResponse invoke(ServiceDefinitionModel serviceDefinition, ServiceOperation serviceOperation, ServiceInvocationContext serviceInvocationContext) -
invokeList
public List<ServiceInvocationResponse> invokeList(ServiceDefinitionModel serviceDefinition, ServiceOperation serviceOperation, ServiceInvocationContext serviceInvocationContext) -
executeScriptAndGetResult
protected VariableContainer executeScriptAndGetResult(ServiceDefinitionModel serviceDefinition, ServiceOperation serviceOperation, ServiceInvocationContext context) Executes the service definition using the scripting engines and the language defined in the script based service definition. The input parameters are exposed directly into the script context. The output value is captured through an output container containing the resulting data populated during script execution.- Parameters:
serviceDefinition
- the service definition to be executedserviceOperation
- the service operation to be executedcontext
- the service invocation context used for the invocation- Returns:
- the variable container which will contain the output parameters set during script execution
-