java.lang.Object
org.flowable.variable.service.impl.types.JsonType
All Implemented Interfaces:
VariableType, MutableVariableType<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>

public class JsonType extends Object implements VariableType, MutableVariableType<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>
Author:
Tijs Rademakers, Filip Hrisafov
  • Field Details

    • TYPE_NAME

      public static final String TYPE_NAME
      See Also:
    • LONG_JSON_TYPE_NAME

      protected static final String LONG_JSON_TYPE_NAME
      See Also:
    • maxLength

      protected final int maxLength
    • lengthVerifier

      protected final VariableLengthVerifier lengthVerifier
    • trackObjects

      protected final boolean trackObjects
    • typeName

      protected final String typeName
    • objectMapper

      protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
  • Constructor Details

    • JsonType

      public JsonType(int maxLength, com.fasterxml.jackson.databind.ObjectMapper objectMapper, boolean trackObjects)
    • JsonType

      public JsonType(int maxLength, VariableLengthVerifier lengthVerifier, com.fasterxml.jackson.databind.ObjectMapper objectMapper, boolean trackObjects)
    • JsonType

      protected JsonType(int maxLength, VariableLengthVerifier lengthVerifier, com.fasterxml.jackson.databind.ObjectMapper objectMapper, boolean trackObjects, String typeName)
  • Method Details

    • longJsonType

      public static JsonType longJsonType(int maxLength, com.fasterxml.jackson.databind.ObjectMapper objectMapper, boolean trackObjects)
    • longJsonType

      public static JsonType longJsonType(int maxLength, VariableLengthVerifier lengthVerifier, com.fasterxml.jackson.databind.ObjectMapper objectMapper, boolean trackObjects)
    • getTypeName

      public String getTypeName()
      Description copied from interface: VariableType
      name of variable type (limited to 100 characters length)
      Specified by:
      getTypeName in interface VariableType
    • isCachable

      public boolean isCachable()
      Description copied from interface: VariableType

      Indicates if this variable type supports caching.

      If caching is supported, the result of VariableType.getValue(ValueFields) is saved for the duration of the session and used for subsequent reads of the variable's value.

      If caching is not supported, all reads of a variable's value require a fresh call to VariableType.getValue(ValueFields).

      Specified by:
      isCachable in interface VariableType
      Returns:
      whether variables of this type are cacheable.
    • getValue

      public Object getValue(ValueFields valueFields)
      Specified by:
      getValue in interface VariableType
      Returns:
      the value of a variable based on the specified ValueFields.
    • setValue

      public void setValue(Object value, ValueFields valueFields)
      Description copied from interface: VariableType
      Stores the specified value in the supplied ValueFields.
      Specified by:
      setValue in interface VariableType
    • updateValueIfChanged

      public boolean updateValueIfChanged(com.fasterxml.jackson.databind.JsonNode originalNode, com.fasterxml.jackson.databind.JsonNode originalCopyNode, VariableInstanceEntity variableInstanceEntity)
      Specified by:
      updateValueIfChanged in interface MutableVariableType<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.databind.JsonNode>
    • traceValue

      protected void traceValue(com.fasterxml.jackson.databind.JsonNode value, ValueFields valueFields)
    • getVariableServiceConfiguration

      protected VariableServiceConfiguration getVariableServiceConfiguration(ValueFields valueFields)
    • getEngineType

      protected String getEngineType(String scopeType)
    • isAbleToStore

      public boolean isAbleToStore(Object value)
      Specified by:
      isAbleToStore in interface VariableType
      Returns:
      whether this variable type can store the specified value.