VMware Cloud Community
pcas1943
Contributor
Contributor

Limit Submission Requests on Catalog Item

Is there a way to limit how many times an individual user can submit a particular catalog item? For example, if I have a quota of 10 machines on a catalog item, I don't want one user to request the same catalog item 10 times, thus preventing anyone else from requesting the item because of the quota limit.

What I am looking for is only allow the user to request one catalog item at a time. If they hit submit again on the same item, before the first request expires, the new request should get denied. If a second catalog item is present, but not yet requested, this second one can still be requested, even if the first item is still active. Is there a setting somewhere, or do I need to look into a custom workflow?

0 Kudos
1 Reply
rmav01
Enthusiast
Enthusiast

Out of the box nothing comes to mind in regards to what you're trying to accomplish. However, I believe you could achieve what you're looking for by doing two things:

1. Setup an approval policy based on an event subscription. This will allow you to bind a vRO workflow to make the decision as to whether or not the user can order the machine.

2. Within the approval workflow, do a live lookup across the requests by using something like vCACCAFEEntitiesFinder.findCatalogItemRequests(vCACCAFEHost host, String query) to find all interesting CatalogItemRequest objects. For each CatalogItemRequest look at fields like stateName or requestedBy to base your decision (true/false workflow return) as to whether the request is approved.

Having the approval policy based around a workflow would also set you up for more complex approval scenarios down the line.

0 Kudos