-
Feature Request
-
Resolution: Fixed
-
L3 - Default
-
None
-
None
AT:
- When setting a value for a variable, I can specify the type of the value, even if the value is null
- When getting a value for a variable, I can get the type of the value, even if the value is null
- Also works if the value is a deserialized Java Object
- Also works if the value is a serialized Java Object
Motivation:
=========
Currently the process engine provides an "untyped" API for working with variables.This leads to some subtle limitations:
Null values:
---------------
1) It is impossible to initialize a variable with "null" and declare a type for it:
execution.setVariable("myVar", null);
=> type of variable cannot be detected by process engine and will be "null"
2) It is impossible to get the type of a variable which has variable null. I cannot
Object object = execution.getVariable("myVar");
object.getClass() // < will throw NPE if object is null
All of this is OK as long as I am "only" writing Java Applications in which I know the types of my variables everywhere. However, it causes problems when
- developing a clean REST API
- developing "Generic" applications such as Cockpit or Tasklist
- crossing the language barrier and use Java Script (for instance when developing task forms)
Additional Metadata:
--------------------------
1) It is impossible to attach and retrieve additional metadata to values. For instance, when working with XML data, you cannot specify additional metadata in the variable value such as Namespace / Schema information.
While this can be to a certain extend embedded in the value itself when working with XML this is not trivially possible when working with other dataformats such as JSON or CSV...
2) Additional Metadata is also relevant when working with serialized Java Objects. There the requirement is to be able to get and set the type of the java object even if the object itself is
a) null
b) not deserialized (this is required in situations where we cannot deserialize the java objects due to classloader restrictions)
c) specify the value in a different format such as JSON or XML
3) Formulating restrictions (read-only, type-change allowed ...)
This is the controller panel for Smart Panels app
- is related to
-
CAM-2834 Camunda-Spin: Variables cannot be removed or set to null
- Closed
-
CAM-2678 I can submit and retrieve serialized object representations for variables using the Case Service
- Closed
-
CAM-2887 Migrate Cockpit to typed variable API
- Closed
-
CAM-2888 Migrate Tasklist to typed Variable API
- Closed
-
CAM-2889 Migrate REST Api to typed variable API
- Closed
-
CAM-2538 I can set a variable to value "null" for any variable type
- Closed
-
CAM-3152 Typed Variable API in CDI Module
- Closed
-
CAM-2890 Migrate variable documentation in user-guide
- Closed