MarkCrossley
Enthusiast
Enthusiast

vCAC 6 Advanced Service Blueprint: Validating form fields

I am trying to validate a ASD form field in vCO. Basically to perform the form validation I have to know the requesting users account name.

I want to return a list of permitted values for a field based on the users access rights to certain objects. I have the validation being called correctly and returning test values, but I cannot complete the code without the users account details.

Once the work flow 'runs' then I can use System.getContext().getParameter('__asd_requestedBy') to get the requesting users UPN, but at the validation stage this variable does not seem to set.

I looked at Server.getRunningUser() but that just gives me the vCAC Cafe user.

So is there any mechanism for retrieving the requesting users name during validation?

0 Kudos
10 Replies
willonit
Hot Shot
Hot Shot

I don't believe there is a way to do any user interaction with vCAC ASD workflows. So it can not populate the fields based on the user that is requesting the service before the request has been submitted. You would have to give all the options to the user then check if the requested user is allowed access to the object they selected and throw an error if they can't.

MarkCrossley
Enthusiast
Enthusiast

Thanks but we have already ruled that out for a couple of reasons.

First it really sucks as a 'user experience' - just complete this long complicated form, then submit it and wait for a response to see if you have made a mistake, and by the way you'll have to type it all in again if it is rejected; and secondly, it is for a secure environment where one user is not even allowed to view the names of another users objects.

0 Kudos
willonit
Hot Shot
Hot Shot

I agree. Hopefully that kind of functionality will be expanded in a future release. Best of luck.

0 Kudos
willonit
Hot Shot
Hot Shot

Mark,

This may be so much work that it isn't worth it, but could you create different services for different groups of users that have the appropriate fields and use entitlements to only allow certain users to see certain services and therefore certain drop downs? Its definitely not ideal by any stretch but might be closer to what you are trying to achieve. You would have to have a separate workflow for each scenario though. Or at least a wrapper workflow for each scenario that feeds input into the real workflow. Not sure how complicated your use case it. This may not work. Just a thought.

0 Kudos
qc4vmware
Virtuoso
Virtuoso

I had a similar complaint in another thread.  Pretty ridiculous not to have that available.  I believe I opened up a ticket and called it a bug.  I urge everyone to do the same along with complaining in the forums.

0 Kudos
MarkCrossley
Enthusiast
Enthusiast

Thanks, but again not really practical, we would end up with hundreds of additional services once the solution scales up. The catalog sprawl will be bad enough as it is.

0 Kudos
MarkCrossley
Enthusiast
Enthusiast

I have now hit a similar problem, you cannot access the provisioning group name during validation either. I need to pre-populate a form field with a list of the users added to the group - no can do as far as I can see.

0 Kudos
maverix7
VMware Employee
VMware Employee

Mark, this is possible since vCAC 6.1. It is available as part of the ASD form context, a "Request Info" that you can bind your form fields to. So if you have a vCO workflow with a placeholder field for the requester, in ASD you can bind information from the "Request Info - Requested By" object to this field. It provides more flexibility over the global "__asd_**" variables and are available prior workflow execution.

You can see this post for more info and give it a try - Passing requester details to vCO presentation from ASD blueprint / resource action | Tony's Blog 2.0

0 Kudos
SeanKohler
Expert
Expert

You can also now call vRO actions directly from an ASD form field using "External."

I know it doesn't specifically meet your needs in that you are asking for the UPN for use in the VCO workflow during form validation, but it may help you to think of ways around how you are attempting validation pre-runtime.  I really like that there is this "direct" capability, but it sort of bittersweet because it could mean a departure from supporting vRO presentation mechanisms.  (some of which do not work when the presentation/form is loaded through ASD)

I do not know how your are building your form validation, but for example... you could call an action that validates an owner based on current requestor, and it returns a Boolean on a hidden field.  The True/False condition would be available to vRO during presentation and you could update the form accordingly.  (e.g. state, "You are not authorized to update this machine")  Here is an image that may help...

Good luck.

ASDRequestor2.jpg

0 Kudos
SeanKohler
Expert
Expert

>>I have now hit a similar problem, you cannot access the provisioning group name during validation either. I need to pre-populate a form field with a list of the users added to the group - no can do as far as I can see.

What do you mean by provisioning group?  We are loading users based on Active Directory group and Business Group on-form-load in an ASD form.  One can also update the list based on form item selection (field input), which behaves as a form reload. I can possibly help you with either scenario.... just need more detail.  It may be required to go a different route to get a similar result.  (And of course, I may just not understand the ask... and then I would run into the same roadblock you have found.)

Are you doing a Service Blueprint or a Resource Action? (matters for available bind types)

How are you trying to bind data to the form?  What are your inputs?

Version of vRA (VCAC)?

GroupList.jpg

0 Kudos