Coder Social home page Coder Social logo

dsntk-rs's People

Contributors

dariuszdepta avatar dsntk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dsntk-rs's Issues

Support for napi.rs

Hi @magick93,

I have recreated your issue according napi.rs support.

Could you provide an example of a use-case for such support? Do I understand it correctly, that you would like to embed a DMN runner in Node application?

Thanks in advance for your reply.

Number scientific notation

Implement the following grammar rule:

35. numeric literal = [ "-" ] , ( digits , [ ".", digits ] | "." , digits, [ ( "e" | "E" ) , [ "+" | "-" ] , digits ] ) ;

that introduces support for scientific notation for FEEL numbers.

Is there a way to use custom FEEL functions?

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!

Handle `for` box expression

	<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>

Handle `filter` box expression

	<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>

Handle `some` box expression

	<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>

Handle `every` box expression

        <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>

How to check in a decision table for and empty string?

Hi,

Sorry to bother :-)

I'm trying to check if a value is empty in a decision table. Like this:

image

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!!

Range literals

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` in model

Handle typeConstraint element in the model.

<xsd:complexType name="tItemDefinition">
    ...
         <xsd:element name="typeConstraint" type="tUnaryTests" minOccurs="0"/>
    ...
</xsd:complexType>

`GLIBC_2.32' not found

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

"dsntk is excessively stringent"

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.

test.json
test.txt
test_fixed.txt

Handle `q` flag in regular expressions

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()

Add scale to `ceiling` function

DMN 1.5 specification
Paragraph 10.3.4.5 Numeric functions
Table 76: Semantics of numeric functions

ceiling(n) ceiling(n,scale)

Handle `conditional` box expression

        <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>

Feature Request: DSL based approach to writing DMN

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.