private boolean isTerminateTaskValid(
                WorkflowTask workflowTask, ConstraintValidatorContext context) {
            boolean valid = true;
            Object inputStatusParam =
                    workflowTask.getInputParameters().get(getTerminationStatusParameter());
            if (workflowTask.isOptional()) {
                String message =
                        String.format(
                                "terminate task cannot be optional, taskName: %s",
                                workflowTask.getName());
                context.buildConstraintViolationWithTemplate(message).addConstraintViolation();
                valid = false;
            }
            if (inputStatusParam == null || !validateInputStatus(inputStatusParam.toString())) {
                String message =
                        String.format(
                                "terminate task must have an %s parameter and must be set to COMPLETED or FAILED, taskName: %s",
                                getTerminationStatusParameter(), 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