Search in sources :

Example 6 with BpmnJsonConverter

use of org.flowable.editor.language.json.converter.BpmnJsonConverter 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)6 BpmnJsonConverter (org.flowable.editor.language.json.converter.BpmnJsonConverter)6 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)5 FlowableException (org.flowable.engine.common.api.FlowableException)5 Model (org.flowable.engine.repository.Model)5 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)5 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)4 BpmnXMLConverter (org.flowable.bpmn.converter.BpmnXMLConverter)4 InputStream (java.io.InputStream)3 ByteArrayInputStream (java.io.ByteArrayInputStream)2 InputStreamReader (java.io.InputStreamReader)2 XMLInputFactory (javax.xml.stream.XMLInputFactory)2 XMLStreamReader (javax.xml.stream.XMLStreamReader)2 FlowableObjectNotFoundException (org.flowable.engine.common.api.FlowableObjectNotFoundException)2 Deployment (org.flowable.engine.repository.Deployment)2 ProcessDefinition (org.flowable.engine.repository.ProcessDefinition)2 Transactional (org.springframework.transaction.annotation.Transactional)2 ResponseStatus (org.springframework.web.bind.annotation.ResponseStatus)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 RepositoryService (org.flowable.engine.RepositoryService)1