Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.67.x-blue] Business Central UI gets stuck when saving any project's asset #3828

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ public Collection<DomainViolation> validate(final Diagram diagram,

final Reader[] aDMNXMLReaders = new Reader[]{};

final ClassLoader classLoader = getClassLoader(diagram);

final DMNValidator dmnValidator = getDmnValidator(classLoader);
final DMNValidator dmnValidator = getDmnValidator(diagram);

final List<DMNMessage> messages = dmnValidator
.validateUsing(DMNValidator.Validation.VALIDATE_MODEL,
Expand All @@ -148,17 +146,23 @@ public Collection<DomainViolation> validate(final Diagram diagram,
}
}

DMNValidator getDmnValidator(final ClassLoader classLoader) {
return DMNValidatorFactory.newValidator(classLoader, Collections.emptyList());
DMNValidator getDmnValidator(Diagram diagram) {
final ClassLoader classLoader = getClassLoader(diagram);

return classLoader != null ?
DMNValidatorFactory.newValidator(classLoader, Collections.emptyList()) :
DMNValidatorFactory.newValidator();
}

ClassLoader getClassLoader(final Diagram diagram) {
final Path path = diagram.getMetadata().getPath();
final WorkspaceProject project = workspaceProjectService.resolveProject(path);
final Module module = project.getMainModule();
final BuildHelper.BuildResult result = buildHelper.build(module);
final ClassLoader classLoader = ((InternalKieModule) result.getBuilder().getKieModuleIgnoringErrors()).getModuleClassLoader();
return classLoader;
if (result.getBuilder() != null) {
return ((InternalKieModule) result.getBuilder().getKieModuleIgnoringErrors()).getModuleClassLoader();
}
return null;
}

DMNValidator.ValidatorBuilder.ValidatorImportReaderResolver getValidatorImportReaderResolver(final Metadata metadata) {
Expand Down
Loading