use of io.zeebe.model.bpmn.ValidationResult in project zeebe by zeebe-io.
the class DeploymentCreateProcessor method readAndValidateWorkflowsOfResource.
private boolean readAndValidateWorkflowsOfResource(final DeploymentResource deploymentResource, final DirectBuffer topicName, final StringBuilder validationErrors) {
final WorkflowDefinition definition = readWorkflowDefinition(deploymentResource);
final ValidationResult validationResult = bpmn.validate(definition);
final boolean isValid = !validationResult.hasErrors();
if (isValid) {
assignVersionToWorkflows(deploymentResourceIterator, topicName, definition);
transformWorkflowResource(deploymentResource, definition);
}
if (validationResult.hasErrors() || validationResult.hasWarnings()) {
validationErrors.append(String.format("Resource '%s':\n", bufferAsString(deploymentResource.getResourceName())));
validationErrors.append(validationResult.format());
}
return isValid;
}
Aggregations