Class Variables

  • Direct Known Subclasses:
    ClientValues

    public class Variables
    extends java.lang.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 Detail

      • Variables

        public Variables()
    • Method Detail

      • fromMap

        public static VariableMap fromMap​(java.util.Map<java.lang.String,​java.lang.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​(java.lang.String name,
                                           java.lang.Object value)
        Shortcut for Variables.createVariables().putValue(name, value)
      • putValueTyped

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

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

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

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

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

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

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

        public static StringValue stringValue​(java.lang.String stringValue)
        Creates a new StringValue that encapsulates the given stringValue
      • stringValue

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

        public static BooleanValue booleanValue​(java.lang.Boolean booleanValue)
        Creates a new BooleanValue that encapsulates the given booleanValue
      • booleanValue

        public static BooleanValue booleanValue​(java.lang.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​(java.util.Date date)
        Creates a new DateValue that encapsulates the given date
      • dateValue

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

        public static LongValue longValue​(java.lang.Long longValue)
        Creates a new LongValue that encapsulates the given longValue
      • longValue

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

        public static ShortValue shortValue​(java.lang.Short shortValue)
        Creates a new ShortValue that encapsulates the given shortValue
      • shortValue

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

        public static DoubleValue doubleValue​(java.lang.Double doubleValue)
        Creates a new DoubleValue that encapsulates the given doubleValue
      • doubleValue

        public static DoubleValue doubleValue​(java.lang.Double doubleValue,
                                              boolean isTransient)
        Creates a new DoubleValue that encapsulates the given doubleValue
      • untypedValue

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

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

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

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

        public static FileValue fileValue​(java.io.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​(java.io.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).