-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only verify FEEL expressions; warn that others are currently unsupported
Currently, `dmn-check` only supports analysis of FEEL expressions. With this commit the expression language that is specified in the DMN file is honored and a warning is issued for all other expression languages. Support for other expression languages is on the roadmap but with no schedule so far. This feature makes `dmn-check` useable if other expression languages are used in a DMN file, see issue #88. Closes issue #83.
- Loading branch information
Showing
21 changed files
with
441 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
validators/src/main/java/de/redsix/dmncheck/util/Expression.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package de.redsix.dmncheck.util; | ||
|
||
import org.camunda.bpm.model.dmn.impl.DmnModelConstants; | ||
import org.camunda.bpm.model.dmn.instance.LiteralExpression; | ||
import org.camunda.bpm.model.dmn.instance.UnaryTests; | ||
|
||
import java.util.Objects; | ||
|
||
public class Expression { | ||
|
||
public final String textContent; | ||
public final String expressionLanguage; | ||
|
||
public Expression(final UnaryTests unaryTests, final String toplevelExpressionLanguage) { | ||
this.textContent = unaryTests.getTextContent(); | ||
this.expressionLanguage = decideExpressionLanguage(unaryTests.getExpressionLanguage(), toplevelExpressionLanguage); | ||
} | ||
|
||
public Expression(final LiteralExpression literalExpression, final String toplevelExpressionLanguage) { | ||
this.textContent = literalExpression.getTextContent(); | ||
this.expressionLanguage = decideExpressionLanguage(literalExpression.getExpressionLanguage(), toplevelExpressionLanguage); | ||
} | ||
|
||
private String decideExpressionLanguage(final String localExpressionLanguage, final String toplevelExpressionLanguage) { | ||
return Objects.requireNonNullElseGet(localExpressionLanguage, | ||
() -> Objects.requireNonNullElse(toplevelExpressionLanguage, DmnModelConstants.FEEL_NS)); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
validators/src/main/java/de/redsix/dmncheck/util/TopLevelExpressionLanguage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package de.redsix.dmncheck.util; | ||
|
||
import org.camunda.bpm.model.dmn.instance.LiteralExpression; | ||
import org.camunda.bpm.model.dmn.instance.UnaryTests; | ||
|
||
public class TopLevelExpressionLanguage { | ||
|
||
public final String topLevelExpressionLanguage; | ||
|
||
public TopLevelExpressionLanguage(final String topLevelExpressionLanguage) { | ||
this.topLevelExpressionLanguage = topLevelExpressionLanguage; | ||
} | ||
|
||
public Expression toExpression(final UnaryTests unaryTests) { | ||
return new Expression(unaryTests, topLevelExpressionLanguage); | ||
} | ||
|
||
public Expression toExpression(final LiteralExpression literalExpression) { | ||
return new Expression(literalExpression, topLevelExpressionLanguage); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.