|
Nombre del parámetro
|
Descripción
|
BaseType
|
|---|---|---|
|
thingReferences
|
Una infotable que consta de una lista de cosas.
La definición de datos esperada para la infotable es EntityReference.
|
INFOTABLE
|
|
dataShapeName
|
Nombre de la definición de datos que encapsula los valores de las propiedades que debe devolver la consulta.
La definición de datos debe existir en el modelo de ThingWorx. La definición de datos puede ser una entidad del sistema o una entidad definida por el usuario.
|
DATASHAPENAME
|
|
Nombre del parámetro
|
Descripción
|
Tipo base
|
|---|---|---|
|
result
|
Se devuelve una infotable con los valores de las propiedades solicitadas en la definición de datos de cada cosa solicitada en la entrada de thingReferences.
En la definición de datos de la infotable de retorno se incluirá el nombre de la cosa y todas las propiedades de la definición de datos de entrada.
|
INFOTABLE
|
|
Entidad
|
Propiedades
|
|---|---|
|
Thing1
|
Property1
|
|
Thing2
|
Property1, Property2
|
|
Thing3
|
Property1, Property2, Property3
|
|
TestStream
|
Property1, Property2, Property3
|
|
TestDatashape
|
Property1, Property3, Property4
|
// Create a thingRef Infotable with the datashape EntityReference
var thingRefInfoTableParams = {
infoTableName : "InfoTable",
dataShapeName : "EntityReference"
};
var thingRef = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(thingRefInfoTableParams);
// populate thingRef InfoTable
var thing1Entry = new Object();
thing1Entry.name = "Thing1"; // STRING
thing1Entry.type = "Thing"; // STRING
var thing2Entry = new Object();
thing2Entry.name = "Thing2"; // STRING
thing2Entry.type = "Thing"; // STRING
var thing3Entry = new Object();
thing3Entry.name = "Thing3"; // STRING
thing3Entry.type = "Thing"; // STRING
var streamEntry = new Object();
streamEntry.name = "TestStream"; // STRING
streamEntry.type = "Thing"; // STRING
thingRef.AddRow(thing1Entry);
thingRef.AddRow(thing2Entry);
thingRef.AddRow(thing3Entry);
thingRef.AddRow(streamEntry);
// result: INFOTABLE dataShape: "RootEntityList"
result = Resources["EntityServices"].GetThingPropertyValues({
thingReferences: thingRef /* INFOTABLE */,
dataShapeName: "TestDatashape" /* DATASHAPENAME */
});
|
thingName
|
Property1
|
Property3
|
Property4
|
|---|---|---|---|
|
Thing1
|
11
|
||
|
Thing2
|
21
|
||
|
Thing3
|
31
|
33
|
|
|
TestStream
|
S1
|
S3
|