private boolean isDecisionTaskValid(
                WorkflowTask workflowTask, ConstraintValidatorContext context) {
            boolean valid = true;
            if (workflowTask.getCaseValueParam() == null
                    && workflowTask.getCaseExpression() == null) {
                String message =
                        String.format(
                                PARAM_REQUIRED_STRING_FORMAT,
                                "caseValueParam or caseExpression",
                                TaskType.DECISION,
                                workflowTask.getName());
                context.buildConstraintViolationWithTemplate(message).addConstraintViolation();
                valid = false;
            }
            if (workflowTask.getDecisionCases() == null) {
                String message =
                        String.format(
                                PARAM_REQUIRED_STRING_FORMAT,
                                "decisionCases",
                                TaskType.DECISION,
                                workflowTask.getName());
                context.buildConstraintViolationWithTemplate(message).addConstraintViolation();
                valid = false;
            } else if ((workflowTask.getDecisionCases() != null
                            || workflowTask.getCaseExpression() != null)
                    && (workflowTask.getDecisionCases().size() == 0)) {
                String message =
                        String.format(
                                "decisionCases should have atleast one task for taskType: %s taskName: %s",
                                TaskType.DECISION, workflowTask.getName());
                context.buildConstraintViolationWithTemplate(message).addConstraintViolation();
                valid = false;
            }

            if (workflowTask.getCaseExpression() != null) {
                try {
                    validateScriptExpression(
                            workflowTask.getCaseExpression(), workflowTask.getInputParameters());
                } catch (Exception ee) {
                    String message =
                            String.format(
                                    ee.getMessage() + ", taskType: DECISION taskName %s",
                                    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