use of org.kie.kogito.process.validation.ValidationException in project kogito-runtimes by kiegroup.
the class ConnectionImpl method connect.
public void connect() {
try {
((Node) this.from).addOutgoingConnection(fromType, this);
((Node) this.to).addIncomingConnection(toType, this);
} catch (Exception exception) {
throw new ValidationException(null, exception.getMessage());
}
}
use of org.kie.kogito.process.validation.ValidationException in project kogito-runtimes by kiegroup.
the class ProcessValidator method validate.
default void validate(Process process) throws ValidationException {
final ProcessValidationError[] errors = validateProcess(process);
Optional.ofNullable(errors).filter(e -> e.length == 0).orElseThrow(() -> new ValidationException(process.getId(), Arrays.asList(errors)));
}