Search in sources :

Example 1 with ValidationError

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

the class ModelValidationResource method validate.

@RequestMapping(value = "/models/validate", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
public List<ValidationError> validate(@RequestBody JsonNode body) {
    BpmnModel bpmnModel = new BpmnJsonConverter().convertToBpmnModel(body);
    ProcessValidator validator = new ProcessValidatorFactory().createDefaultProcessValidator();
    List<ValidationError> errors = validator.validate(bpmnModel);
    return errors;
}
Also used : ProcessValidatorFactory(org.flowable.validation.ProcessValidatorFactory) ValidationError(org.flowable.validation.ValidationError) BpmnJsonConverter(org.flowable.editor.language.json.converter.BpmnJsonConverter) ProcessValidator(org.flowable.validation.ProcessValidator) BpmnModel(org.flowable.bpmn.model.BpmnModel) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

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 ValidationError (org.flowable.validation.ValidationError)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1