Class InvokeServiceCmd
java.lang.Object
com.flowable.serviceregistry.engine.impl.cmd.AbstractInvokeServiceCmd
com.flowable.serviceregistry.engine.impl.cmd.InvokeServiceCmd
- All Implemented Interfaces:
org.flowable.common.engine.impl.interceptor.Command<ServiceInvocationResultResponse>
public class InvokeServiceCmd
extends AbstractInvokeServiceCmd
implements org.flowable.common.engine.impl.interceptor.Command<ServiceInvocationResultResponse>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateValidateAndCompleteServiceInvocationInputDataMap
(ServiceDefinition serviceDefinition, ServiceDefinitionModel serviceDefinitionModel, ServiceOperation serviceOperation, com.fasterxml.jackson.databind.ObjectMapper objectMapper, org.flowable.common.engine.impl.el.ExpressionManager expressionManager) Creates, validates and completes the service invocation data according the input parameter definition of the service.execute
(org.flowable.common.engine.impl.interceptor.CommandContext commandContext) protected ServiceDefinitionEntity
getServiceDefinition
(String tenantId, org.flowable.common.engine.impl.interceptor.CommandContext commandContext) protected ServiceDefinitionModel
getServiceDefinitionModel
(ServiceDefinitionEntity serviceDefinition, org.flowable.common.engine.impl.interceptor.CommandContext commandContext) protected ServiceInvoker
getServiceInvoker
(ServiceDefinitionModel serviceDefinitionModel, org.flowable.common.engine.impl.interceptor.CommandContext commandContext) protected ServiceOperation
getServiceOperation
(ServiceDefinitionModel serviceDefinitionModel) protected void
processAndValidateInputParameter
(ServiceDefinition serviceDefinition, ServiceDefinitionModel serviceDefinitionModel, ServiceOperation serviceOperation, ServiceInputParameter inputParameter, Map<String, Object> serviceInvocationInputData, com.fasterxml.jackson.databind.ObjectMapper objectMapper, org.flowable.common.engine.impl.el.ExpressionManager expressionManager) Internal method to process a single input parameter by looking at its definition and checking its value.protected ServiceDefinitionEntity
resolveServiceDefinitionByKey
(String tenantId, ServiceRegistryEngineConfiguration serviceEngineConfiguration) protected ServiceDefinitionEntity
resolveServiceDefinitionByReferenceKey
(String tenantId, ServiceDefinitionEntityManager serviceDefinitionEntityManager, org.flowable.common.engine.impl.interceptor.CommandContext commandContext) protected void
validateOperationTypeMatchesRequestedType
(ServiceOperation operation, String requestedOperationType) protected void
Methods inherited from class com.flowable.serviceregistry.engine.impl.cmd.AbstractInvokeServiceCmd
convertToServiceInvocationResult, convertToServiceInvocationResults, handleServiceInvocationResponse, internalInvoke, invokeService
-
Field Details
-
serviceInvocationBuilder
-
-
Constructor Details
-
InvokeServiceCmd
-
-
Method Details
-
execute
public ServiceInvocationResultResponse execute(org.flowable.common.engine.impl.interceptor.CommandContext commandContext) - Specified by:
execute
in interfaceorg.flowable.common.engine.impl.interceptor.Command<ServiceInvocationResultResponse>
-
validateParameters
protected void validateParameters() -
createValidateAndCompleteServiceInvocationInputDataMap
protected Map<String,Object> createValidateAndCompleteServiceInvocationInputDataMap(ServiceDefinition serviceDefinition, ServiceDefinitionModel serviceDefinitionModel, ServiceOperation serviceOperation, com.fasterxml.jackson.databind.ObjectMapper objectMapper, org.flowable.common.engine.impl.el.ExpressionManager expressionManager) Creates, validates and completes the service invocation data according the input parameter definition of the service.- Parameters:
serviceDefinition
-serviceDefinitionModel
- the service definition model the invocation is based onserviceOperation
- the service operation representing the service to be invokedobjectMapper
- the object mapper used for creating and initializing variable values in JSONexpressionManager
- the expression manager used for evaluating default values for input parameters- Returns:
- the initialized and validated variable data map
- Throws:
org.flowable.common.engine.api.FlowableIllegalArgumentException
- if the input parameter validation failed (e.g. a required parameter value was missing)
-
processAndValidateInputParameter
protected void processAndValidateInputParameter(ServiceDefinition serviceDefinition, ServiceDefinitionModel serviceDefinitionModel, ServiceOperation serviceOperation, ServiceInputParameter inputParameter, Map<String, Object> serviceInvocationInputData, com.fasterxml.jackson.databind.ObjectMapper objectMapper, org.flowable.common.engine.impl.el.ExpressionManager expressionManager) Internal method to process a single input parameter by looking at its definition and checking its value. If a required input parameters value is missing and no default one is provided, it will throw an exception.- Parameters:
serviceDefinition
- the service definitionserviceDefinitionModel
- the service definition model the invocation is based onserviceOperation
- the service operation the invocation is based oninputParameter
- the input parameter to be processedserviceInvocationInputData
- the service invocation input data map to be validated and completed for the given parameterobjectMapper
- the object mapper used for creating and initializing variable values in JSONexpressionManager
- the expression manager used for evaluating default values for input parameters- Throws:
org.flowable.common.engine.api.FlowableIllegalArgumentException
- if the input parameter validation failed (e.g. a required parameter value was missing)
-
getServiceDefinition
protected ServiceDefinitionEntity getServiceDefinition(String tenantId, org.flowable.common.engine.impl.interceptor.CommandContext commandContext) -
resolveServiceDefinitionByKey
protected ServiceDefinitionEntity resolveServiceDefinitionByKey(String tenantId, ServiceRegistryEngineConfiguration serviceEngineConfiguration) -
resolveServiceDefinitionByReferenceKey
protected ServiceDefinitionEntity resolveServiceDefinitionByReferenceKey(String tenantId, ServiceDefinitionEntityManager serviceDefinitionEntityManager, org.flowable.common.engine.impl.interceptor.CommandContext commandContext) -
getServiceDefinitionModel
protected ServiceDefinitionModel getServiceDefinitionModel(ServiceDefinitionEntity serviceDefinition, org.flowable.common.engine.impl.interceptor.CommandContext commandContext) -
getServiceInvoker
protected ServiceInvoker getServiceInvoker(ServiceDefinitionModel serviceDefinitionModel, org.flowable.common.engine.impl.interceptor.CommandContext commandContext) -
getServiceOperation
-
validateOperationTypeMatchesRequestedType
protected void validateOperationTypeMatchesRequestedType(ServiceOperation operation, String requestedOperationType)
-