Implementing Questionnaire Import and Workflow Generation
The Questionnaire Import SPI is a subset of the remote connector SPIs that a connector can implement to support business features of BMC Helix Digital Workplace Catalog beside the initial handshakes (descriptors, health checks) and actions (because each action is, in a way, specific to its connector).
Questionnaire Import
When importing catalog services, it is possible for BMC Helix Digital Workplace Catalog to generate an ad hoc workflow for that service and to import the associated questionnaire in a simple configuration:
- The service fulfillment can be triggered by one action of the same connector.
- It is possible to map questions or predefined variables to the required inputs of the fulfillment action.
If the connector also implements the Activity SPI for the fulfillment, BMC Helix Digital Workplace Catalog will be able to track its progress and adjust the service request status accordingly.
Note that there is no specific connector capability for this feature: it is an advanced usage of the "catalog provider" one. If a service exposes a fulfillment object with enough information, a wrapper workflow will be generated. If this fulfillment description also references a questionnaire, the questionnaire will also be imported and attached to the workflow.
Flow of Calls
Once a catalog administrator triggers the import of the items she selected, BMC Helix Digital Workplace Catalog will perform the following SPI calls against the corresponding connector and for each imported item:
- com.bmc.dsm.catalog:getService: to fetch the details of the service and perhaps of its fulfillment.
- com.bmc.dsm.catalog:findQuestionnaire: to fetch the description of the questionnaire, if the fulfillment details referenced such a questionnaire in the previous call.
Dependent Questions
Some dynamic multi-choice questions reference the answers to other questions within their qualification expressions. They are said "dependent". They allow to compose questionnaires, where selecting a question answer will help refining the available choices of the next questions.
It is possible to import such dependent questions by using operands of type "QUESTION_ANSWER" in the qualifications of the data lookups. Note that BMC Helix Digital Workplace Catalog will translate the question IDs provided by connectors to its own internal question IDs on questionnaire imports, while keeping these references consistent.
Here is an example of a response to a "com.bmc.dsm.catalog:findQuestionnaire" call:
"response": {
"questionnaires": [
{
"id": "933514f4-65cb-4861-b174-c92c55a13325",
"questionnaireElements": [
{
"format": "Dropdown",
"id": "country_question_id",
"name": "Country",
"description": null,
"required": false,
"hidden": false,
"readOnly": false,
"maxChars": null,
"fulfillmentInputId": "country_process_input",
"defaultValues": null,
"possibleValues": null,
"datasetId": "TABLE:Country",
"qualificationExpression": null
},
{
"format": "Dropdown",
"id": "state_province_question_id",
"name": "State / Province",
"description": null,
"required": false,
"hidden": false,
"readOnly": false,
"maxChars": null,
"fulfillmentInputId": "state_province_input",
"defaultValues": null,
"possibleValues": null,
"datasetId": "TABLE:StateProvince",
"qualificationExpression": {
"operator": "EQUALS",
"left": {
"type": "FIELD",
"fieldType": null,
"values": [],
"valueReference": "country_id",
"label": null,
"value": null
},
"right": {
// Reference to the answer of the previous question:
"type": "QUESTION_ANSWER",
"fieldType": null,
"values": [],
"valueReference": "country_question_id",
"label": null,
"value": null
},
"withParentheses": false
}
}
]
}
]
}
}