camunda/camunda-bpm-platform — pull request #129 by sm29105 (2014-11-26 17:03:40+00:00)
Title: CAM-2903: I can work with typed variables in Java API

Hey guys,

I wanted to make a proposal to solve this issue (we are the original requestor).

Note that existing tests are still running, but I did not yet implement ones for the new features.
As the proposal brings changes to the API, this should be reviewed by your team. If the changes are okay, I can provide some additional tests.

Below my notes what was changed so far.

Best regards,

Michael

===============

BusinessProcess API changes:
- Methods associated with the variable cache now return a VariableMap instead of a HashMap
- New "typed" getters for variables

ContextAssociationManager API changes:
- Methods associated with the variable cache now return a VariableMap instead of a HashMap
- New "typed" getters for variables

DefaultContextAssociationManager changes:
- ScopedAssociation now uses VariableMapImpl objects for caching variables instead of HashMap
- ScopedAssociation has additional typed getters for typed variables

ProcessVariableMap and ProcessVariableLocalMap API changes:
- Both classes now implement VariableMap instead of Map
- Additional operations getValue() and getValueTyped() are supported, putValue() and putValueTyped() are not (yet)
- TODO: maybe find a way to make logic from VariableMapImpl better accessible to other classes (I did not want to subclass VariableMapImpl, but it could be a choice)

Other API changes:
- It is now possible to inject a process variable as TypedValue using a new @Typed qualifier in addition to @ProcessVariable or @ProcessVariableLocal
- New named bean "processVariableMap" in addition to "processVariables" returning a VariableMap instead of a Map (maybe obsolete?)
- New named bean "processVariableMapLocal" in addition to "processVariablesLocal" returning a VariableMap instead of a Map (maybe obsolete?)