API: values
Source:
bpm/values.ts
Values
- Utility class for serializing (stringify) and deserializing (parse) complex variable values (like objects and arrays) to and from JSON strings for storage or transfer across the API boundary.
Classes
Values
Values
* Utility class for serializing (stringify) and deserializing (parse) complex variable values (like objects and arrays)
to and from JSON strings for storage or transfer across the API boundary.
Methods
parseValue
parseValue (value:any):anyAttempts to parse a value as a JSON string.
If the value is a valid JSON string (representing an object or array), it is parsed and returned as an object.
If parsing fails (e.g., the value is a primitive or an invalid JSON string), the original value is returned.
@param value The value to parse, typically a string read from the API.
@returns The parsed object, or the original value if parsing fails.
parseValuesMap
parseValuesMap (variables:Map<string, any>):Map<string,any>Iterates over the values of a Map and applies {@link #parseValue(any)} to each value.
This is typically used to deserialize all variables returned from an API call.
@param variables The Map of variable names to their values (which may be JSON strings).
@returns The Map with all values deserialized where possible.
stringifyValue
stringifyValue (value:any):anySerializes a value for persistence or API transfer.
Arrays and objects are converted into their respective JSON string representations.
Note: Arrays are additionally converted into ajava.util.Listof stringified elements for Java API compatibility.
Primitive types are returned as is.
@param value The value to serialize.
@returns The JSON string representation, a Java List (for arrays), or the original primitive value.
stringifyValuesMap
stringifyValuesMap (variables:Map<string, any>):Map<string,any>Iterates over the values of a Map and applies {@link #stringifyValue(any)} to each value.
This is typically used to serialize a map of variables before sending them to an API call.
@param variables The Map of variable names to their values.
@returns The Map with all values serialized.