Class Variables

java.lang.Object
org.camunda.bpm.engine.variable.Variables
Direct Known Subclasses:
ClientValues

public class Variables extends Object

This class is the entry point to the process engine's typed variables API. Users can import the methods provided by this class using a static import:

import static org.camunda.bpm.engine.variable.Variables.*;
Author:
Daniel Meyer
  • Constructor Details

    • Variables

      public Variables()
  • Method Details

    • createVariables

      public static VariableMap createVariables()
      Returns a new VariableMap instance.
    • fromMap

      public static VariableMap fromMap(Map<String,Object> map)
      If the given map is not a variable map, adds all its entries as untyped values to a new VariableMap. If the given map is a VariableMap, it is returned as is.
    • putValue

      public static VariableMap putValue(String name, Object value)
      Shortcut for Variables.createVariables().putValue(name, value)
    • putValueTyped

      public static VariableMap putValueTyped(String name, TypedValue value)
      Shortcut for Variables.createVariables().putValueTyped(name, value)
    • objectValue

      public static ObjectValueBuilder objectValue(Object value)
      Returns a builder to create a new ObjectValue that encapsulates the given value.
    • objectValue

      public static ObjectValueBuilder objectValue(Object value, boolean isTransient)
      Returns a builder to create a new ObjectValue that encapsulates the given value.
    • serializedObjectValue

      public static SerializedObjectValueBuilder serializedObjectValue()
      Returns a builder to create a new ObjectValue from a serialized object representation.
    • serializedObjectValue

      public static SerializedObjectValueBuilder serializedObjectValue(String value)
      Shortcut for Variables.serializedObjectValue().serializedValue(value)
    • serializedObjectValue

      public static SerializedObjectValueBuilder serializedObjectValue(String value, boolean isTransient)
      Shortcut for Variables.serializedObjectValue().serializedValue(value).setTransient(isTransient)
    • integerValue

      public static IntegerValue integerValue(Integer integer)
      Creates a new IntegerValue that encapsulates the given integer
    • integerValue

      public static IntegerValue integerValue(Integer integer, boolean isTransient)
      Creates a new IntegerValue that encapsulates the given integer
    • stringValue

      public static StringValue stringValue(String stringValue)
      Creates a new StringValue that encapsulates the given stringValue
    • stringValue

      public static StringValue stringValue(String stringValue, boolean isTransient)
      Creates a new StringValue that encapsulates the given stringValue
    • booleanValue

      public static BooleanValue booleanValue(Boolean booleanValue)
      Creates a new BooleanValue that encapsulates the given booleanValue
    • booleanValue

      public static BooleanValue booleanValue(Boolean booleanValue, boolean isTransient)
      Creates a new BooleanValue that encapsulates the given booleanValue
    • byteArrayValue

      public static BytesValue byteArrayValue(byte[] bytes)
      Creates a new BytesValue that encapsulates the given bytes
    • byteArrayValue

      public static BytesValue byteArrayValue(byte[] bytes, boolean isTransient)
      Creates a new BytesValue that encapsulates the given bytes
    • dateValue

      public static DateValue dateValue(Date date)
      Creates a new DateValue that encapsulates the given date
    • dateValue

      public static DateValue dateValue(Date date, boolean isTransient)
      Creates a new DateValue that encapsulates the given date
    • longValue

      public static LongValue longValue(Long longValue)
      Creates a new LongValue that encapsulates the given longValue
    • longValue

      public static LongValue longValue(Long longValue, boolean isTransient)
      Creates a new LongValue that encapsulates the given longValue
    • shortValue

      public static ShortValue shortValue(Short shortValue)
      Creates a new ShortValue that encapsulates the given shortValue
    • shortValue

      public static ShortValue shortValue(Short shortValue, boolean isTransient)
      Creates a new ShortValue that encapsulates the given shortValue
    • doubleValue

      public static DoubleValue doubleValue(Double doubleValue)
      Creates a new DoubleValue that encapsulates the given doubleValue
    • doubleValue

      public static DoubleValue doubleValue(Double doubleValue, boolean isTransient)
      Creates a new DoubleValue that encapsulates the given doubleValue
    • numberValue

      public static NumberValue numberValue(Number numberValue)
      Creates an abstract Number value. Note that this value cannot be used to set variables. Use the specific methods integerValue(Integer), shortValue(Short), longValue(Long) and doubleValue(Double) instead.
    • numberValue

      public static NumberValue numberValue(Number numberValue, boolean isTransient)
      Creates an abstract Number value. Note that this value cannot be used to set variables. Use the specific methods integerValue(Integer), shortValue(Short), longValue(Long) and doubleValue(Double) instead.
    • untypedNullValue

      public static TypedValue untypedNullValue()
      Creates a TypedValue with value null and type ValueType.NULL
    • untypedNullValue

      public static TypedValue untypedNullValue(boolean isTransient)
      Creates a TypedValue with value null and type ValueType.NULL
    • untypedValue

      public static TypedValue untypedValue(Object value)
      Creates an untyped value, i.e. TypedValue.getType() returns null for the returned instance.
    • untypedValue

      public static TypedValue untypedValue(Object value, boolean isTransient)
      Creates an untyped value, i.e. TypedValue.getType() returns null for the returned instance.
    • fileValue

      public static FileValueBuilder fileValue(String filename)
      Returns a builder to create a new FileValue with the given filename.
    • fileValue

      public static FileValueBuilder fileValue(String filename, boolean isTransient)
      Returns a builder to create a new FileValue with the given filename.
    • fileValue

      public static FileValue fileValue(File file)
      Shortcut for calling Variables.fileValue(name).file(file).mimeType(type).create(). The name is set to the file name and the mime type is detected via MimetypesFileTypeMap.
    • fileValue

      public static FileValue fileValue(File file, boolean isTransient)
      Shortcut for calling Variables.fileValue(name).file(file).mimeType(type).setTransient(isTransient).create(). The name is set to the file name and the mime type is detected via MimetypesFileTypeMap.
    • emptyVariableContext

      public static VariableContext emptyVariableContext()
      Returns:
      an empty VariableContext (from which no variables can be resolved).