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.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Variables.SerializationDataFormats
A 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 BooleanValue
booleanValue(java.lang.Boolean booleanValue)
Creates a newBooleanValue
that encapsulates the givenbooleanValue
static BooleanValue
booleanValue(java.lang.Boolean booleanValue, boolean isTransient)
Creates a newBooleanValue
that encapsulates the givenbooleanValue
static BytesValue
byteArrayValue(byte[] bytes)
Creates a newBytesValue
that encapsulates the givenbytes
static BytesValue
byteArrayValue(byte[] bytes, boolean isTransient)
Creates a newBytesValue
that encapsulates the givenbytes
static VariableMap
createVariables()
Returns a newVariableMap
instance.static DateValue
dateValue(java.util.Date date)
Creates a newDateValue
that encapsulates the givendate
static DateValue
dateValue(java.util.Date date, boolean isTransient)
Creates a newDateValue
that encapsulates the givendate
static DoubleValue
doubleValue(java.lang.Double doubleValue)
Creates a newDoubleValue
that encapsulates the givendoubleValue
static DoubleValue
doubleValue(java.lang.Double doubleValue, boolean isTransient)
Creates a newDoubleValue
that encapsulates the givendoubleValue
static VariableContext
emptyVariableContext()
static FileValue
fileValue(java.io.File file)
Shortcut for callingVariables.fileValue(name).file(file).mimeType(type).create()
.static FileValue
fileValue(java.io.File file, boolean isTransient)
Shortcut for callingVariables.fileValue(name).file(file).mimeType(type).setTransient(isTransient).create()
.static FileValueBuilder
fileValue(java.lang.String filename)
Returns a builder to create a newFileValue
with the givenfilename
.static FileValueBuilder
fileValue(java.lang.String filename, boolean isTransient)
Returns a builder to create a newFileValue
with the givenfilename
.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
.static IntegerValue
integerValue(java.lang.Integer integer)
Creates a newIntegerValue
that encapsulates the giveninteger
static IntegerValue
integerValue(java.lang.Integer integer, boolean isTransient)
Creates a newIntegerValue
that encapsulates the giveninteger
static LongValue
longValue(java.lang.Long longValue)
Creates a newLongValue
that encapsulates the givenlongValue
static LongValue
longValue(java.lang.Long longValue, boolean isTransient)
Creates a newLongValue
that encapsulates the givenlongValue
static NumberValue
numberValue(java.lang.Number numberValue)
Creates an abstract Number value.static NumberValue
numberValue(java.lang.Number numberValue, boolean isTransient)
Creates an abstract Number value.static ObjectValueBuilder
objectValue(java.lang.Object value)
Returns a builder to create a newObjectValue
that encapsulates the givenvalue
.static ObjectValueBuilder
objectValue(java.lang.Object value, boolean isTransient)
Returns a builder to create a newObjectValue
that encapsulates the givenvalue
.static VariableMap
putValue(java.lang.String name, java.lang.Object value)
Shortcut forVariables.createVariables().putValue(name, value)
static VariableMap
putValueTyped(java.lang.String name, TypedValue value)
Shortcut forVariables.createVariables().putValueTyped(name, value)
static SerializedObjectValueBuilder
serializedObjectValue()
Returns a builder to create a newObjectValue
from a serialized object representation.static SerializedObjectValueBuilder
serializedObjectValue(java.lang.String value)
Shortcut forVariables.serializedObjectValue().serializedValue(value)
static SerializedObjectValueBuilder
serializedObjectValue(java.lang.String value, boolean isTransient)
Shortcut forVariables.serializedObjectValue().serializedValue(value).setTransient(isTransient)
static ShortValue
shortValue(java.lang.Short shortValue)
Creates a newShortValue
that encapsulates the givenshortValue
static ShortValue
shortValue(java.lang.Short shortValue, boolean isTransient)
Creates a newShortValue
that encapsulates the givenshortValue
static StringValue
stringValue(java.lang.String stringValue)
Creates a newStringValue
that encapsulates the givenstringValue
static StringValue
stringValue(java.lang.String stringValue, boolean isTransient)
Creates a newStringValue
that encapsulates the givenstringValue
static TypedValue
untypedNullValue()
static TypedValue
untypedNullValue(boolean isTransient)
static TypedValue
untypedValue(java.lang.Object value)
Creates an untyped value, i.e.static TypedValue
untypedValue(java.lang.Object value, boolean isTransient)
Creates an untyped value, i.e.
-
-
-
Method Detail
-
createVariables
public static VariableMap createVariables()
Returns a newVariableMap
instance.
-
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 newObjectValue
that encapsulates the givenvalue
.
-
objectValue
public static ObjectValueBuilder objectValue(java.lang.Object value, boolean isTransient)
Returns a builder to create a newObjectValue
that encapsulates the givenvalue
.
-
serializedObjectValue
public static SerializedObjectValueBuilder serializedObjectValue()
Returns a builder to create a newObjectValue
from 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 newIntegerValue
that encapsulates the giveninteger
-
integerValue
public static IntegerValue integerValue(java.lang.Integer integer, boolean isTransient)
Creates a newIntegerValue
that encapsulates the giveninteger
-
stringValue
public static StringValue stringValue(java.lang.String stringValue)
Creates a newStringValue
that encapsulates the givenstringValue
-
stringValue
public static StringValue stringValue(java.lang.String stringValue, boolean isTransient)
Creates a newStringValue
that encapsulates the givenstringValue
-
booleanValue
public static BooleanValue booleanValue(java.lang.Boolean booleanValue)
Creates a newBooleanValue
that encapsulates the givenbooleanValue
-
booleanValue
public static BooleanValue booleanValue(java.lang.Boolean booleanValue, boolean isTransient)
Creates a newBooleanValue
that encapsulates the givenbooleanValue
-
byteArrayValue
public static BytesValue byteArrayValue(byte[] bytes)
Creates a newBytesValue
that encapsulates the givenbytes
-
byteArrayValue
public static BytesValue byteArrayValue(byte[] bytes, boolean isTransient)
Creates a newBytesValue
that encapsulates the givenbytes
-
dateValue
public static DateValue dateValue(java.util.Date date)
Creates a newDateValue
that encapsulates the givendate
-
dateValue
public static DateValue dateValue(java.util.Date date, boolean isTransient)
Creates a newDateValue
that encapsulates the givendate
-
longValue
public static LongValue longValue(java.lang.Long longValue)
Creates a newLongValue
that encapsulates the givenlongValue
-
longValue
public static LongValue longValue(java.lang.Long longValue, boolean isTransient)
Creates a newLongValue
that encapsulates the givenlongValue
-
shortValue
public static ShortValue shortValue(java.lang.Short shortValue)
Creates a newShortValue
that encapsulates the givenshortValue
-
shortValue
public static ShortValue shortValue(java.lang.Short shortValue, boolean isTransient)
Creates a newShortValue
that encapsulates the givenshortValue
-
doubleValue
public static DoubleValue doubleValue(java.lang.Double doubleValue)
Creates a newDoubleValue
that encapsulates the givendoubleValue
-
doubleValue
public static DoubleValue doubleValue(java.lang.Double doubleValue, boolean isTransient)
Creates a newDoubleValue
that 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()
returnsnull
for the returned instance.
-
untypedValue
public static TypedValue untypedValue(java.lang.Object value, boolean isTransient)
Creates an untyped value, i.e.TypedValue.getType()
returnsnull
for the returned instance.
-
fileValue
public static FileValueBuilder fileValue(java.lang.String filename)
Returns a builder to create a newFileValue
with the givenfilename
.
-
fileValue
public static FileValueBuilder fileValue(java.lang.String filename, boolean isTransient)
Returns a builder to create a newFileValue
with 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).
-
-