|
Nome parametro
|
Descrizione
|
Tipo di base
|
|---|---|---|
|
thingReferences
|
Infotable costituita da un elenco di oggetti.
La data shape prevista per l'infotable è EntityReference.
|
INFOTABLE
|
|
dataShapeName
|
Nome della data shape che incapsula i valori delle proprietà che devono essere restituite dall'interrogazione.
La data shape deve esistere nel modello ThingWorx. La data shape può essere un'entità di sistema o un'entità definita dall'utente.
|
DATASHAPENAME
|
|
Nome parametro
|
Descrizione
|
Tipo di base
|
|---|---|---|
|
result
|
Restituisce un'infotable con i valori per le proprietà richieste nella data shape per ogni oggetto richiesto nell'input thingReferences.
La data shape dell'infotable restituita contiene il nome dell'oggetto e tutte le proprietà nella data shape di input.
|
INFOTABLE
|
|
Entità
|
Proprietà
|
|---|---|
|
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
|