runNamedMetricQuery
Runs a pre-defined metric query that is stored in the platform in the Report Manager.
Parameters
- moduleName
- The name of the module.
- objectTypeName
- The name of the object type.
- queryName
- The name of the query.
- metricQueryfilters
- An array of filter objects for this query. The filters that are used do not need to be runtime filters pre-defined by this query. Any filters already applied to the query pertains.
- groupBy
- The group by for this query.
- start
- Defines the start position of the search. For example, if a query returns 5 results and you set the start value to 1, all 5 results are returned. If you set the start value to 4, the last 2 results are returned.
- maximumResultCount
- Limits the number of records returned. The maximumResultCount argument cannot exceed the max integer value of 2147483647, minus the start argument. Since the start argument is base 1, the maximumResultCount cannot exceed 2147483646.
Returns
A MetricQueryResult object that contains the resulting records, a total count of the results, any secondary group by records and a continuation token, if any, is returned.
Errors
- ProjectDoesNotExistException
- The project does not exist.
- ModuleDoesNotExistException
- The module does not exist.
- ObjectTypeDoesNotExistException
- The object type does not exist.
- RecordDoesNotExistException
- The record does not exist.
- QueryDoesNotExistException
- The query does not exist.
- InvalidArgumentException
- At least one of the arguments is invalid.
- AccessException
- The user does not have access to the module or business object.
- Exception
- A general exception occurred while the request is being processed.
Sample request
<soap:Envelope
xmlns:soap="http://www.xxx/soap-envelope/"
xmlns:ws="http://ws.tririga.com" xmlns:dto="http://dto.ws.tririga.com">
<soap:Header/>
<soap:Body>
<ws:runNamedMetricQuery>
<!--Optional:-->
<ws:moduleName>Location</ws:moduleName>
<!--Optional:-->
<ws:objectTypeName>triBuilding</ws:objectTypeName>
<ws:queryName>Metric Report Parking</ws:queryName>
<ws:metricQueryfilters>
<!--Zero or more repetitions:-->
<dto:MetricQueryFilter>
<!--Optional:-->
<dto:fieldName>triDimGeographyTX</dto:fieldName>
<!--Optional:-->
<dto:value>212968</dto:value>
</dto:MetricQueryFilter>
</ws:metricQueryfilters>
<!--Optional:-->
<ws:groupBy>
<!--Optional:-->
<dto:fieldName>triDimLocationTX</dto:fieldName>
</ws:groupBy>
<ws:start>1</ws:start>
<ws:maximumResultCount>1</ws:maximumResultCount>
</ws:runNamedMetricQuery>
</soap:Body>
</soap:Envelope>
Sample response
<soap:Envelope xmlns:soap="http://www.xxx/soap-envelope/">
<soap:Body>
<ns1:runNamedMetricQueryResponse xmlns:ns1="http://ws.tririga.com">
<ns1:out>
<ns2:continuationToken xmlns:ns2="http://dto.ws.tririga.com">
<ns2:tokenString>-67cb25bb:13cfe394cb5:-7fc9</ns2:tokenString>
</ns2:continuationToken>
<ns2:totalResults xmlns:ns2="http://dto.ws.tririga.com">2</ns2:totalResults>
<ns2:metricQueryResponseHelpers xmlns:ns2="http://dto.ws.tririga.com">
<ns2:MetricQueryResponseHelper>
<ns2:boId>10002100</ns2:boId>
<ns2:recordId>11991577</ns2:recordId>
<ns2:metricQueryResponseColumns>
<ns2:MetricQueryResponseColumn>
<ns2:displayValue>77</ns2:displayValue>
<ns2:index>0</ns2:index>
<ns2:label>Parking Spaces (Open)</ns2:label>
<ns2:name>triParkingOpenNU</ns2:name>
<ns2:section xsi:nil="true" xmlns:xsi="http://www.xxx/XMLSchema-instance"/>
<ns2:uom xsi:nil="true" xmlns:xsi="http://www.xxx/XMLSchema-instance"/>
<ns2:value>77.00</ns2:value>
<ns2:thresholdRangeColor>#96A634</ns2:thresholdRangeColor>
<ns2:thresholdRangeIconUrl>/images/threshold_High.gif</ns2:thresholdRangeIconUrl>
</ns2:MetricQueryResponseColumn>
<ns2:MetricQueryResponseColumn>
<ns2:displayValue>20</ns2:displayValue>
<ns2:index>1</ns2:index>
<ns2:label>Parking Spaces (Covered)</ns2:label>
<ns2:name>triParkingCoveredNU</ns2:name>
<ns2:section xsi:nil="true" xmlns:xsi="http://www.xxx/XMLSchema-instance"/>
<ns2:uom xsi:nil="true" xmlns:xsi="http://www.xxx/XMLSchema-instance"/>
<ns2:value>20.00</ns2:value>
<ns2:thresholdRangeColor>#FFFF66</ns2:thresholdRangeColor>
<ns2:thresholdRangeIconUrl>/images/threshold_Caution.gif</ns2:thresholdRangeIconUrl>
</ns2:MetricQueryResponseColumn>
</ns2:metricQueryResponseColumns>
<ns2:primaryGroupByDisplayValue>TMF Buildiing 1</ns2:primaryGroupByDisplayValue>
<ns2:primaryGroupByLabel>Location</ns2:primaryGroupByLabel>
<ns2:primaryGroupByName>triDimLocationTX</ns2:primaryGroupByName>
<ns2:primaryGroupByValue>TMF Buildiing 1</ns2:primaryGroupByValue>
<ns2:secondaryGroupByDisplayValue xsi:nil="true" xmlns:xsi="http://www.xxx/XMLSchema-instance"/>
<ns2:secondaryGroupByLabel xsi:nil="true" xmlns:xsi="http://www.xxx/XMLSchema-instance"/>
<ns2:secondaryGroupByName xsi:nil="true" xmlns:xsi="http://www.xxx/XMLSchema-instance"/>
<ns2:secondaryGroupByValue xsi:nil="true" xmlns:xsi="http://www.xxx/XMLSchema-instance"/>
</ns2:MetricQueryResponseHelper>
</ns2:metricQueryResponseHelpers>
</ns1:out>
</ns1:runNamedMetricQueryResponse>
</soap:Body>
</soap:Envelope>