decisiontoolkit / dsntk-rs Goto Github PK
View Code? Open in Web Editor NEWDecision Toolkit written in Rust
License: Apache License 2.0
Decision Toolkit written in Rust
License: Apache License 2.0
Release initilal version v0.0.1 with full DMN 1.3 conformance.
Implement the following grammar rule:
35. numeric literal = [ "-" ] , ( digits , [ ".", digits ] | "." , digits, [ ( "e" | "E" ) , [ "+" | "-" ] , digits ] ) ;
that introduces support for scientific notation for FEEL numbers.
Some visual tools do not provide diagram size in DMN model. In such case it can be auto-discovered. Apply when exporting DMN model to HTML.
Hi!!
Very interesting project! Thanks for sharing.
I would like to know if I can define my own FEEL functions. For example, I would like to compare strings using fuzzy.
Thanks!
Add detailed error trace when a model can not be loaded during service startup.
Design DSL for test files and add templates for variables in particular.
<xsd:element name="for" type="tFor" substitutionGroup="expression"/>
<xsd:complexType name="tFor">
<xsd:complexContent>
<xsd:extension base="tIterator">
<xsd:sequence>
<xsd:element name="return" type="tChildExpression"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="filter" type="tFilter" substitutionGroup="expression"/>
<xsd:complexType name="tFilter">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<xsd:element name="in" type="tChildExpression"/>
<xsd:element name="match" type="tChildExpression"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="some" type="tQuantified" substitutionGroup="expression"/>
<xsd:complexType name="tQuantified">
<xsd:complexContent>
<xsd:extension base="tIterator">
<xsd:sequence>
<xsd:element name="satisfies" type="tChildExpression"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="every" type="tQuantified" substitutionGroup="expression"/>
<xsd:complexType name="tQuantified">
<xsd:complexContent>
<xsd:extension base="tIterator">
<xsd:sequence>
<xsd:element name="satisfies" type="tChildExpression"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
Hi,
Sorry to bother :-)
I'm trying to check if a value is empty in a decision table. Like this:
Providing the following data:
{
"legalName": ""
}
The result is "pass", so the condition of the second rule is not working. I have been trying other alternatives like matches(legalName, "[a-zA-Z]+")
but nothing seems to work.
Any Idea how to achieve it?
Thanks!!
Implement grammar rules:
66. range literal =
a. ( open range start | closed range start ) , range endpoint , ".." , range endpoint ( open range end | closed range end ) |
b. open range start , ".." , range endpoint ( open range end | closed range end ) |
c. ( open range start | closed range start ) , range endpoint , ".." , open range end ;
67. range endpoint = numeric literal | string literal | date time literal ;
Handle typeConstraint
element in the model.
<xsd:complexType name="tItemDefinition">
...
<xsd:element name="typeConstraint" type="tUnaryTests" minOccurs="0"/>
...
</xsd:complexType>
Hi!
Thanks for providing dsntk. I really liked dmntk and I am looking forward to using its successor.
However, I get an error when running the dsntk binary I downloaded from github:
$ dsntk-0.0.2-linux-ubuntu-x86_64
dsntk-0.0.2-linux-ubuntu-x86_64: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by dsntk-0.0.2-linux-ubuntu-x86_64)
dsntk-0.0.2-linux-ubuntu-x86_64: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by dsntk-0.0.2-linux-ubuntu-x86_64)
dsntk-0.0.2-linux-ubuntu-x86_64: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by dsntk-0.0.2-linux-ubuntu-x86_64)
Maybe one solution is to upgrade glibc but I would rather not fearing I might break other things. Another might be to upgrade Ubuntu to 22.04.3, but that's quite a bit of work.
I actually first tried installing through cargo, but that gave me errors for which I'll open a seperate issue.
Here is some info on my OS:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal
$ uname -r
5.10.16.3-microsoft-standard-WSL2
Hi!
I've made a simple DMN model in the modeler of Camunda 8 and parsing it with dsntk (or dmntk) gives an error:
$ dsntk pdm test.dmn
parsing model file failed with reason: <ModelParserError> expected mandatory child node 'variable' in parent node 'inputData' at [32:3]
I actually get this error for any model build in Camunda's modeler. (I do not get the error with models build in Trisotech's modeler or KIE's modeler associated with drools.) Manually adding the 'variable' node to the xml fixed the error and fixing a similar error results in file that can be parsed and evaluated by dsntk, but the output still a bit weird:
$ dsntk edm -i Positive test.json test_fixed.dmn
"null(context has no value for key 'False')"
I have contacted Camunda support about the issue and their response is:
Our engineers examined both the DMN 1.3 specification and the XML schema (XSD) for that specification.
According to the schema, the variable child node is not mandatory on Input Data elements based on minOccurs="0" value:<xsd:element name="inputData" type="tInputData" substitutionGroup="drgElement"/> <xsd:complexType name="tInputData"> <xsd:complexContent> <xsd:extension base="tDRGElement"> <xsd:sequence> <xsd:element name="variable" type="tInformationItem" minOccurs="0"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType>
In the context of Camunda DMN modeling solutions, the variable is not included.
In our view, dmntk is excessively stringent, requiring more than what is strictly necessary according to the DMN specification.
If you intend to use dmntk as your DMN engine, you can preprocess the DMN models generated in Camunda tools by adding the variable element where it is necessary. This can be accomplished via a simple XSLT script.
My main reason to post this issues to help the developers of dsntk and its users. Although a solution would be helpful for me, it's not very urgent.
I have attached the files with altered file extensions or github wouldn't let me.
round up
round down
round half up
round half down
Source: https://www.w3.org/TR/xpath-functions-31/
q: if present, all characters in the regular expression are treated as representing themselves, not as metacharacters. In effect, every character that would normally have a special meaning in a regular expression is implicitly escaped by preceding it with a backslash. Furthermore, when this flag is present, the characters $ and \ have no special significance when used in the replacement string supplied to the fn:replace function. This flag can be used in conjunction with the i flag. If it is used together with the m, s, or x flag, that flag has no effect.
Examples:
fn:tokenize("12.3.5.6", ".", "q") returns ("12", "3", "5", "6")
fn:replace("a\b\c", "", "\", "q") returns "a\b\c"
fn:replace("a/b/c", "/", "$", "q") returns "a$b$c"
fn:matches("abcd", ".*", "q") returns false()
fn:matches("Mr. B. Obama", "B. OBAMA", "iq") returns true()
DMN 1.5 specification
Paragraph 10.3.4.5 Numeric functions
Table 76: Semantics of numeric functions
ceiling(n) ceiling(n,scale)
<xsd:element name="conditional" type="tConditional" substitutionGroup="expression"/>
<xsd:complexType name="tConditional">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<xsd:element name="if" type="tChildExpression"/>
<xsd:element name="then" type="tChildExpression"/>
<xsd:element name="else" type="tChildExpression"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
I saw https://github.com/DecisionToolkit/dte, but I don't know if it's usable yet.
Are there any other editors that maintain the lines aligned when you make changes to the table?
DMN models provide an excellent way to visual describe decision logic.
However, when it comes to the DX of writing and reviewing changes in common git based workflows, it is not as good as code based approach.
The DMN ecosystem is, in general, lacking a good code first approach to writing DMN models.
The only contender I've found is https://github.com/powerflows/powerflows-dmn. However this has not had any updates for a few years. And, lacks the deliciousness of rust.
I'd be interested in hearing yours, and others, thoughts on this.
DMN 1.5 specification
Paragraph 10.3.4.5 Numeric functions
Table 76: Semantics of numeric functions
floor(n) floor(n,scale)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.