Adding a validation process to a question
As an administrator, you need to validate user responses to notify your end users of input errors, prevent failures in processing requests, and to make sure users can successfully submit service requests. Use BMC Helix Innovation Studio processes to perform input validation and ensure that a user input satisfies specific criteria before you allow the user to move to the next step or service question.
You can add validation only to native BMC Helix Digital Workplace Catalog services and imported SRDs.
Scenario: Check whether a user exists in Active Directory before accepting a request to add a user to Active Directory
Scenario
Britney wants to add a user to Active Directory. Britney specifies the user name in the Add users in Active Directory service request. A validation process checks whether the given user account exists in Active Directory. If the account does not exist, validation is successful; Britney can submit the request to create the new user account. If the user account already exists, validation fails because the user cannot be added to Active DIrectory, and Britney receives an error message.
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.
Tip
If a user input contains leading or trailing spaces or both, the spaces are ignored during validation.
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.
Important
To learn how to create a sample process that validates a user input, see
Using the External Process Validation feature
on BMC Community.
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. |
Comments
Log in or register to comment.