EdgeVerve / feel

Expression Language for creating and executing business rules in decision table based on DMN 1.1 specification for conformance level 3
MIT License
93 stars 48 forks source link

Names in a qualified name are separated by "->" instead of "." #9

Closed a-hegerath closed 6 years ago

a-hegerath commented 6 years ago

The the grammar file, the names of a qualified name are separated by "->":

QualifiedName
    = head:Name tail: (__ "->" __ Name)*
        {
             return new ast.QualifiedNameNode(buildList(head,tail,3),location());
        }

According to the DMN specification (FEEL production rule 20), it must be "." instead: qualified name = name , { "." , name } ;

raghav135 commented 6 years ago

The "." is part of "additional name symbols (rule 32)" which is a part of "name (rule 27)". "." is also part of "qualified name (rule 20)"

So, there is no way to tell if "a.b" is "name" or "qualified name".

So, to give an unambiguous way for "qualified name", we thought of giving "->".

The other option was to remove "additional name symbols (rule 32)". Thereby making "a.b" as "qualified name" always.

This is a known issue with FEEL grammar. http://issues.omg.org/issues/DMN12-111

I hope you are not facing any issue because of this. If you are happy with explanation, we can close this request.

a-hegerath commented 6 years ago

Sorry for the late reply! I had not been aware of the issue in the DMN specification. Your way of dealing with it fully makes sense, so I won't mind if you close this request. Maybe you could place a comment in the grammar source file and/or the documentation to explain the reason for the notation, in case anyone else stumbles upon this?

Since I am building a web application which evaluates DMN rule tables both in the Javascript frontend and in a Java backend, and the Java implementation of the rule engine which I use does not understand the "->" notation for qualified names, I will fork your implementation and adjust it to the needs of my application. Eventually, once that the FEEL grammar of DMN has been fixed, I can fully switch to your implementation. Anyway, you are doing a great job! Your implementation saved me a lot of time.

raghav135 commented 6 years ago

Thanks for the confirmation. Glad that you found the project good. Let us know if you have any other observations.