Package org.camunda.bpm.engine.variable
Class Variables
- java.lang.Object
-
- org.camunda.bpm.engine.variable.Variables
-
- Direct Known Subclasses:
ClientValues
public class Variables extends java.lang.ObjectThis 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVariables.SerializationDataFormatsA set of builtin serialization dataformat constants.
-
Constructor Summary
Constructors Constructor Description Variables()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BooleanValuebooleanValue(java.lang.Boolean booleanValue)Creates a newBooleanValuethat encapsulates the givenbooleanValuestatic BooleanValuebooleanValue(java.lang.Boolean booleanValue, boolean isTransient)Creates a newBooleanValuethat encapsulates the givenbooleanValuestatic BytesValuebyteArrayValue(byte[] bytes)Creates a newBytesValuethat encapsulates the givenbytesstatic BytesValuebyteArrayValue(byte[] bytes, boolean isTransient)Creates a newBytesValuethat encapsulates the givenbytesstatic VariableMapcreateVariables()Returns a newVariableMapinstance.static DateValuedateValue(java.util.Date date)Creates a newDateValuethat encapsulates the givendatestatic DateValuedateValue(java.util.Date date, boolean isTransient)Creates a newDateValuethat encapsulates the givendatestatic DoubleValuedoubleValue(java.lang.Double doubleValue)Creates a newDoubleValuethat encapsulates the givendoubleValuestatic DoubleValuedoubleValue(java.lang.Double doubleValue, boolean isTransient)Creates a newDoubleValuethat encapsulates the givendoubleValuestatic VariableContextemptyVariableContext()static FileValuefileValue(java.io.File file)Shortcut for callingVariables.fileValue(name).file(file).mimeType(type).create().static FileValuefileValue(java.io.File file, boolean isTransient)Shortcut for callingVariables.fileValue(name).file(file).mimeType(type).setTransient(isTransient).create().static FileValueBuilderfileValue(java.lang.String filename)Returns a builder to create a newFileValuewith the givenfilename.static FileValueBuilderfileValue(java.lang.String filename, boolean isTransient)Returns a builder to create a newFileValuewith the givenfilename.static VariableMapfromMap(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 newVariableMap.static IntegerValueintegerValue(java.lang.Integer integer)Creates a newIntegerValuethat encapsulates the givenintegerstatic IntegerValueintegerValue(java.lang.Integer integer, boolean isTransient)Creates a newIntegerValuethat encapsulates the givenintegerstatic LongValuelongValue(java.lang.Long longValue)Creates a newLongValuethat encapsulates the givenlongValuestatic LongValuelongValue(java.lang.Long longValue, boolean isTransient)Creates a newLongValuethat encapsulates the givenlongValuestatic NumberValuenumberValue(java.lang.Number numberValue)Creates an abstract Number value.static NumberValuenumberValue(java.lang.Number numberValue, boolean isTransient)Creates an abstract Number value.static ObjectValueBuilderobjectValue(java.lang.Object value)Returns a builder to create a newObjectValuethat encapsulates the givenvalue.static ObjectValueBuilderobjectValue(java.lang.Object value, boolean isTransient)Returns a builder to create a newObjectValuethat encapsulates the givenvalue.static VariableMapputValue(java.lang.String name, java.lang.Object value)Shortcut forVariables.createVariables().putValue(name, value)static VariableMapputValueTyped(java.lang.String name, TypedValue value)Shortcut forVariables.createVariables().putValueTyped(name, value)static SerializedObjectValueBuilderserializedObjectValue()Returns a builder to create a newObjectValuefrom a serialized object representation.static SerializedObjectValueBuilderserializedObjectValue(java.lang.String value)Shortcut forVariables.serializedObjectValue().serializedValue(value)static SerializedObjectValueBuilderserializedObjectValue(java.lang.String value, boolean isTransient)Shortcut forVariables.serializedObjectValue().serializedValue(value).setTransient(isTransient)static ShortValueshortValue(java.lang.Short shortValue)Creates a newShortValuethat encapsulates the givenshortValuestatic ShortValueshortValue(java.lang.Short shortValue, boolean isTransient)Creates a newShortValuethat encapsulates the givenshortValuestatic StringValuestringValue(java.lang.String stringValue)Creates a newStringValuethat encapsulates the givenstringValuestatic StringValuestringValue(java.lang.String stringValue, boolean isTransient)Creates a newStringValuethat encapsulates the givenstringValuestatic TypedValueuntypedNullValue()static TypedValueuntypedNullValue(boolean isTransient)static TypedValueuntypedValue(java.lang.Object value)Creates an untyped value, i.e.static TypedValueuntypedValue(java.lang.Object value, boolean isTransient)Creates an untyped value, i.e.
-
-
-
Method Detail
-
createVariables
public static VariableMap createVariables()
Returns a newVariableMapinstance.
-
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 newVariableMap. If the given map is aVariableMap, it is returned as is.
-
putValue
public static VariableMap putValue(java.lang.String name, java.lang.Object value)
Shortcut forVariables.createVariables().putValue(name, value)
-
putValueTyped
public static VariableMap putValueTyped(java.lang.String name, TypedValue value)
Shortcut forVariables.createVariables().putValueTyped(name, value)
-
objectValue
public static ObjectValueBuilder objectValue(java.lang.Object value)
Returns a builder to create a newObjectValuethat encapsulates the givenvalue.
-
objectValue
public static ObjectValueBuilder objectValue(java.lang.Object value, boolean isTransient)
Returns a builder to create a newObjectValuethat encapsulates the givenvalue.
-
serializedObjectValue
public static SerializedObjectValueBuilder serializedObjectValue()
Returns a builder to create a newObjectValuefrom a serialized object representation.
-
serializedObjectValue
public static SerializedObjectValueBuilder serializedObjectValue(java.lang.String value)
Shortcut forVariables.serializedObjectValue().serializedValue(value)
-
serializedObjectValue
public static SerializedObjectValueBuilder serializedObjectValue(java.lang.String value, boolean isTransient)
Shortcut forVariables.serializedObjectValue().serializedValue(value).setTransient(isTransient)
-
integerValue
public static IntegerValue integerValue(java.lang.Integer integer)
Creates a newIntegerValuethat encapsulates the giveninteger
-
integerValue
public static IntegerValue integerValue(java.lang.Integer integer, boolean isTransient)
Creates a newIntegerValuethat encapsulates the giveninteger
-
stringValue
public static StringValue stringValue(java.lang.String stringValue)
Creates a newStringValuethat encapsulates the givenstringValue
-
stringValue
public static StringValue stringValue(java.lang.String stringValue, boolean isTransient)
Creates a newStringValuethat encapsulates the givenstringValue
-
booleanValue
public static BooleanValue booleanValue(java.lang.Boolean booleanValue)
Creates a newBooleanValuethat encapsulates the givenbooleanValue
-
booleanValue
public static BooleanValue booleanValue(java.lang.Boolean booleanValue, boolean isTransient)
Creates a newBooleanValuethat encapsulates the givenbooleanValue
-
byteArrayValue
public static BytesValue byteArrayValue(byte[] bytes)
Creates a newBytesValuethat encapsulates the givenbytes
-
byteArrayValue
public static BytesValue byteArrayValue(byte[] bytes, boolean isTransient)
Creates a newBytesValuethat encapsulates the givenbytes
-
dateValue
public static DateValue dateValue(java.util.Date date)
Creates a newDateValuethat encapsulates the givendate
-
dateValue
public static DateValue dateValue(java.util.Date date, boolean isTransient)
Creates a newDateValuethat encapsulates the givendate
-
longValue
public static LongValue longValue(java.lang.Long longValue)
Creates a newLongValuethat encapsulates the givenlongValue
-
longValue
public static LongValue longValue(java.lang.Long longValue, boolean isTransient)
Creates a newLongValuethat encapsulates the givenlongValue
-
shortValue
public static ShortValue shortValue(java.lang.Short shortValue)
Creates a newShortValuethat encapsulates the givenshortValue
-
shortValue
public static ShortValue shortValue(java.lang.Short shortValue, boolean isTransient)
Creates a newShortValuethat encapsulates the givenshortValue
-
doubleValue
public static DoubleValue doubleValue(java.lang.Double doubleValue)
Creates a newDoubleValuethat encapsulates the givendoubleValue
-
doubleValue
public static DoubleValue doubleValue(java.lang.Double doubleValue, boolean isTransient)
Creates a newDoubleValuethat encapsulates the givendoubleValue
-
numberValue
public static NumberValue numberValue(java.lang.Number numberValue)
Creates an abstract Number value. Note that this value cannot be used to set variables. Use the specific methodsintegerValue(Integer),shortValue(Short),longValue(Long)anddoubleValue(Double)instead.
-
numberValue
public static NumberValue numberValue(java.lang.Number numberValue, boolean isTransient)
Creates an abstract Number value. Note that this value cannot be used to set variables. Use the specific methodsintegerValue(Integer),shortValue(Short),longValue(Long)anddoubleValue(Double)instead.
-
untypedNullValue
public static TypedValue untypedNullValue()
-
untypedNullValue
public static TypedValue untypedNullValue(boolean isTransient)
-
untypedValue
public static TypedValue untypedValue(java.lang.Object value)
Creates an untyped value, i.e.TypedValue.getType()returnsnullfor the returned instance.
-
untypedValue
public static TypedValue untypedValue(java.lang.Object value, boolean isTransient)
Creates an untyped value, i.e.TypedValue.getType()returnsnullfor the returned instance.
-
fileValue
public static FileValueBuilder fileValue(java.lang.String filename)
Returns a builder to create a newFileValuewith the givenfilename.
-
fileValue
public static FileValueBuilder fileValue(java.lang.String filename, boolean isTransient)
Returns a builder to create a newFileValuewith the givenfilename.
-
fileValue
public static FileValue fileValue(java.io.File file)
Shortcut for callingVariables.fileValue(name).file(file).mimeType(type).create(). The name is set to the file name and the mime type is detected viaMimetypesFileTypeMap.
-
fileValue
public static FileValue fileValue(java.io.File file, boolean isTransient)
Shortcut for callingVariables.fileValue(name).file(file).mimeType(type).setTransient(isTransient).create(). The name is set to the file name and the mime type is detected viaMimetypesFileTypeMap.
-
emptyVariableContext
public static VariableContext emptyVariableContext()
- Returns:
- an empty
VariableContext(from which no variables can be resolved).
-
-