private boolean isDoWhileTaskValid(
                WorkflowTask workflowTask, ConstraintValidatorContext context) {
            boolean valid = true;
            if (workflowTask.getLoopCondition() == null) {
                String message =
                        String.format(
                                PARAM_REQUIRED_STRING_FORMAT,
                                "loopExpression",
                                TaskType.DO_WHILE,
                                workflowTask.getName());
                context.buildConstraintViolationWithTemplate(message).addConstraintViolation();
                valid = false;
            }
            if (workflowTask.getLoopOver() == null || workflowTask.getLoopOver().size() == 0) {
                String message =
                        String.format(
                                PARAM_REQUIRED_STRING_FORMAT,
                                "loopover",
                                TaskType.DO_WHILE,
                                workflowTask.getName());
                context.buildConstraintViolationWithTemplate(message).addConstraintViolation();
                valid = false;
            }
            return valid;
        }
This constraint class validates following things. 1. Correct parameters are set depending on task
type.
core/src/main/java/com/netflix/conductor/validations/WorkflowTaskTypeConstraint.java