Implementing the Data Lookup Service Provider Interface
Tip
Click here to download the JSON (JavaScript Object Notation) snippets included in these topics, and customize them to use according to your requirements.
A host of features in BMC Digital Workplace Catalog rely on connectors exposing data by lookup:
- Ability to populate the possible answers of a multi-choice question (e.g. drop-down or radio button question).
- Ability to assign a value to an answer by performing a data lookup and using fields of the result (i.e. "questionnaire actions").
These features are based on three possible capabilities of connectors.
Dataset Provider
Capability:
com.bmc.dsm.catalog:datasetProvider
Simple datasets are lists of records, each of which has one predetermined display value and one predetermined data value. How the display value or the data value of each dataset is defined is hard-coded in the connector.
Queryable Dataset Provider
Capability:
com.bmc.dsm.catalog:queryableDatasetProvider
This capability supports both cabilities:
- Populate multi-choice questions (called "map to form" in the admin "Questions" UI).
- Perform answer prefills based on data lookups (called "Actions" in the admin "Questions" UI).
For populating multi-choice questions, enable BMC Digital Workplace Catalog to query a table-like source while allowing its administrators to pick:
- The field that will be the display value
- The field that will be the data value
Both fields will be passed along with the request for the dataset items (see "SPI" below).
For the answer prefill, BMC Digital Workplace Catalog will use the same API to retrieve the data and will assign the returned values to the mapped answer.
Table Dataset Provider
Capability:
com.bmc.dsm.catalog:tableDatasetProvider
This capability is an enhancement over queryable dataset providers. It allows BMC Digital Workplace Catalog to retrieve the values of many fields of a dataset at the same time (instead of just a couple through the queryable dataset provider SPI). Implementing this interface can make the request checkout experience more responsive for some complex service questionnaires. It is also leveraged by dynamic table questions.
All table dataset providers are considered queryable dataset providers as well and should implement the corresponding SPI.
Dataset Fields
Queryable dataset providers and table dataset providers need must expose a list of fields on each queryable dataset. These fields are available to the catalog administrator or to BMC Digital Workplace Catalog to perform queries.
By default, dataset fields are considered to be textual. This makes the development of the capability easier in many cases. However, for table questions, providing a type will enhance the experience of requesters by allowing proper formatting and sorting in the UI. Here are the supported types:
- TEXT
DATETIME
DATE
TIME
SELECTION (predefined enumeration)
INTEGER
DECIMAL
CURRENCY (money amount)
Note that the values of the dataset fields are still transferred as strings, disregarding these declared types. In particular, integers or decimals are transferred as strings e.g. "123"
or 123.45
. Text and selection values are naturally textual. Refer to Principles of the Remote Connector Service Provider Interface for the formatting of dates, times, date-times and currency values.
SPI
Dataset providers, queryable dataset providers and table dataset providers implement the same general end-points, but request/response properties may differ for each depending on the use case.
| |
---|---|
Lists all the datasets exposed by the connector. | |
request |
|
response |
|
| |
---|---|
Returns the details of a specified dataset. | |
request |
|
simple dataset response |
|
queryable or table dataset response |
|
response properties | datasets.fields: Array of the fields of this queryable dataset. The BMC Digital Workplace Catalog administrator |
| |
---|---|
Finds and returns the dataset items corresponding to the specified criteria. | |
simple dataset request |
|
queryable dataset request |
|
table dataset request |
|
simple or queryable dataset response |
The items.id and items.name properties are always expected and correspond to either what is hard-coded in the connector (simple dataset) |
table dataset response |
Here, the properties of the "items" property are the selection of fields specified in the request through the "fieldIds" property. |
response properties | datasets.items: Array of the found items. |
Comments
Log in or register to comment.