-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type inference in DMN context <result> row causes error message for decision tables with single output column #356
Comments
Maybe related - somehow - with #956 |
This may need to be retested. There were some big changes in the backend internals. |
@gitgabrio @baldimir I took a look into this issue, and we don't have the error anymore, but we still have a [
{
"severity": "WARN",
"message": "Decision table with single output on node 'Test' should not have output name",
"messageType": "ILLEGAL_USE_OF_NAME",
"sourceId": "_F1544A23-3026-42D3-892F-1B31E5015E77",
"path": "Untitled.dmn",
"level": "WARNING"
},
{
"severity": "INFO",
"message": "Decision Table Analysis of table '[ID: _D6E81FEB-748D-4D56-ADAA-AC7F49ECF00D]' finished with no messages to be reported.",
"messageType": "DECISION_TABLE_ANALYSIS_EMPTY",
"sourceId": "_D6E81FEB-748D-4D56-ADAA-AC7F49ECF00D",
"path": "Untitled.dmn",
"level": "INFO"
}
] Here is my model: "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<definitions xmlns=\"https://www.omg.org/spec/DMN/20230324/MODEL/\" expressionLanguage=\"https://www.omg.org/spec/DMN/20230324/FEEL/\" namespace=\"https://kie.org/dmn/_4D000131-E639-460F-B996-88331CA47A6F\" id=\"_15514F0E-9BDE-4624-B6A9-35700B01D028\" name=\"DMN_91FB6F98-CB1A-4441-B6B5-3CF0C30E61AF\" xmlns:dmndi=\"https://www.omg.org/spec/DMN/20230324/DMNDI/\" xmlns:dc=\"http://www.omg.org/spec/DMN/20180521/DC/\" xmlns:di=\"http://www.omg.org/spec/DMN/20180521/DI/\" xmlns:kie=\"https://kie.org/dmn/extensions/1.0\">\n <decision name=\"Test\" id=\"_815A1579-9315-4D33-8487-1C17096CCA1F\">\n <variable name=\"Test\" id=\"_DBA825F5-E8BC-40B5-A217-CEB5E0D87F63\" typeRef=\"string\" />\n <context id=\"_B817F558-6A5E-4569-B9F4-61E3BCAA747A\" typeRef=\"string\" label=\"Test\">\n <contextEntry id=\"_D79D26A9-10F5-43C8-B6D0-BB112F84006C\">\n <variable id=\"_CB57EFDA-FAA8-4B89-8108-25E6E12B0598\" name=\"my variable\" typeRef=\"boolean\" />\n <literalExpression id=\"_09FE31EE-475C-4E05-A72F-E20ABE629831\" typeRef=\"boolean\" label=\"my variable\">\n <text>false</text>\n </literalExpression>\n </contextEntry>\n <contextEntry id=\"_0295D981-61B8-4A8D-BC27-A8D805C10F46\">\n <decisionTable id=\"_D6E81FEB-748D-4D56-ADAA-AC7F49ECF00D\" typeRef=\"string\" hitPolicy=\"UNIQUE\" label=\"Test\">\n <input id=\"_B5C80D99-B558-48E5-B2ED-35E05D6A18AC\">\n <inputExpression id=\"_F6BE08C2-4BB7-4270-8371-2F429BF3E522\" typeRef=\"boolean\">\n <text>my variable</text>\n </inputExpression>\n </input>\n <output id=\"_F1544A23-3026-42D3-892F-1B31E5015E77\" name=\"Output-1\" />\n <annotation name=\"Annotations\" />\n <rule id=\"_62D16F37-CE2F-4F4F-9FD7-6DEC3CD5695E\">\n <inputEntry id=\"_56D9A376-EC13-4BF2-94C4-096A369343D3\">\n <text>false</text>\n </inputEntry>\n <outputEntry id=\"_7152FDC9-EE89-4A70-89DF-D14C984FDB0B\">\n <text>"aaaa"</text>\n </outputEntry>\n <annotationEntry>\n <text>// Your annotations here</text>\n </annotationEntry>\n </rule>\n <rule id=\"_1D26E836-A943-4C4C-BC3B-D3847F135135\">\n <inputEntry id=\"_B850454F-85BA-4C72-85C4-97D43B9DCF68\">\n <text>true</text>\n </inputEntry>\n <outputEntry id=\"_FC43F5D6-5E92-4F27-80B1-E2195F37F35D\">\n <text>"bbbb"</text>\n </outputEntry>\n <annotationEntry>\n <text></text>\n </annotationEntry>\n </rule>\n </decisionTable>\n </contextEntry>\n </context>\n </decision>\n <dmndi:DMNDI>\n <dmndi:DMNDiagram id=\"_DC68F5AC-F362-4AA2-93A3-A7802FB033EB\" name=\"Default DRD\" useAlternativeInputDataShape=\"false\">\n <di:extension>\n <kie:ComponentsWidthsExtension>\n <kie:ComponentWidths dmnElementRef=\"_B817F558-6A5E-4569-B9F4-61E3BCAA747A\">\n <kie:width>120</kie:width>\n </kie:ComponentWidths>\n <kie:ComponentWidths dmnElementRef=\"_09FE31EE-475C-4E05-A72F-E20ABE629831\">\n <kie:width>190</kie:width>\n </kie:ComponentWidths>\n <kie:ComponentWidths dmnElementRef=\"_D6E81FEB-748D-4D56-ADAA-AC7F49ECF00D\">\n <kie:width>60</kie:width>\n <kie:width>118</kie:width>\n <kie:width>118</kie:width>\n <kie:width>240</kie:width>\n </kie:ComponentWidths>\n </kie:ComponentsWidthsExtension>\n </di:extension>\n <dmndi:DMNShape id=\"_4ED4E9BD-4A3E-4B24-926E-139ED6F3DEDA\" dmnElementRef=\"_815A1579-9315-4D33-8487-1C17096CCA1F\" isCollapsed=\"false\" isListedInputData=\"false\">\n <dc:Bounds x=\"360\" y=\"0\" width=\"160\" height=\"80\" />\n </dmndi:DMNShape>\n </dmndi:DMNDiagram>\n </dmndi:DMNDI>\n</definitions>\n" |
@ljmotta I'll take a look and report back |
@ljmotta @baldimir @yesamer From the specs
So, the model you provided is actually invalid. In the current version of jitexecutor, we set the validation mode to strict, so that model validation should fail. I think the sandbox is still using the old, "permissive" version. |
@gitgabrio Thanks for the pointers. I've created #1466 for the validation Regarding the |
See this discussion at zulipchat.
in the DMNEvaluator compiler, https://github.com/kiegroup/drools/blob/053ca95475b0b51f2a9b8ee9f08a54b01d389140/kie-dmn/kie-dmn-core/src/main/java/org/kie/dmn/core/compiler/DMNEvaluatorCompiler.java#L819-L858
when a decision table of 1 output, is nested in the result context entry of a boxed context which is the body of a boxed function definition, it is not possible to infer the type and the compilation error is returned.
the reproducer shows a boxed function definition in a context entry of a boxed context, which is only partially relevant.
the function definition defines as body a boxed context, and a decision table of 1 output, as the body's boxed context final result entry, reproducing the compiler error.
it is likely reproducible also for a boxed function definition directly nested in a decision node (albeit not best practice either).
reproducer.zip
Acceptance criteria:
The text was updated successfully, but these errors were encountered: