{"record":{"id":"27d971df5334e6be","repo":"flowable/flowable-engine","slug":"no-process-validator-defined-27d971","errorCode":null,"errorMessage":"No process validator defined","messagePattern":"No process validator defined","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/ValidateBpmnModelCmd.java","lineNumber":39,"sourceCode":"import org.flowable.validation.ProcessValidator;\nimport org.flowable.validation.ValidationError;\n\n/**\n * @author Joram Barrez\n */\npublic class ValidateBpmnModelCmd implements Command<List<ValidationError>> {\n\n    protected BpmnModel bpmnModel;\n\n    public ValidateBpmnModelCmd(BpmnModel bpmnModel) {\n        this.bpmnModel = bpmnModel;\n    }\n\n    @Override\n    public List<ValidationError> execute(CommandContext commandContext) {\n        ProcessValidator processValidator = commandContext.getProcessEngineConfiguration().getProcessValidator();\n        if (processValidator == null) {\n            throw new ActivitiException(\"No process validator defined\");\n        }\n\n        return processValidator.validate(bpmnModel);\n    }\n\n}\n","sourceCodeStart":21,"sourceCodeEnd":46,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/ValidateBpmnModelCmd.java#L21-L46","documentation":"Thrown by ValidateBpmnModelCmd.execute() as ActivitiException when the engine configuration has no ProcessValidator configured (processEngineConfiguration.getProcessValidator() returns null) but validation is requested. Validation is an optional feature; without a validator there is nothing to run the BPMN model against.","triggerScenarios":"Calling ManagementService.executeCommand(new ValidateBpmnModelCmd(bpmnModel)) or repository-service deployment-time validation paths when processValidator was never set on the ProcessEngineConfiguration.","commonSituations":"Custom validation tooling invoking the command without configuring a ProcessValidatorFactory/validator bean; copying engine config from a minimal setup that omits the default validator; accidental removal of the processValidator property during configuration refactoring.","solutions":["Configure a validator: processEngineConfiguration.setProcessValidatorFactory(new DefaultProcessValidatorFactory()) (or setProcessValidator(...)) before starting the engine.","If using Spring, ensure the processValidatorFactory bean is defined so the engine config picks it up.","Alternatively validate without the engine: instantiate DefaultProcessValidatorFactory().createProcessValidator().validate(bpmnModel) directly.","Guard the call: check config.getProcessValidator() != null before executing ValidateBpmnModelCmd."],"exampleFix":"// before\nList<ValidationError> errors = managementService.executeCommand(new ValidateBpmnModelCmd(bpmnModel)); // no validator configured\n// after\nProcessEngineConfiguration cfg = processEngine.getProcessEngineConfiguration();\nif (cfg.getProcessValidator() == null) {\n    cfg.setProcessValidator(new DefaultProcessValidatorFactory().createProcessValidator());\n}\nList<ValidationError> errors = managementService.executeCommand(new ValidateBpmnModelCmd(bpmnModel));","handlingStrategy":"validation","validationCode":"if (processEngine.getProcessEngineConfiguration().getProcessValidator() == null) {\n    throw new IllegalStateException(\"Configure a ProcessValidator before validating BPMN models\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    return managementService.executeCommand(new ValidateBpmnModelCmd(bpmnModel));\n} catch (ActivitiException e) {\n    if (\"No process validator defined\".equals(e.getMessage())) {\n        ProcessValidator v = new DefaultProcessValidatorFactory().createProcessValidator();\n        return v.validate(bpmnModel); // validate outside the engine instead\n    }\n    throw e;\n}","preventionTips":["Set processValidatorFactory on the engine configuration in one shared config module","Prefer calling the validator directly instead of through the command when doing standalone checks","Assert validator presence in engine-configuration integration tests","Document that BPMN validation is opt-in and requires configuration"],"tags":["validation","configuration","bpmn"],"backgroundTag":"missing-required-config","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}