Adding a validation process to a question
Scenario: Check whether a user exists in Active Directory before accepting a request to add a user to Active Directory
How validation works in the following scenarios
When External Validation is enabled with other settings, such as Regular Expression or Default Value, the processing is done as described below:
- Regular Expression (regex) is enabled: For a required question, if the input passes the regex validation, it is then sent to the validation process. The input is not sent for further validation if the regex validation fails. For example, to check whether an email address exists in Active Directory, you use a regular expression to check if the address is valid. After you confirm it's a valid address, you use a validation process to check whether it exists in Active Directory..
- Actions are specified: Values are populated only if the validation is successful. To learn more about actions, see "About actions that trigger default responses' in Creating-questions-with-default-responses.
- Default Value is configured: If external validation is enabled, the default value is validated in BMC Helix Digital Workplace Catalog. For more information, see Creating-questions-with-default-responses.
Process overview
- Create a BMC Helix Innovation Studio process to validate a user input for your use case and ensure that the process executes as expected.
- Create a service and integrate the validation process with the service questionnaire:
- Add a Text Field or Text Area type of question to the questionnaire.
- Enable external validation for the question.
- Select the process that will validate a user's response to the question.
Before you begin
Create both of the following items:
- A service, as described in Adding-and-updating-services.
- A workflow for service fulfillment, as described in Workflows-for-service-fulfillment.
To create a process to validate user input
Create a validation workflow in BMC Helix Digital Workplace Catalog.
- Log in to BMC Helix Innovation Studio as an administrator.
- On the Workspace tab, click Digital Workplace Catalog.
- On the Processes tab, click Manage Processes.
Search for and select your validation process and click Run.
Test the process in isolation to make sure the process works as expected when it executes in a questionnaire. For more information, see Viewing and managing process execution.
To map a validation process to a service question
- In the Catalog console, open the service, and its questionnaire.
- In the Questions Designer, add a question.
- From the Form element type list, select Text Field or Text Area.
- In the Label field, enter the text of the question prompt that is displayed to the user
- Enable External Validation for the question.
- Click Map to process and select the process you want to use for the response validation.
- In Process input variable, select the process input for which you added the question.
The user's response to the question is passed as an input to the process for validation.
Only text and integer data type process inputs appear in the Process input variable list. If the process has a required input, only that input appears in the list. In Error State, specify the error message to be displayed to the user if validation fails.
- Add other questions as needed.
- Save the service configuration.
Troubleshooting
The following table describes common problems and steps to resolve them:
Scenarios | Steps to resolve |
---|---|
The selected workflow is incompatible and cannot be mapped to the question. | Make sure the process has at least one text or integer process input. |
Although the process contains other types of variables, the Process Input variable list displays only text or integer process inputs. | External validation is available only for text and integer process inputs. |
The validation process does not work as expected. |
|
The validation process times out. | The default validation process timeout is configured for five seconds in BMC Helix Innovation Studio. If required, you can increase it up to 30 seconds. The minimum supported value is one second. To edit the validation process timeout, follow the steps:
|
Validation appears disabled after a service with process validation is imported from another environment. | Clear the browser cache and reload the page. |