ThingWorx Model Definition in Composer > Data Storage > Value Streams > Accessing Value Stream Data Using Services
Accessing Value Stream Data Using Services
The following value stream services are available via a Thing or Thing Template. Data must be accessed through the Thing that uses the value stream.
You can retrieve value stream entries in a variety of ways using the provided services. For example, entries can be retrieved by a specific logged property (QueryBooleanPropertyHistory, (QueryDateTimePropertyHistory), a set of logged properties (QueryNamedPropertyHistory), or all logged properties (QueryPropertyHistory).
When retrieving multiple properties, ThingWorx runs a special algorithm to ensure a full table that is in sync with no nulls is returned. For example, if one property is logged more often than another property, ThingWorx fills in the blanks if both properties are retrieved at once.
Value stream data is not deleted unless the Thing that created the data explicitly purges the data or the value stream is deleted. Data remains intact if the originating Thing or property is deleted.
* 
When switching the persistence provider of a value stream (for example, from ThingworxPersistenceProvider to PostgreSQL or InfluxDB), any Thing that implements a value stream must call the RestartThing service to retrieve entries written to the new persistence provider. If the Things are not restarted, entries may be written to the database; however, they will not be retrieved until the Thing is restarted.
Value Stream Services
Service
Description
AddBooleanValueStreamEntry
Adds a boolean property value into the value stream for the Thing.
AddDateTimeValueStreamEntry
Adds a date and time property value into the value stream for the Thing.
AddImageValueStreamEntry
Adds an image property value into the value stream for the Thing.
AddInfoTableValueStreamEntry
Adds an Infotable property value into the value stream for the Thing.
AddIntegerValueStreamEntry
Adds an integer property value into the value stream for the Thing.
AddLocationValueStreamEntry
Adds a location property value into the value stream for the Thing.
AddLongValueStreamEntry
Adds a long value property value into the value stream for the Thing.
AddNumberValueStreamEntry
Adds a number property value into the value stream for the Thing.
AddStringValueStreamEntry
Adds a string property value into the value stream for the Thing.
AddThingCodeValueStreamEntry
Adds a Thing Code property value into the value stream for the Thing.
AddVec2ValueStreamEntry
Adds a specified vec2 (A collection of two numbers. For example, 2D coordinates x and y) property value into the value stream for the Thing.
AddVec3ValueStreamEntry
Adds a specified vec3 (A collection of three numbers. For example, 3D coordinates x, y, and z) property value into the value stream for the Thing.
AddVec4ValueStreamEntry
Adds a specified vec4 (A collection of four numbers. For example, 4D coordinates x, y, z, and w) property value into the value stream for the Thing.
GetLoggedProperties
Returns a list of the Thing’s properties marked for value stream logging.
GetNumericLoggedProperties
Returns a list of properties for a specified numeric base type.
GetPropertyLogging
QueryBooleanPropertyHistory
GetValueStream
Returns the name of the value stream assigned to the Thing.
PurgePropertyHistory
Deletes all value stream entries for a property within the specified date range.
QueryBooleanPropertyHistory
Queries the value stream entries for the specified boolean property values within a date range for the Thing.
QueryDateTimePropertyHistory
Queries the value stream entries for the specified datetime property values of the Thing.
QueryImagePropertyHistory
Queries the value stream entries for the specified image property values of the Thing..
QueryInfoTablePropertyHistory
Queries the value stream entries for the specified infotable property values within a date range for the Thing.
QueryIntegerPropertyHistory
Queries the value stream entries for the specified integer property values of the Thing.
QueryLocationPropertyHistory
Queries the value stream entries for the specified location property values of the Thing in a specified time range.
QueryLongPropertyHistory
Queries the value stream entries for the specified long property values of the Thing.
QueryNamedPropertyHistory
Queries the value stream entries for a specified logged property value, along with filter and sort criteria, and normalizes the data set to display results for a given time range.
QueryNumberPropertyHistory
Queries the value stream for the specified number property values of the Thing in a specified time range.
Queries the value stream for logged property values, along with filter and sort criteria, and normalizes the data set to display results for a given time range.
QueryStringPropertyHistory
Queries the value stream for the specified string property values of the Thing in a specified time range.
QueryThingCodePropertyHistory
Queries the value stream entries for the specified thingcode (A numerical representation of a Thing containing a Domain ID and Instance ID) property values of the Thing.
QueryVec2PropertyHistory
Queries the value stream entries for the specified vec2 (A collection of two numbers. For example, 2D coordinates x and y) property values of the Thing.
QueryVec3PropertyHistory
Queries the value stream entries for the specified vec3 (A collection of three numbers. For example, 3D coordinates x, y, and z) property values of the Thing.
QueryVec4PropertyHistory
Queries the value stream entries for the specified vec4 (A collection of four numbers. For example, 4D coordinates x, y, z, and w) property values of the Thing.
SetPropertyLogging
Turns the logging on or off for a specified property.
SetValueStream
Sets the value stream for the Thing.
Was this helpful?