0

I'm a newcomer to Cumulocity, currently evaluating both Java and C++ agents. In Java MeasurementValue class has a method setType(ValueType), which can have ValueType.STRING as argument but container for measurement value is BigDecimal. In general, is it possible to have non numeric measurements ?

Hannu_H
  • 5
  • 1

1 Answers1

0

The value property needs to be numeric, since Cumulocity aggregates it, renders it on axes of graphs and the like. However, you can store any kind of additional properties along with measurement, events, managed objects, ... and these can also be non-numeric (e.g., is the value valid). To visualize such additional properties, you may need an own widget.

To add other data structures and types, you can use the same mechanism as described on http://cumulocity.com/guides/java/developing/ in the "Tariff" example. E.g. create a Java bean with your string property and add that using

measurement.set(instanceOfMyClass);

Or use a HashMap, add your additional properties to it and use

measurement.set(myHashMap, "myExtendedProperties");

Note: There are two classes with the name ValueType. The one that belongs to MeasurementValue does not have ValueType.STRING.

André
  • 668
  • 6
  • 11