18:28, EEST
August 9, 2016
in sample console I see
Object convertedValue = dataType != null ? client.getAddressSpace()
.getDataTypeConverter().parseVariant(value, dataType)
: value;
but this does not work for array data types.
so my question is how to convert the string “1, 2, 3, 4, 5” to the correct datatype variant if nodeid is a array via DataTypeConverter.
11:16, EEST
April 3, 2012
Hi,
In practice you cannot do this automatically. You can parse the string via normal java code and convert the individual elements maybe. However in practice as soon as the input data is more complex it is best to do the conversion as well and just pass the value to Variant constructor.
The DataTypeConverter main use is with the SDK for the event ContentFilter “Cast” operatator for converting simple types to another as defined in the specification Part 4 section 7.4.3. “FilterOperator”. It mentions that “Arrays of a source type can be converted to arrays of the target type by converting each element.”, so there are no rules on parsing a Scalar String to an array, it is out of scope.
Most Users Ever Online: 1919
Currently Online:
11 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 729
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25Zof, Wojciech KubalaModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1