Search in sources :

Example 1 with ProcessValidatorFactory

use of org.flowable.validation.ProcessValidatorFactory in project plumdo-work by wengwh.

the class ModelValidationResource method validate.

@PostMapping(value = "/models/validate", name = "模型检查")
public List<ValidationError> validate(@RequestBody JsonNode body) {
    BpmnModel bpmnModel = new BpmnJsonConverter().convertToBpmnModel(body);
    ProcessValidator validator = new ProcessValidatorFactory().createDefaultProcessValidator();
    return validator.validate(bpmnModel);
}
Also used : ProcessValidatorFactory(org.flowable.validation.ProcessValidatorFactory) BpmnJsonConverter(org.flowable.editor.language.json.converter.BpmnJsonConverter) ProcessValidator(org.flowable.validation.ProcessValidator) BpmnModel(org.flowable.bpmn.model.BpmnModel) PostMapping(org.springframework.web.bind.annotation.PostMapping)

Aggregations

BpmnModel (org.flowable.bpmn.model.BpmnModel)1 BpmnJsonConverter (org.flowable.editor.language.json.converter.BpmnJsonConverter)1 ProcessValidator (org.flowable.validation.ProcessValidator)1 ProcessValidatorFactory (org.flowable.validation.ProcessValidatorFactory)1 PostMapping (org.springframework.web.bind.annotation.PostMapping)1