I'm trying to figure out if it's possible to validate input fields before executing a workflow. The scenario I have is provisioning a new virtual machine. The user must input both the VMname and the hostname prior to submitting the workflow. I have a couple of actions which will check to see if a VMname or hostname is already in use. What I want to be able to go is stop the user from submitting the workflow for execution if the names entered already exist. Is there a way I can do this?
Thanks
If the action returns an empty string (or null), this will be treated as successful validation.
Any non-empty string will be treated as failed validation, and the string value will be displayed as an error message in the workflow presentation wizard.
(If your action return type is not a string but something else, and you don't want to change it, you can construct OGNL expression in the custom validation property editor that will compare the result from GetAction().call() with the desired value and will return either empty string or error message string.)
Sure. There is a presentation properties "Custom Validation" for that. Just use it with an action checking if the name already exist or not.
Thanks for the reply. Does the action need to return something specific to make the custom validation work? Like a boolean true/false value?
If the action returns an empty string (or null), this will be treated as successful validation.
Any non-empty string will be treated as failed validation, and the string value will be displayed as an error message in the workflow presentation wizard.
(If your action return type is not a string but something else, and you don't want to change it, you can construct OGNL expression in the custom validation property editor that will compare the result from GetAction().call() with the desired value and will return either empty string or error message string.)