2 Replies Latest reply on Jan 2, 2013 5:39 PM by Rajiv Dewan

    RequestData Validation

    raraujo
      Hi,

      I want to validate the data of a request for a resource provisioning.

      I've done this successfully to create users.

      I did:
      requestData.getTargetEntities ();
      And here I got the form fields.

      Now, for the request to provision resource, the getTargetEntities() returns nothing.

      How do I get the request data in a provisioning request?

      My code:
      ---------
      public class ProvisionValidation implements RequestDataValidator {

      public void validate(RequestData requestData) throws InvalidRequestDataException {
      List<RequestEntity> requestEntities = requestData.getTargetEntities();
      if (requestEntities == null || requestEntities.isEmpty()) {
      System.out.println("requestEntities == null || requestEntities.isEmpty()"); <----------------
      }else{
      requestUtils = new RequestUtils(requestData);
      for (RequestEntity requestEntity : requestEntities) {
      List<RequestEntityAttribute> attributes = requestEntity.getEntityData();
      for (RequestEntityAttribute attribute : attributes) {
                          ...validations...
                          }
                     }
                }
           }
      }
      ---------------

      tks