Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -131,7 +131,7 @@ public boolean addOrRefreshModel(String name, final InputStream originalInputStr
return false;
}
if (!newWarnings.isEmpty()) {
logger.info("Validation issues found in DSL model '{}', using it anyway:\n{}", name,
logger.warn("Validation issues found in DSL model '{}', using it anyway:\n{}", name,

@lolodomo lolodomo Feb 14, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please keep the original log level.
We have a different log level for errors leading to model not being loaded and model being loaded but with warnings/tips.
With your change, everything will be a WARNING. And that would made the approach different from what was also done for YAML files.

String.join("\n", newWarnings));
}
} catch (IOException e) {
Expand Down Expand Up @@ -331,10 +331,12 @@ private boolean validateModel(String name, InputStream inputStream, List<String>

// Check for validation errors, but log them only
try {
String modelType = name.substring(name.lastIndexOf(".") + 1);
final org.eclipse.emf.common.util.Diagnostic diagnostic = safeEmf
.call(() -> Diagnostician.INSTANCE.validate(resource.getContents().getFirst()));
for (org.eclipse.emf.common.util.Diagnostic d : diagnostic.getChildren()) {
if (d.getSeverity() == org.eclipse.emf.common.util.Diagnostic.ERROR) {
if (d.getSeverity() == org.eclipse.emf.common.util.Diagnostic.ERROR
&& !"rules".equals(modelType) && !"script".equals(modelType)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the fix I have in mind.

For consistency with the other places in that file, I would rather suggest:

!"rules".equalsIgnoreCase(resource.getURI().fileExtension()) && 
!"script".equalsIgnoreCase(resource.getURI().fileExtension())

errors.add(d.getMessage());
} else {
warnings.add(d.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,4 +268,26 @@ public void testVars() {
Object x = context.getValue(QualifiedName.create("x"));
assertThat(x, is(15));
}

@Test
public void testRuleWithUntypedLambdaArgsDoesNotFailToLoad() {
Collection<Rule> rules = dslRuleProvider.getAll();
assertThat(rules.size(), is(0));

String model = """
var lambdaWithUntypedArgs = [ foo | foo ]
rule "RuleWithUntypedLambdaArgs"
when
System started
then
logInfo('Test', 'Test')
end
""";

modelRepository.addOrRefreshModel(TESTMODEL_NAME,
new ByteArrayInputStream(model.getBytes(StandardCharsets.UTF_8)));
Collection<Rule> actualRules = dslRuleProvider.getAll();

assertThat(actualRules.size(), is(1));
}
}