Validates fields used for building a global workflow.
    Since building a global workflow is done after all the underlying workflows
    are built, which may be time-consuming, we validate as much as possible here.
488373
def _validate_json_for_global_workflow(json_spec, args):
    
    # TODO: verify the billTo can build the workflow
    # TODO: if the global workflow build fails add an option to interactively change billto
    # TODO: (or other simple fields) instead of failing altogether
    # TODO: get a confirmation before building a workflow that may be costly
    if 'name' not in json_spec:
        raise WorkflowBuilderException(
            "dxworkflow.json contains no 'name' field, but it is required to build a global workflow")
    if not dxpy.executable_builder.GLOBAL_EXEC_NAME_RE.match(json_spec['name']):
        raise WorkflowBuilderException(
            "The name of your workflow must match /^[a-zA-Z0-9._-]+$/")
    if json_spec['name'] != json_spec['name'].lower():
        logger.warn('workflow name "{}" should be all lowercase'.format(json_spec['name']))

    if 'version' not in json_spec:
        raise WorkflowBuilderException(
            "dxworkflow.json contains no 'version' field, but it is required to build a global workflow")
    if not dxpy.executable_builder.GLOBAL_EXEC_VERSION_RE.match(json_spec['version']):
        logger.warn('"version" {} should be semver compliant (e.g. of the form X.Y.Z)'.format(json_spec['version']))

    if 'details' in json_spec:
        if not isinstance(json_spec['details'], dict):
            raise WorkflowBuilderException(
                'The field "details" must be a dictionary')

    if 'regionalOptions' in json_spec:
        if not (isinstance(json_spec['regionalOptions'], dict)
                and json_spec['regionalOptions']
                and all([isinstance(i, dict) for i in json_spec['regionalOptions'].values()])):
            raise WorkflowBuilderException(
                'The field "regionalOptions" must be a non-empty dictionary whose values are dictionaries')

    if args.bill_to:
        json_spec["billTo"] = args.bill_to
48990
private void validateWorkflow(WorkflowDef workflowDef, Map<String, Object> workflowInput, String externalStoragePath) {
        try {
            //Check if the input to the workflow is not null
            if (workflowInput == null && StringUtils.isBlank(externalStoragePath)) {
                LOGGER.error("The input for the workflow '{}' cannot be NULL", workflowDef.getName());
                throw new ApplicationException(INVALID_INPUT, "NULL input passed when starting workflow");
            }
        } catch (Exception e) {
            Monitors.recordWorkflowStartError(workflowDef.getName(), WorkflowContext.get().getClientApp());
            throw e;
        }
    }
52299
public function valid()
    {
        if (null === $this->getManagerName()) {
            $errMsg = 'No workflow manager';
            throw new Exception\InvalidArgumentException($errMsg);
        }

        if (null === $this->getActionName()) {
            $errMsg = 'Not Specified action for workflow';
            throw new Exception\InvalidArgumentException($errMsg);
        }

        $workflowActivity = $this->getRunType();
        if (!array_key_exists($workflowActivity, $this->allowWorkflowRunType)) {
            $errMsg = sprintf('Invalid activity %s', $workflowActivity);
            throw new Exception\InvalidArgumentException($errMsg);
        }

        if (static::WORKFLOW_RUN_INITIALIZE === $workflowActivity && null === $this->getWorkflowName()) {
            $errMsg = 'Not specified name workflow';
            throw new Exception\InvalidArgumentException($errMsg);
        }

        if (static::WORKFLOW_RUN_TYPE_DO_ACTION === $workflowActivity && null === $this->getEntryId()) {
            $errMsg = 'Not specified entryId';
            throw new Exception\InvalidArgumentException($errMsg);
        }
    }
1056379
private void validateFields() throws RepositoryConfigException {
        try {
            /*
             * Ontology file
             */
            if (owlFile
                    .filter(f -> !f.exists())
                    .isPresent()) {
                throw new RepositoryConfigException(String.format("The OWL file %s does not exist!",
                        owlFile.get().getAbsolutePath()));
            }
            if (owlFile
                    .filter(f -> !f.canRead())
                    .isPresent()) {
                throw new RepositoryConfigException(String.format("The OWL file %s is not accessible!",
                        owlFile.get().getAbsolutePath()));
            }

            /*
             * Mapping file
             */
            if (obdaFile == null) {
                throw new RepositoryConfigException(String.format("No mapping file specified for repository creation "));
            }
            if (!obdaFile.exists()) {
                throw new RepositoryConfigException(String.format("The mapping file %s does not exist!",
                        obdaFile.getAbsolutePath()));
            }
            if (!obdaFile.canRead()) {
                throw new RepositoryConfigException(String.format("The mapping file %s is not accessible!",
                        obdaFile.getAbsolutePath()));
            }

            /*
             * Properties file
             */

            if (propertiesFile == null) {
                throw new RepositoryConfigException(String.format("No properties file specified for repository creation "));
            }
            if (!propertiesFile.exists()) {
                throw new RepositoryConfigException(String.format("The properties file %s does not exist!",
                        propertiesFile.getAbsolutePath()));
            }
            if (!propertiesFile.canRead()) {
                throw new RepositoryConfigException(String.format("The properties file %s is not accessible!",
                        propertiesFile.getAbsolutePath()));
            }

            if (constraintFile.isPresent()) {
                File file = constraintFile.get();
                if (!file.exists()) {
                    throw new RepositoryConfigException(String.format("The implicit key file %s does not exist!",
                            file.getAbsolutePath()));
                }
                if (!file.canRead()) {
                    throw new RepositoryConfigException(String.format("The implicit key file %s is not accessible!",
                            file.getAbsolutePath()));
                }
            }
        }
        /*
         * Sometimes thrown when there is no access right to the files.
         */
        catch (SecurityException e) {
            throw new RepositoryConfigException(e.getMessage());
        }
    }
259266
@SuppressWarnings("unchecked")
    void validateResourceFields() {

        for (Component c : m_resources) {
            if (c instanceof CmsRemovableFormRow<?>) {
                ((CmsRemovableFormRow<CmsPathSelectField>)c).getInput().validate();
            }
        }
    }
514815
def validate(self):
        

        errors = {}

        for name, field in self.fields:
            try:
                field.validate(self._state.get(name))
            except Exception as e:
                errors[name] = e

        if len(errors) is not 0:
            raise Exception(errors)

        return True
748953
def validate(field_name = nil, options = nil, &block)
      if block
        # Setup a custom validation inside of the current validations block.
        if field_name || options
          fail 'validate should be passed a field name and options or a block, not both.'
        end
        @instance_custom_validations << block
      else
        @instance_validations[field_name] ||= {}
        @instance_validations[field_name].merge!(options)
      end
    end
432413
protected void validateFields() {
        for (int field = 0; field < fields.length; field++) {
            if (stamp[field] >= MINIMUM_USER_STAMP) {
                validateField(field);
            }
        }
    }
287428
def _build_or_update_workflow(json_spec, args):
    
    try:
        if args.mode == 'workflow':
            json_spec = _get_validated_json(json_spec, args)
            workflow_id = _build_regular_workflow(json_spec)
        elif args.mode == 'globalworkflow':
            # Verify if the global workflow already exists and if the user has developer rights to it
            # If the global workflow name doesn't exist, the user is free to build it
            # If the name does exist two things can be done:
            # * either update the requested version, if this version already exists
            # * or create the version if it doesn't exist
            existing_workflow = dxpy.executable_builder.verify_developer_rights('globalworkflow-' + json_spec['name'])
            if existing_workflow and _version_exists(json_spec,
                                                     existing_workflow.name,
                                                     existing_workflow.version):
                workflow_id = _update_global_workflow(json_spec, args, existing_workflow.id)
            else:
                json_spec = _get_validated_json(json_spec, args)
                workflow_id = _build_global_workflow(json_spec, args)
        else:
            raise WorkflowBuilderException("Unrecognized workflow type: {}".format(args.mode))
    except dxpy.exceptions.DXAPIError as e:
        raise e
    return workflow_id
1258658
final public function isValid($form)
    {
        $this->formValidatorExecutor->applyBehaviours();
        $this->formValidatorExecutor->checkFieldsActivation();

        $this->beforeValidationProcess();

        $this->formValidatorExecutor->validateFields(function (Field $field) {
            $this->callAfterFieldValidationMethod($field);
        });

        $this->afterValidationProcess();

        if ($this->result->hasErrors()) {
            // Storing the form for possible third party further usage.
            FormService::addFormWithErrors($form);
        }
    }
360975
public static List<String> validateInputParam(Map<String, Object> input, String taskName, WorkflowDef workflow) {
        ArrayList<String> errorList = new ArrayList<>();

        for (Entry<String, Object> e : input.entrySet()) {
            Object value = e.getValue();
            if (value instanceof String) {
                errorList.addAll(extractParamPathComponentsFromString(e.getKey(), value.toString(), taskName, workflow));
            } else if (value instanceof Map) {
                //recursive call
                errorList.addAll( validateInputParam((Map<String, Object>) value, taskName, workflow));
            } else if (value instanceof List) {
                errorList.addAll(extractListInputParam(e.getKey(), (List<?>) value, taskName, workflow));
            } else {
                e.setValue(value);
            }
        }
        return errorList;
    }
740993
protected function validateEditInstall()
    {
        $this->setSubmitted('settings');
        $this->setSubmitted('store.host', $this->server->httpHost());
        $this->setSubmitted('store.language', $this->install_language);
        $this->setSubmitted('store.basepath', trim($this->request->base(true), '/'));

        $this->validateComponent('install');

        return !$this->hasErrors(false);
    }
186335
function() {
    var self = this
    var validations = []

    return self
      .callInterceptors('beforeValidation', [self])
      .then(function() {
        for (var field in self.definition.validations) {
          var fieldValidations = self.definition.validations[field]

          // set the scope of all validator function to the current record
          for (var i in fieldValidations) {
            validations.push(fieldValidations[i].bind(self))
          }
        }
        return self.store.utils.parallel(validations)
      })
      .then(function(result) {
        if (self.errors.has) throw self.errors
      })
      .then(function() {
        return self.callInterceptors('afterValidation', [self])
      })
      .then(function() {
        return self
      })
  }
875225
protected function validateEditFieldValue()
    {
        $this->setSubmitted('field_value');
        $this->setSubmitted('update', $this->data_field_value);
        $this->setSubmitted('field_id', $this->data_field['field_id']);

        $this->validateComponent('field_value');

        return !$this->hasErrors();
    }
48993
def system_find_global_workflows(input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/system/findGlobalWorkflows', input_params, always_retry=always_retry, **kwargs)
137567
public boolean validateAllFields() {
        boolean cardNumberIsValid =
                CardUtils.isValidCardNumber(mCardNumberEditText.getCardNumber());
        boolean expiryIsValid = mExpiryDateEditText.getValidDateFields() != null &&
                mExpiryDateEditText.isDateValid();
        boolean cvcIsValid = isCvcLengthValid();
        mCardNumberEditText.setShouldShowError(!cardNumberIsValid);
        mExpiryDateEditText.setShouldShowError(!expiryIsValid);
        mCvcEditText.setShouldShowError(!cvcIsValid);
        boolean postalCodeIsValidOrGone;
        if (mShouldShowPostalCode) {
            postalCodeIsValidOrGone = isPostalCodeMaximalLength(true,
                    mPostalCodeEditText.getText().toString());
            mPostalCodeEditText.setShouldShowError(!postalCodeIsValidOrGone);
        } else {
            postalCodeIsValidOrGone = true;
        }

        return cardNumberIsValid
                && expiryIsValid
                && cvcIsValid
                && postalCodeIsValidOrGone;
    }
420689
private function validate()
    {
        if (!$this->cfg['validate']) {
            return true;
        }
        $formIsValid = true;
        foreach ($this->currentFields as $field) {
            $isValid = $field->validate();
            $formIsValid = $formIsValid && $isValid;
        }
        return $formIsValid;
    }