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 Details

  • Constructor Details

  • Method Details

    • execute

      public ServiceInvocationResultResponse execute(org.flowable.common.engine.impl.interceptor.CommandContext commandContext)
      Specified by:
      execute in interface org.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 on
      serviceOperation - the service operation representing the service to be invoked
      objectMapper - the object mapper used for creating and initializing variable values in JSON
      expressionManager - 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 definition
      serviceDefinitionModel - the service definition model the invocation is based on
      serviceOperation - the service operation the invocation is based on
      inputParameter - the input parameter to be processed
      serviceInvocationInputData - the service invocation input data map to be validated and completed for the given parameter
      objectMapper - the object mapper used for creating and initializing variable values in JSON
      expressionManager - 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

      protected ServiceOperation getServiceOperation(ServiceDefinitionModel serviceDefinitionModel)
    • validateOperationTypeMatchesRequestedType

      protected void validateOperationTypeMatchesRequestedType(ServiceOperation operation, String requestedOperationType)