QueryImplementingThings
Descrizione
Il servizio QueryImplementingThings interroga e recupera informazioni sugli oggetti che implementano thing shape o modelli di oggetto specifici in ThingWorx. Consente di filtrare e ordinare i risultati in base a vari criteri, ad esempio valori di proprietà, tag e interrogazioni.
Input
Nessuno
Output
Tipo di infotable che fornisce il risultato dell'interrogazione con la tabella degli oggetti implementati.
Esempio
var result = ThingShapes["testThingShapeOneForQITService<>626037"].QueryImplementingThings({ 
maxItems: undefined /* NUMBER */,
nameMask: undefined /* STRING */,
query: undefined /* QUERY */,
tags: undefined /* TAGS */
});
var resultQIT = result;
var params = {
infoTableName : "InfoTable",
dataShapeName : "ThingRefDataShape"
};
// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(ThingRefDataShape)
result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
var thingRef = result;
for(var x=0 ; x<resultQIT.length ; x++){
var thingName = resultQIT[x].name;
var newEntry = new Object();
newEntry.name = thingName; // STRING
newEntry.type = "Thing"; // STRING
thingRef.AddRow(newEntry);
}
// result: INFOTABLE dataShape: "RootEntityList"
result = Resources["EntityServices"].GetThingPropertyValues({
thingReferences: thingRef /* INFOTABLE */,
dataShapeName: "QITDataShape<>392587" /* DATASHAPENAME */
});
QueryImplementingThingsV2
Descrizione
Il servizio QueryImplementingThingsV2 interroga e recupera informazioni sugli oggetti che implementano thing shape o modelli di oggetto specifici in ThingWorx. Consente di filtrare e ordinare i risultati in base a vari criteri, ad esempio valori di proprietà, tag e interrogazioni.
Input
Nome parametro
Descrizione
Tipo di base
maxItems
Numero massimo di elementi da restituire nell'insieme di risultati. Il valore di default è 500. Questo parametro viene applicato dopo l'applicazione di tutti gli altri filtri.
NUMBER
tags
Tag modello associati all'origine di questa voce.
TAGS
nameMask
Schema del nome per le entità che implementano il modello di oggetto o la thing shape.
STRING
query
Criteri dell'interrogazione utilizzati per filtrare i dati. È possibile scrivere i filtri solo per le proprietà effettive del modello di oggetto o della thing shape per cui viene eseguito il servizio. Per ulteriori informazioni, vedere Parametro di interrogazione per servizi di interrogazione.
QUERY
isSortFirst
Se impostato su true, gli oggetti vengono ordinati per primi.
BOOLEAN
Output
Nome parametro
Descrizione
Tipo di base
result
Tipo di infotable che fornisce il risultato dell'interrogazione con la tabella degli oggetti implementati.
INFOTABLE
Esempio
var result = ThingShapes["testThingShapeOneForQITService<>626037"].QueryImplementingThingsV2({ 
maxItems: undefined /* NUMBER */,
nameMask: undefined /* STRING */,
query: undefined /* QUERY */,
tags: undefined /* TAGS */
});
var resultQIT = result;
var params = {
infoTableName : "InfoTable",
dataShapeName : "ThingRefDataShape"
};
// CreateInfoTableFromDataShape(infoTableName:STRING("InfoTable"), dataShapeName:STRING):INFOTABLE(ThingRefDataShape)
result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
var thingRef = result;
for(var x=0 ; x<resultQIT.length ; x++){ var thingName = resultQIT[x].name;
var newEntry = new Object();
newEntry.name = thingName; // STRING
newEntry.type = "Thing"; // STRING
thingRef.AddRow(newEntry);
}
// result: INFOTABLE dataShape: "RootEntityList"
result = Resources["EntityServices"].GetThingPropertyValues({
thingReferences: thingRef /* INFOTABLE */,
dataShapeName: "QITDataShape<>392587" /* DATASHAPENAME */
});
È stato utile?