This section explains how you call the SDK methods to create and run queries with or
without parameters against universes.
Simple Query Workflow
- Create the query and send it to the server using POST
.../query.
- Run the query using GET .../data.svc.
- Retrieve the query results using GET
.../data.svc/{flowName}.
The GET .../data.svc request actually runs the query on the query
engine, accesses the data source, and keeps the result set in memory. Consequently,
any further GET call retrieves the cached data without running the
query again.
Workflow for a Query With Contexts or Prompts
- Create the query and send it to the server using POST
.../query.
- Get the query parameters that need to be responded using GET
.../parameters.
- Respond to all of the parameters using PUT .../parameters.
- If all parameters have been answered and the query can be run, then a
successful message is returned.
- If not, the PUT call returns the parameters that remain
to be answered. Then, repeat PUT .../parameters until
all of the parameters get answers and a success status is returned.
- Run the query with the answered parameters using GET
.../data.svc.
- Retrieve the query results using GET
.../data.svc/{flowName}.
Remember The query execution returns an error message if not all of the
parameters have been answered.
Workflow for a Query With Different Parameter Values
You can run the same query mutiple times with different values for contexts or
parameters to get different result sets.
- Create the query and send it to the server using POST
.../query.
- Get the query parameters that need to be responded using GET
.../parameters.
- Respond to all of the parameters using PUT .../parameters until
all of them have been answered. Repeat the call if necessary.
- Run the query with the answered parameters using GET
.../data.svc.
- Retrieve the query results using GET
.../data.svc/{flowName}.
- Get the query parameters that need to be responded using GET
.../parameters.
Note Skip this step if the parameters have been
kept in memory.
- Respond to all of the parameters with new values using PUT
.../parameters until all of them have been answered. Repeat the
call if necessary.
- Run the query with the parameters answered in the previous step using
GET .../data.svc.
- Retrieve the query results using GET
.../data.svc/{flowName}.
On step 4, the query is run and the result set is saved in memory. On step 5, the
data is returned from the cache. On step 7, the call to PUT
.../parameters resets the cache. Some parameters are required to be
answered before the result set can be retrieved. On step 8, another call to
GET .../data.svc runs the query with the answers and saves the
new data set in the cache.