Skip to content
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

[incubator-kie-issues#854] DMN - Add implicit type conversion of date to date and time when necessary #5664

Merged
merged 19 commits into from
Feb 7, 2024

Conversation

gitgabrio
Copy link
Contributor

Fixes apache/incubator-kie-issues#854

Add an implicit date to date and time conversion in DMN FEEL evaluation, based on this rule:
"When the type of the expression is date and the target type is date and time, the expression is converted to a date time value in which the time of day is UTC midnight (00:00:00)."

Acceptance criteria:

Implicit conversion is implemented in FEEL expressions, where date is used as the input type of the expression and the result needs to be date and time.
New code is 100% covered with tests.

Notes:

  1. it is not possible to modify the FEELFunction itself because it does not receive the required type; so, conversion is executed inside DMNContextEvaluator
  2. currently only LocalDate are transformed, and generated object is a ZonedDateTime
  3. small refactoring of DMNContextEvaluator has been done to improve test coverage
How to replicate CI configuration locally?

Build Chain tool does "simple" maven build(s), the builds are just Maven commands, but because the repositories relates and depends on each other and any change in API or class method could affect several of those repositories there is a need to use build-chain tool to handle cross repository builds and be sure that we always use latest version of the code for each repository.

build-chain tool is a build tool which can be used on command line locally or in Github Actions workflow(s), in case you need to change multiple repositories and send multiple dependent pull requests related with a change you can easily reproduce the same build by executing it on Github hosted environment or locally in your development environment. See local execution details to get more information about it.

How to retest this PR or trigger a specific build:
  • for pull request checks
    Please add comment: Jenkins retest this

  • for a specific pull request check
    Please add comment: Jenkins (re)run [drools|kogito-runtimes|kogito-apps|kogito-examples] tests

  • for a full downstream build

    • for jenkins job: please add comment: Jenkins run fdb
    • for github actions job: add the label run_fdb
  • a compile downstream build please add comment: Jenkins run cdb

  • an upstream build please add comment: Jenkins run upstream

  • for quarkus branch checks
    Run checks against Quarkus current used branch
    Please add comment: Jenkins run quarkus-branch

  • for a quarkus branch specific check
    Run checks against Quarkus current used branch
    Please add comment: Jenkins (re)run [drools|kogito-runtimes|kogito-apps|kogito-examples] quarkus-branch

  • for quarkus main checks
    Run checks against Quarkus main branch
    Please add comment: Jenkins run quarkus-main

  • for a specific quarkus main check
    Run checks against Quarkus main branch
    Please add comment: Jenkins (re)run [drools|kogito-runtimes|kogito-apps|kogito-examples] quarkus-main

  • for quarkus lts checks
    Run checks against Quarkus lts branch
    Please add comment: Jenkins run quarkus-lts

  • for a specific quarkus lts check
    Run checks against Quarkus lts branch
    Please add comment: Jenkins (re)run [drools|kogito-runtimes|kogito-apps|kogito-examples] quarkus-lts

  • for native checks
    Run native checks
    Please add comment: Jenkins run native

  • for a specific native check
    Run native checks
    Please add comment: Jenkins (re)run [drools|kogito-runtimes|kogito-apps|kogito-examples] native

  • for native lts checks
    Run native checks against quarkus lts branch
    Please add comment: Jenkins run native-lts

  • for a specific native lts check
    Run native checks against quarkus lts branch
    Please add comment: Jenkins (re)run [drools|kogito-runtimes|kogito-apps|kogito-examples] native-lts

How to backport a pull request to a different branch?

In order to automatically create a backporting pull request please add one or more labels having the following format backport-<branch-name>, where <branch-name> is the name of the branch where the pull request must be backported to (e.g., backport-7.67.x to backport the original PR to the 7.67.x branch).

NOTE: backporting is an action aiming to move a change (usually a commit) from a branch (usually the main one) to another one, which is generally referring to a still maintained release branch. Keeping it simple: it is about to move a specific change or a set of them from one branch to another.

Once the original pull request is successfully merged, the automated action will create one backporting pull request per each label (with the previous format) that has been added.

If something goes wrong, the author will be notified and at this point a manual backporting is needed.

NOTE: this automated backporting is triggered whenever a pull request on main branch is labeled or closed, but both conditions must be satisfied to get the new PR created.

@gitgabrio
Copy link
Contributor Author

Reopen of #5657

@kie-ci3
Copy link

kie-ci3 commented Jan 24, 2024

PR job #1 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-drools/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-drools -u #5664 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-5664/1/display/redirect

Test results:

  • PASSED: 21874
  • FAILED: 3

Those are the test failures:

org.kie.dmn.core.DMNRuntimeTest.testDateAndTime[false] expected:<...me"=2015-12-24T00:00[Z (java.time.Zoned]DateTime), "fromYear...> but was:<...me"=2015-12-24T00:00[ (java.time.Local]DateTime), "fromYear...>
org.kie.dmn.core.DMNStronglyTypedSupportTest.testDateAndTime[KIE_API_TYPECHECK] expected:<...me.LocalDate), "from[]YearMonthDay"=1999-1...> but was:<...me.LocalDate), "from[StringToDateTime"=2015-12-24T00:00 (java.time.LocalDateTime), "from]YearMonthDay"=1999-1...>
org.kie.dmn.core.DMNStronglyTypedSupportTest.testDateAndTime[BUILDER_DEFAULT_NOCL_TYPECHECK] expected:<...me.LocalDate), "from[]YearMonthDay"=1999-1...> but was:<...me.LocalDate), "from[StringToDateTime"=2015-12-24T00:00 (java.time.LocalDateTime), "from]YearMonthDay"=1999-1...>

@tarilabs tarilabs removed their request for review January 25, 2024 07:28
Copy link
Member

@tarilabs tarilabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I already commented per #5657 (comment) same comments apply here

@@ -138,6 +142,17 @@ public CompiledExpression compileFeelExpression(DMNCompilerContext ctx, String e
feelctx.addInputVariableType( entry.getKey(), ((BaseDMNTypeImpl) entry.getValue()).getFeelType() );
}
feelctx.setFEELTypeRegistry(model.getTypeRegistry());
// TODO: EXPERIMENT
String baseExpression = expression.contains("(") ? expression.substring(0, expression.indexOf("(")) : expression;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in-memory date to date time expression-string conversion

@kie-ci3
Copy link

kie-ci3 commented Jan 25, 2024

PR job #2 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-drools/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-drools -u #5664 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-5664/2/display/redirect

Test results:

  • PASSED: 21898
  • FAILED: 3

Those are the test failures:

org.kie.dmn.core.DMNRuntimeTest.testDateAndTime[false] expected:<...me"=2015-12-24T00:00[Z (java.time.Zoned]DateTime), "fromYear...> but was:<...me"=2015-12-24T00:00[ (java.time.Local]DateTime), "fromYear...>
org.kie.dmn.core.DMNStronglyTypedSupportTest.testDateAndTime[KIE_API_TYPECHECK] expected:<...me.LocalDate), "from[]YearMonthDay"=1999-1...> but was:<...me.LocalDate), "from[StringToDateTime"=2015-12-24T00:00 (java.time.LocalDateTime), "from]YearMonthDay"=1999-1...>
org.kie.dmn.core.DMNStronglyTypedSupportTest.testDateAndTime[BUILDER_DEFAULT_NOCL_TYPECHECK] expected:<...me.LocalDate), "from[]YearMonthDay"=1999-1...> but was:<...me.LocalDate), "from[StringToDateTime"=2015-12-24T00:00 (java.time.LocalDateTime), "from]YearMonthDay"=1999-1...>

@kie-ci3
Copy link

kie-ci3 commented Jan 25, 2024

PR job #4 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-drools/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-drools -u #5664 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-5664/4/display/redirect

Test results:

  • PASSED: 21896
  • FAILED: 5

Those are the test failures:

org.kie.dmn.core.DMNRuntimeTest.testDateAndTime[false] [Message [id=0, level=ERROR, path=0007-date-time.dmn, line=68, column=-1
text=DMN: Error while evaluating node 'fromStringToDateTime': the declared result type is 'DMNType{ http://www.omg.org/spec/DMN/20180521/FEEL/ : date and time }' but the actual value '2015-12-24' is not an instance of that type (Error evaluating node) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=122, column=-1
text=DMN: Unable to evaluate decision 'Date-Time2' as it depends on decision 'Date' (DMN id: _7df22028-4b5b-4594-89c7-a80b8aec526f, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=266, column=-1
text=DMN: Unable to evaluate decision 'cHour' as it depends on decision 'Date-Time2' (DMN id: _087e3f57-8ea6-4857-a080-fadc5a1dd9e8, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=239, column=-1
text=DMN: Unable to evaluate decision 'cDay' as it depends on decision 'Date' (DMN id: _04c6bedc-bc63-464f-8e61-c039d24a47bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=188, column=-1
text=DMN: Unable to evaluate decision 'dtDuration2' as it depends on decision 'Date-Time2' (DMN id: _a2c48b03-6e72-4846-99cc-02f3747c6867, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=215, column=-1
text=DMN: Unable to evaluate decision 'sumDurations' as it depends on decision 'dtDuration2' (DMN id: _14f9f361-8c3c-455b-9c97-fe15201e3b5e, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=227, column=-1
text=DMN: Unable to evaluate decision 'ymDuration2' as it depends on decision 'Date-Time2' (DMN id: _cbac111e-ca71-4fac-a921-175ffd767055, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=302, column=-1
text=DMN: Unable to evaluate decision 'years' as it depends on decision 'ymDuration2' (DMN id: _91fb395d-8173-4ed3-95f7-f790bd3967ab, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=257, column=-1
text=DMN: Unable to evaluate decision 'cMonth' as it depends on decision 'Date' (DMN id: _2cf37ed0-590d-4f97-b58b-46eaa424b965, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=293, column=-1
text=DMN: Unable to evaluate decision 'cTimezone' as it depends on decision 'Date-Time2' (DMN id: _81f97dd0-29ea-4bab-9540-b70a2fdf8ff3, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=203, column=-1
text=DMN: Unable to evaluate decision 'hoursInDuration' as it depends on decision 'dtDuration2' (DMN id: _634e7bf4-782f-43f0-8b4f-cd8a3146da38, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=134, column=-1
text=DMN: Unable to evaluate decision 'Time2' as it depends on decision 'Date-Time2' (DMN id: _1f2b08ce-3c6b-4e22-a747-8d9f378e9035, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=284, column=-1
text=DMN: Unable to evaluate decision 'cSecond' as it depends on decision 'Date-Time2' (DMN id: _4af88a8f-92e4-4f2d-bde1-e8a36b27e5bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=275, column=-1
text=DMN: Unable to evaluate decision 'cMinute' as it depends on decision 'Date-Time2' (DMN id: _6836a944-7f7b-4c98-8a7a-a573494110fd, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=248, column=-1
text=DMN: Unable to evaluate decision 'cYear' as it depends on decision 'Date' (DMN id: _dc18ebe0-6762-4734-aeb3-ed4fb861865c, The referenced node was not found) ]]
Expecting value to be false but was true expected:<[fals]e> but was:<[tru]e>
org.kie.dmn.core.DMNStronglyTypedSupportTest.testDateAndTime[KIE_API_TYPECHECK] [Message [id=0, level=ERROR, path=0007-date-time.dmn, line=68, column=-1
text=DMN: Error while evaluating node 'fromStringToDateTime': the declared result type is 'DMNType{ http://www.omg.org/spec/DMN/20180521/FEEL/ : date and time }' but the actual value '2015-12-24' is not an instance of that type (Error evaluating node) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=122, column=-1
text=DMN: Unable to evaluate decision 'Date-Time2' as it depends on decision 'Date' (DMN id: _7df22028-4b5b-4594-89c7-a80b8aec526f, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=266, column=-1
text=DMN: Unable to evaluate decision 'cHour' as it depends on decision 'Date-Time2' (DMN id: _087e3f57-8ea6-4857-a080-fadc5a1dd9e8, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=239, column=-1
text=DMN: Unable to evaluate decision 'cDay' as it depends on decision 'Date' (DMN id: _04c6bedc-bc63-464f-8e61-c039d24a47bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=188, column=-1
text=DMN: Unable to evaluate decision 'dtDuration2' as it depends on decision 'Date-Time2' (DMN id: _a2c48b03-6e72-4846-99cc-02f3747c6867, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=215, column=-1
text=DMN: Unable to evaluate decision 'sumDurations' as it depends on decision 'dtDuration2' (DMN id: _14f9f361-8c3c-455b-9c97-fe15201e3b5e, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=227, column=-1
text=DMN: Unable to evaluate decision 'ymDuration2' as it depends on decision 'Date-Time2' (DMN id: _cbac111e-ca71-4fac-a921-175ffd767055, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=302, column=-1
text=DMN: Unable to evaluate decision 'years' as it depends on decision 'ymDuration2' (DMN id: _91fb395d-8173-4ed3-95f7-f790bd3967ab, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=257, column=-1
text=DMN: Unable to evaluate decision 'cMonth' as it depends on decision 'Date' (DMN id: _2cf37ed0-590d-4f97-b58b-46eaa424b965, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=293, column=-1
text=DMN: Unable to evaluate decision 'cTimezone' as it depends on decision 'Date-Time2' (DMN id: _81f97dd0-29ea-4bab-9540-b70a2fdf8ff3, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=203, column=-1
text=DMN: Unable to evaluate decision 'hoursInDuration' as it depends on decision 'dtDuration2' (DMN id: _634e7bf4-782f-43f0-8b4f-cd8a3146da38, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=134, column=-1
text=DMN: Unable to evaluate decision 'Time2' as it depends on decision 'Date-Time2' (DMN id: _1f2b08ce-3c6b-4e22-a747-8d9f378e9035, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=284, column=-1
text=DMN: Unable to evaluate decision 'cSecond' as it depends on decision 'Date-Time2' (DMN id: _4af88a8f-92e4-4f2d-bde1-e8a36b27e5bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=275, column=-1
text=DMN: Unable to evaluate decision 'cMinute' as it depends on decision 'Date-Time2' (DMN id: _6836a944-7f7b-4c98-8a7a-a573494110fd, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=248, column=-1
text=DMN: Unable to evaluate decision 'cYear' as it depends on decision 'Date' (DMN id: _dc18ebe0-6762-4734-aeb3-ed4fb861865c, The referenced node was not found) ]]
Expecting value to be false but was true expected:<[fals]e> but was:<[tru]e>
org.kie.dmn.core.DMNStronglyTypedSupportTest.testDateAndTime[BUILDER_DEFAULT_NOCL_TYPECHECK] [Message [id=0, level=ERROR, path=0007-date-time.dmn, line=68, column=-1
text=DMN: Error while evaluating node 'fromStringToDateTime': the declared result type is 'DMNType{ http://www.omg.org/spec/DMN/20180521/FEEL/ : date and time }' but the actual value '2015-12-24' is not an instance of that type (Error evaluating node) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=122, column=-1
text=DMN: Unable to evaluate decision 'Date-Time2' as it depends on decision 'Date' (DMN id: _7df22028-4b5b-4594-89c7-a80b8aec526f, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=266, column=-1
text=DMN: Unable to evaluate decision 'cHour' as it depends on decision 'Date-Time2' (DMN id: _087e3f57-8ea6-4857-a080-fadc5a1dd9e8, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=239, column=-1
text=DMN: Unable to evaluate decision 'cDay' as it depends on decision 'Date' (DMN id: _04c6bedc-bc63-464f-8e61-c039d24a47bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=188, column=-1
text=DMN: Unable to evaluate decision 'dtDuration2' as it depends on decision 'Date-Time2' (DMN id: _a2c48b03-6e72-4846-99cc-02f3747c6867, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=215, column=-1
text=DMN: Unable to evaluate decision 'sumDurations' as it depends on decision 'dtDuration2' (DMN id: _14f9f361-8c3c-455b-9c97-fe15201e3b5e, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=227, column=-1
text=DMN: Unable to evaluate decision 'ymDuration2' as it depends on decision 'Date-Time2' (DMN id: _cbac111e-ca71-4fac-a921-175ffd767055, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=302, column=-1
text=DMN: Unable to evaluate decision 'years' as it depends on decision 'ymDuration2' (DMN id: _91fb395d-8173-4ed3-95f7-f790bd3967ab, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=257, column=-1
text=DMN: Unable to evaluate decision 'cMonth' as it depends on decision 'Date' (DMN id: _2cf37ed0-590d-4f97-b58b-46eaa424b965, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=293, column=-1
text=DMN: Unable to evaluate decision 'cTimezone' as it depends on decision 'Date-Time2' (DMN id: _81f97dd0-29ea-4bab-9540-b70a2fdf8ff3, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=203, column=-1
text=DMN: Unable to evaluate decision 'hoursInDuration' as it depends on decision 'dtDuration2' (DMN id: _634e7bf4-782f-43f0-8b4f-cd8a3146da38, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=134, column=-1
text=DMN: Unable to evaluate decision 'Time2' as it depends on decision 'Date-Time2' (DMN id: _1f2b08ce-3c6b-4e22-a747-8d9f378e9035, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=284, column=-1
text=DMN: Unable to evaluate decision 'cSecond' as it depends on decision 'Date-Time2' (DMN id: _4af88a8f-92e4-4f2d-bde1-e8a36b27e5bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=275, column=-1
text=DMN: Unable to evaluate decision 'cMinute' as it depends on decision 'Date-Time2' (DMN id: _6836a944-7f7b-4c98-8a7a-a573494110fd, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=248, column=-1
text=DMN: Unable to evaluate decision 'cYear' as it depends on decision 'Date' (DMN id: _dc18ebe0-6762-4734-aeb3-ed4fb861865c, The referenced node was not found) ]]
Expecting value to be false but was true expected:<[fals]e> but was:<[tru]e>
org.kie.dmn.core.DMNStronglyTypedSupportTest.testDateAndTime[BUILDER_DEFAULT_NOCL_TYPECHECK_TYPESAFE] [Message [id=0, level=ERROR, path=0007-date-time.dmn, line=68, column=-1
text=DMN: Error while evaluating node 'fromStringToDateTime': the declared result type is 'DMNType{ http://www.omg.org/spec/DMN/20180521/FEEL/ : date and time }' but the actual value '2015-12-24' is not an instance of that type (Error evaluating node) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=122, column=-1
text=DMN: Unable to evaluate decision 'Date-Time2' as it depends on decision 'Date' (DMN id: _7df22028-4b5b-4594-89c7-a80b8aec526f, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=266, column=-1
text=DMN: Unable to evaluate decision 'cHour' as it depends on decision 'Date-Time2' (DMN id: _087e3f57-8ea6-4857-a080-fadc5a1dd9e8, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=239, column=-1
text=DMN: Unable to evaluate decision 'cDay' as it depends on decision 'Date' (DMN id: _04c6bedc-bc63-464f-8e61-c039d24a47bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=188, column=-1
text=DMN: Unable to evaluate decision 'dtDuration2' as it depends on decision 'Date-Time2' (DMN id: _a2c48b03-6e72-4846-99cc-02f3747c6867, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=215, column=-1
text=DMN: Unable to evaluate decision 'sumDurations' as it depends on decision 'dtDuration2' (DMN id: _14f9f361-8c3c-455b-9c97-fe15201e3b5e, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=227, column=-1
text=DMN: Unable to evaluate decision 'ymDuration2' as it depends on decision 'Date-Time2' (DMN id: _cbac111e-ca71-4fac-a921-175ffd767055, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=302, column=-1
text=DMN: Unable to evaluate decision 'years' as it depends on decision 'ymDuration2' (DMN id: _91fb395d-8173-4ed3-95f7-f790bd3967ab, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=257, column=-1
text=DMN: Unable to evaluate decision 'cMonth' as it depends on decision 'Date' (DMN id: _2cf37ed0-590d-4f97-b58b-46eaa424b965, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=293, column=-1
text=DMN: Unable to evaluate decision 'cTimezone' as it depends on decision 'Date-Time2' (DMN id: _81f97dd0-29ea-4bab-9540-b70a2fdf8ff3, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=203, column=-1
text=DMN: Unable to evaluate decision 'hoursInDuration' as it depends on decision 'dtDuration2' (DMN id: _634e7bf4-782f-43f0-8b4f-cd8a3146da38, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=134, column=-1
text=DMN: Unable to evaluate decision 'Time2' as it depends on decision 'Date-Time2' (DMN id: _1f2b08ce-3c6b-4e22-a747-8d9f378e9035, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=284, column=-1
text=DMN: Unable to evaluate decision 'cSecond' as it depends on decision 'Date-Time2' (DMN id: _4af88a8f-92e4-4f2d-bde1-e8a36b27e5bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=275, column=-1
text=DMN: Unable to evaluate decision 'cMinute' as it depends on decision 'Date-Time2' (DMN id: _6836a944-7f7b-4c98-8a7a-a573494110fd, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=248, column=-1
text=DMN: Unable to evaluate decision 'cYear' as it depends on decision 'Date' (DMN id: _dc18ebe0-6762-4734-aeb3-ed4fb861865c, The referenced node was not found) ]]
Expecting value to be false but was true expected:<[fals]e> but was:<[tru]e>
org.kie.dmn.core.DMNStronglyTypedSupportTest.testDateAndTime[KIE_API_TYPECHECK_TYPESAFE] [Message [id=0, level=ERROR, path=0007-date-time.dmn, line=68, column=-1
text=DMN: Error while evaluating node 'fromStringToDateTime': the declared result type is 'DMNType{ http://www.omg.org/spec/DMN/20180521/FEEL/ : date and time }' but the actual value '2015-12-24' is not an instance of that type (Error evaluating node) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=122, column=-1
text=DMN: Unable to evaluate decision 'Date-Time2' as it depends on decision 'Date' (DMN id: _7df22028-4b5b-4594-89c7-a80b8aec526f, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=266, column=-1
text=DMN: Unable to evaluate decision 'cHour' as it depends on decision 'Date-Time2' (DMN id: _087e3f57-8ea6-4857-a080-fadc5a1dd9e8, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=239, column=-1
text=DMN: Unable to evaluate decision 'cDay' as it depends on decision 'Date' (DMN id: _04c6bedc-bc63-464f-8e61-c039d24a47bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=188, column=-1
text=DMN: Unable to evaluate decision 'dtDuration2' as it depends on decision 'Date-Time2' (DMN id: _a2c48b03-6e72-4846-99cc-02f3747c6867, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=215, column=-1
text=DMN: Unable to evaluate decision 'sumDurations' as it depends on decision 'dtDuration2' (DMN id: _14f9f361-8c3c-455b-9c97-fe15201e3b5e, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=227, column=-1
text=DMN: Unable to evaluate decision 'ymDuration2' as it depends on decision 'Date-Time2' (DMN id: _cbac111e-ca71-4fac-a921-175ffd767055, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=302, column=-1
text=DMN: Unable to evaluate decision 'years' as it depends on decision 'ymDuration2' (DMN id: _91fb395d-8173-4ed3-95f7-f790bd3967ab, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=257, column=-1
text=DMN: Unable to evaluate decision 'cMonth' as it depends on decision 'Date' (DMN id: _2cf37ed0-590d-4f97-b58b-46eaa424b965, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=293, column=-1
text=DMN: Unable to evaluate decision 'cTimezone' as it depends on decision 'Date-Time2' (DMN id: _81f97dd0-29ea-4bab-9540-b70a2fdf8ff3, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=203, column=-1
text=DMN: Unable to evaluate decision 'hoursInDuration' as it depends on decision 'dtDuration2' (DMN id: _634e7bf4-782f-43f0-8b4f-cd8a3146da38, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=134, column=-1
text=DMN: Unable to evaluate decision 'Time2' as it depends on decision 'Date-Time2' (DMN id: _1f2b08ce-3c6b-4e22-a747-8d9f378e9035, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=284, column=-1
text=DMN: Unable to evaluate decision 'cSecond' as it depends on decision 'Date-Time2' (DMN id: _4af88a8f-92e4-4f2d-bde1-e8a36b27e5bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=275, column=-1
text=DMN: Unable to evaluate decision 'cMinute' as it depends on decision 'Date-Time2' (DMN id: _6836a944-7f7b-4c98-8a7a-a573494110fd, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=248, column=-1
text=DMN: Unable to evaluate decision 'cYear' as it depends on decision 'Date' (DMN id: _dc18ebe0-6762-4734-aeb3-ed4fb861865c, The referenced node was not found) ]]
Expecting value to be false but was true expected:<[fals]e> but was:<[tru]e>

@kie-ci3
Copy link

kie-ci3 commented Jan 26, 2024

PR job #5 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-drools/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-drools -u #5664 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-5664/5/display/redirect

Test results:

  • PASSED: 21896
  • FAILED: 5

Those are the test failures:

org.kie.dmn.core.DMNRuntimeTest.testDateAndTime[false] [Message [id=0, level=ERROR, path=0007-date-time.dmn, line=68, column=-1
text=DMN: Error while evaluating node 'fromStringToDateTime': the declared result type is 'DMNType{ http://www.omg.org/spec/DMN/20180521/FEEL/ : date and time }' but the actual value '2015-12-24' is not an instance of that type (Error evaluating node) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=122, column=-1
text=DMN: Unable to evaluate decision 'Date-Time2' as it depends on decision 'Date' (DMN id: _7df22028-4b5b-4594-89c7-a80b8aec526f, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=266, column=-1
text=DMN: Unable to evaluate decision 'cHour' as it depends on decision 'Date-Time2' (DMN id: _087e3f57-8ea6-4857-a080-fadc5a1dd9e8, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=239, column=-1
text=DMN: Unable to evaluate decision 'cDay' as it depends on decision 'Date' (DMN id: _04c6bedc-bc63-464f-8e61-c039d24a47bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=188, column=-1
text=DMN: Unable to evaluate decision 'dtDuration2' as it depends on decision 'Date-Time2' (DMN id: _a2c48b03-6e72-4846-99cc-02f3747c6867, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=215, column=-1
text=DMN: Unable to evaluate decision 'sumDurations' as it depends on decision 'dtDuration2' (DMN id: _14f9f361-8c3c-455b-9c97-fe15201e3b5e, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=227, column=-1
text=DMN: Unable to evaluate decision 'ymDuration2' as it depends on decision 'Date-Time2' (DMN id: _cbac111e-ca71-4fac-a921-175ffd767055, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=302, column=-1
text=DMN: Unable to evaluate decision 'years' as it depends on decision 'ymDuration2' (DMN id: _91fb395d-8173-4ed3-95f7-f790bd3967ab, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=257, column=-1
text=DMN: Unable to evaluate decision 'cMonth' as it depends on decision 'Date' (DMN id: _2cf37ed0-590d-4f97-b58b-46eaa424b965, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=293, column=-1
text=DMN: Unable to evaluate decision 'cTimezone' as it depends on decision 'Date-Time2' (DMN id: _81f97dd0-29ea-4bab-9540-b70a2fdf8ff3, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=203, column=-1
text=DMN: Unable to evaluate decision 'hoursInDuration' as it depends on decision 'dtDuration2' (DMN id: _634e7bf4-782f-43f0-8b4f-cd8a3146da38, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=134, column=-1
text=DMN: Unable to evaluate decision 'Time2' as it depends on decision 'Date-Time2' (DMN id: _1f2b08ce-3c6b-4e22-a747-8d9f378e9035, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=284, column=-1
text=DMN: Unable to evaluate decision 'cSecond' as it depends on decision 'Date-Time2' (DMN id: _4af88a8f-92e4-4f2d-bde1-e8a36b27e5bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=275, column=-1
text=DMN: Unable to evaluate decision 'cMinute' as it depends on decision 'Date-Time2' (DMN id: _6836a944-7f7b-4c98-8a7a-a573494110fd, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=248, column=-1
text=DMN: Unable to evaluate decision 'cYear' as it depends on decision 'Date' (DMN id: _dc18ebe0-6762-4734-aeb3-ed4fb861865c, The referenced node was not found) ]]
Expecting value to be false but was true expected:<[fals]e> but was:<[tru]e>
org.kie.dmn.core.DMNStronglyTypedSupportTest.testDateAndTime[KIE_API_TYPECHECK] [Message [id=0, level=ERROR, path=0007-date-time.dmn, line=68, column=-1
text=DMN: Error while evaluating node 'fromStringToDateTime': the declared result type is 'DMNType{ http://www.omg.org/spec/DMN/20180521/FEEL/ : date and time }' but the actual value '2015-12-24' is not an instance of that type (Error evaluating node) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=122, column=-1
text=DMN: Unable to evaluate decision 'Date-Time2' as it depends on decision 'Date' (DMN id: _7df22028-4b5b-4594-89c7-a80b8aec526f, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=266, column=-1
text=DMN: Unable to evaluate decision 'cHour' as it depends on decision 'Date-Time2' (DMN id: _087e3f57-8ea6-4857-a080-fadc5a1dd9e8, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=239, column=-1
text=DMN: Unable to evaluate decision 'cDay' as it depends on decision 'Date' (DMN id: _04c6bedc-bc63-464f-8e61-c039d24a47bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=188, column=-1
text=DMN: Unable to evaluate decision 'dtDuration2' as it depends on decision 'Date-Time2' (DMN id: _a2c48b03-6e72-4846-99cc-02f3747c6867, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=215, column=-1
text=DMN: Unable to evaluate decision 'sumDurations' as it depends on decision 'dtDuration2' (DMN id: _14f9f361-8c3c-455b-9c97-fe15201e3b5e, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=227, column=-1
text=DMN: Unable to evaluate decision 'ymDuration2' as it depends on decision 'Date-Time2' (DMN id: _cbac111e-ca71-4fac-a921-175ffd767055, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=302, column=-1
text=DMN: Unable to evaluate decision 'years' as it depends on decision 'ymDuration2' (DMN id: _91fb395d-8173-4ed3-95f7-f790bd3967ab, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=257, column=-1
text=DMN: Unable to evaluate decision 'cMonth' as it depends on decision 'Date' (DMN id: _2cf37ed0-590d-4f97-b58b-46eaa424b965, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=293, column=-1
text=DMN: Unable to evaluate decision 'cTimezone' as it depends on decision 'Date-Time2' (DMN id: _81f97dd0-29ea-4bab-9540-b70a2fdf8ff3, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=203, column=-1
text=DMN: Unable to evaluate decision 'hoursInDuration' as it depends on decision 'dtDuration2' (DMN id: _634e7bf4-782f-43f0-8b4f-cd8a3146da38, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=134, column=-1
text=DMN: Unable to evaluate decision 'Time2' as it depends on decision 'Date-Time2' (DMN id: _1f2b08ce-3c6b-4e22-a747-8d9f378e9035, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=284, column=-1
text=DMN: Unable to evaluate decision 'cSecond' as it depends on decision 'Date-Time2' (DMN id: _4af88a8f-92e4-4f2d-bde1-e8a36b27e5bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=275, column=-1
text=DMN: Unable to evaluate decision 'cMinute' as it depends on decision 'Date-Time2' (DMN id: _6836a944-7f7b-4c98-8a7a-a573494110fd, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=248, column=-1
text=DMN: Unable to evaluate decision 'cYear' as it depends on decision 'Date' (DMN id: _dc18ebe0-6762-4734-aeb3-ed4fb861865c, The referenced node was not found) ]]
Expecting value to be false but was true expected:<[fals]e> but was:<[tru]e>
org.kie.dmn.core.DMNStronglyTypedSupportTest.testDateAndTime[BUILDER_DEFAULT_NOCL_TYPECHECK] [Message [id=0, level=ERROR, path=0007-date-time.dmn, line=68, column=-1
text=DMN: Error while evaluating node 'fromStringToDateTime': the declared result type is 'DMNType{ http://www.omg.org/spec/DMN/20180521/FEEL/ : date and time }' but the actual value '2015-12-24' is not an instance of that type (Error evaluating node) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=122, column=-1
text=DMN: Unable to evaluate decision 'Date-Time2' as it depends on decision 'Date' (DMN id: _7df22028-4b5b-4594-89c7-a80b8aec526f, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=266, column=-1
text=DMN: Unable to evaluate decision 'cHour' as it depends on decision 'Date-Time2' (DMN id: _087e3f57-8ea6-4857-a080-fadc5a1dd9e8, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=239, column=-1
text=DMN: Unable to evaluate decision 'cDay' as it depends on decision 'Date' (DMN id: _04c6bedc-bc63-464f-8e61-c039d24a47bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=188, column=-1
text=DMN: Unable to evaluate decision 'dtDuration2' as it depends on decision 'Date-Time2' (DMN id: _a2c48b03-6e72-4846-99cc-02f3747c6867, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=215, column=-1
text=DMN: Unable to evaluate decision 'sumDurations' as it depends on decision 'dtDuration2' (DMN id: _14f9f361-8c3c-455b-9c97-fe15201e3b5e, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=227, column=-1
text=DMN: Unable to evaluate decision 'ymDuration2' as it depends on decision 'Date-Time2' (DMN id: _cbac111e-ca71-4fac-a921-175ffd767055, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=302, column=-1
text=DMN: Unable to evaluate decision 'years' as it depends on decision 'ymDuration2' (DMN id: _91fb395d-8173-4ed3-95f7-f790bd3967ab, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=257, column=-1
text=DMN: Unable to evaluate decision 'cMonth' as it depends on decision 'Date' (DMN id: _2cf37ed0-590d-4f97-b58b-46eaa424b965, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=293, column=-1
text=DMN: Unable to evaluate decision 'cTimezone' as it depends on decision 'Date-Time2' (DMN id: _81f97dd0-29ea-4bab-9540-b70a2fdf8ff3, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=203, column=-1
text=DMN: Unable to evaluate decision 'hoursInDuration' as it depends on decision 'dtDuration2' (DMN id: _634e7bf4-782f-43f0-8b4f-cd8a3146da38, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=134, column=-1
text=DMN: Unable to evaluate decision 'Time2' as it depends on decision 'Date-Time2' (DMN id: _1f2b08ce-3c6b-4e22-a747-8d9f378e9035, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=284, column=-1
text=DMN: Unable to evaluate decision 'cSecond' as it depends on decision 'Date-Time2' (DMN id: _4af88a8f-92e4-4f2d-bde1-e8a36b27e5bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=275, column=-1
text=DMN: Unable to evaluate decision 'cMinute' as it depends on decision 'Date-Time2' (DMN id: _6836a944-7f7b-4c98-8a7a-a573494110fd, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=248, column=-1
text=DMN: Unable to evaluate decision 'cYear' as it depends on decision 'Date' (DMN id: _dc18ebe0-6762-4734-aeb3-ed4fb861865c, The referenced node was not found) ]]
Expecting value to be false but was true expected:<[fals]e> but was:<[tru]e>
org.kie.dmn.core.DMNStronglyTypedSupportTest.testDateAndTime[BUILDER_DEFAULT_NOCL_TYPECHECK_TYPESAFE] [Message [id=0, level=ERROR, path=0007-date-time.dmn, line=68, column=-1
text=DMN: Error while evaluating node 'fromStringToDateTime': the declared result type is 'DMNType{ http://www.omg.org/spec/DMN/20180521/FEEL/ : date and time }' but the actual value '2015-12-24' is not an instance of that type (Error evaluating node) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=122, column=-1
text=DMN: Unable to evaluate decision 'Date-Time2' as it depends on decision 'Date' (DMN id: _7df22028-4b5b-4594-89c7-a80b8aec526f, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=266, column=-1
text=DMN: Unable to evaluate decision 'cHour' as it depends on decision 'Date-Time2' (DMN id: _087e3f57-8ea6-4857-a080-fadc5a1dd9e8, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=239, column=-1
text=DMN: Unable to evaluate decision 'cDay' as it depends on decision 'Date' (DMN id: _04c6bedc-bc63-464f-8e61-c039d24a47bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=188, column=-1
text=DMN: Unable to evaluate decision 'dtDuration2' as it depends on decision 'Date-Time2' (DMN id: _a2c48b03-6e72-4846-99cc-02f3747c6867, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=215, column=-1
text=DMN: Unable to evaluate decision 'sumDurations' as it depends on decision 'dtDuration2' (DMN id: _14f9f361-8c3c-455b-9c97-fe15201e3b5e, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=227, column=-1
text=DMN: Unable to evaluate decision 'ymDuration2' as it depends on decision 'Date-Time2' (DMN id: _cbac111e-ca71-4fac-a921-175ffd767055, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=302, column=-1
text=DMN: Unable to evaluate decision 'years' as it depends on decision 'ymDuration2' (DMN id: _91fb395d-8173-4ed3-95f7-f790bd3967ab, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=257, column=-1
text=DMN: Unable to evaluate decision 'cMonth' as it depends on decision 'Date' (DMN id: _2cf37ed0-590d-4f97-b58b-46eaa424b965, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=293, column=-1
text=DMN: Unable to evaluate decision 'cTimezone' as it depends on decision 'Date-Time2' (DMN id: _81f97dd0-29ea-4bab-9540-b70a2fdf8ff3, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=203, column=-1
text=DMN: Unable to evaluate decision 'hoursInDuration' as it depends on decision 'dtDuration2' (DMN id: _634e7bf4-782f-43f0-8b4f-cd8a3146da38, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=134, column=-1
text=DMN: Unable to evaluate decision 'Time2' as it depends on decision 'Date-Time2' (DMN id: _1f2b08ce-3c6b-4e22-a747-8d9f378e9035, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=284, column=-1
text=DMN: Unable to evaluate decision 'cSecond' as it depends on decision 'Date-Time2' (DMN id: _4af88a8f-92e4-4f2d-bde1-e8a36b27e5bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=275, column=-1
text=DMN: Unable to evaluate decision 'cMinute' as it depends on decision 'Date-Time2' (DMN id: _6836a944-7f7b-4c98-8a7a-a573494110fd, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=248, column=-1
text=DMN: Unable to evaluate decision 'cYear' as it depends on decision 'Date' (DMN id: _dc18ebe0-6762-4734-aeb3-ed4fb861865c, The referenced node was not found) ]]
Expecting value to be false but was true expected:<[fals]e> but was:<[tru]e>
org.kie.dmn.core.DMNStronglyTypedSupportTest.testDateAndTime[KIE_API_TYPECHECK_TYPESAFE] [Message [id=0, level=ERROR, path=0007-date-time.dmn, line=68, column=-1
text=DMN: Error while evaluating node 'fromStringToDateTime': the declared result type is 'DMNType{ http://www.omg.org/spec/DMN/20180521/FEEL/ : date and time }' but the actual value '2015-12-24' is not an instance of that type (Error evaluating node) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=122, column=-1
text=DMN: Unable to evaluate decision 'Date-Time2' as it depends on decision 'Date' (DMN id: _7df22028-4b5b-4594-89c7-a80b8aec526f, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=266, column=-1
text=DMN: Unable to evaluate decision 'cHour' as it depends on decision 'Date-Time2' (DMN id: _087e3f57-8ea6-4857-a080-fadc5a1dd9e8, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=239, column=-1
text=DMN: Unable to evaluate decision 'cDay' as it depends on decision 'Date' (DMN id: _04c6bedc-bc63-464f-8e61-c039d24a47bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=188, column=-1
text=DMN: Unable to evaluate decision 'dtDuration2' as it depends on decision 'Date-Time2' (DMN id: _a2c48b03-6e72-4846-99cc-02f3747c6867, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=215, column=-1
text=DMN: Unable to evaluate decision 'sumDurations' as it depends on decision 'dtDuration2' (DMN id: _14f9f361-8c3c-455b-9c97-fe15201e3b5e, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=227, column=-1
text=DMN: Unable to evaluate decision 'ymDuration2' as it depends on decision 'Date-Time2' (DMN id: _cbac111e-ca71-4fac-a921-175ffd767055, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=302, column=-1
text=DMN: Unable to evaluate decision 'years' as it depends on decision 'ymDuration2' (DMN id: _91fb395d-8173-4ed3-95f7-f790bd3967ab, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=257, column=-1
text=DMN: Unable to evaluate decision 'cMonth' as it depends on decision 'Date' (DMN id: _2cf37ed0-590d-4f97-b58b-46eaa424b965, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=293, column=-1
text=DMN: Unable to evaluate decision 'cTimezone' as it depends on decision 'Date-Time2' (DMN id: _81f97dd0-29ea-4bab-9540-b70a2fdf8ff3, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=203, column=-1
text=DMN: Unable to evaluate decision 'hoursInDuration' as it depends on decision 'dtDuration2' (DMN id: _634e7bf4-782f-43f0-8b4f-cd8a3146da38, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=134, column=-1
text=DMN: Unable to evaluate decision 'Time2' as it depends on decision 'Date-Time2' (DMN id: _1f2b08ce-3c6b-4e22-a747-8d9f378e9035, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=284, column=-1
text=DMN: Unable to evaluate decision 'cSecond' as it depends on decision 'Date-Time2' (DMN id: _4af88a8f-92e4-4f2d-bde1-e8a36b27e5bf, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=275, column=-1
text=DMN: Unable to evaluate decision 'cMinute' as it depends on decision 'Date-Time2' (DMN id: _6836a944-7f7b-4c98-8a7a-a573494110fd, The referenced node was not found) ]
Message [id=0, level=ERROR, path=0007-date-time.dmn, line=248, column=-1
text=DMN: Unable to evaluate decision 'cYear' as it depends on decision 'Date' (DMN id: _dc18ebe0-6762-4734-aeb3-ed4fb861865c, The referenced node was not found) ]]
Expecting value to be false but was true expected:<[fals]e> but was:<[tru]e>

@gitgabrio
Copy link
Contributor Author

gitgabrio commented Jan 26, 2024

@tarilabs @baldimir @yesamer
I tried to follow Matteo' suggestion here but my impression is that it applies only to the parameter of a a given expression; i.e. in that case ->
some_expr(date(....))
knowing that the required parameter of some_expr is date-time, we could use the suggestion.
But reading from spec 10.3.2.9.4

from date to date and time:
When the type of the expression is date and the target type is date and time, the expression is converted
to a date time value in which the time of day is UTC midnight (00:00:00)

my understanding is that even in the following case

  <semantic:contextEntry>
          <semantic:variable name="fromStringToDateTime" typeRef="date and time"/>
          <semantic:literalExpression>
            <semantic:text>date(dateString)</semantic:text>
          </semantic:literalExpression>
        </semantic:contextEntry>

the target is date and time, and actually returned object should be date-time; but since in that context the date(dateString) is not a parameter of another expression, I could not find a way to apply the mentioned solution.

Of course, I may be wrong on different aspects, here, so any advice would be extemely appreciated.
If my understandings are correct, though, I have the impression that this kind of conversion could happen only at the end of the value evaluation - with the "context" at hand.
Wdyt ?

Copy link
Member

@tarilabs tarilabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the update. The way I understand this PR as it stands right now, make coercion only for results of entry in DMN boxed Context.

To me, #5657 (comment) always applies.
To me, you need B.1 on function invocation and B.2 on type check for coercion on return.

So, this PR in the way I understand does not cover for B.1, and for B.2 covers only in a specific case out of all the boxed expressions.

You might want to consider, as previously suggested, to break down task into subtasks, if that helps with complexity.

Hope this helps you and @baldimir make evaluations on the best way to proceed on this one!

@gitgabrio
Copy link
Contributor Author

gitgabrio commented Jan 26, 2024 via email

@gitgabrio
Copy link
Contributor Author

gitgabrio commented Jan 29, 2024

HI @tarilabs
still trying to figure out. I'm trying to create a test where a function (thhat accept date-time as parameter) is invoked with a date.
I've created the following dmn (adapted from an existing one):

 <dmn:businessKnowledgeModel id="_80847A66-F03E-4B81-B406-0E3B8D177EC8" name="normal">
    <dmn:extensionElements/>
    <dmn:variable id="_1D5A641F-31EE-42FF-8DAD-D229A9A998BD" name="normal"/>
    <dmn:encapsulatedLogic id="_4A6C9D35-03DE-47F8-8ADD-6F15A27077A5" kind="FEEL">
      <dmn:formalParameter id="_3984C4F0-4E60-481A-9702-EAC914F1C63B" name="a" typeRef="date and time"/>
      <dmn:formalParameter id="_C419BFC7-53E0-4B2C-A2B1-BA5A22D2971D" name="b" typeRef="time"/>
      <dmn:literalExpression id="_88CC7676-B609-4430-8670-5B5735D5C6D5">
        <dmn:text>a+b</dmn:text>
      </dmn:literalExpression>
    </dmn:encapsulatedLogic>
  </dmn:businessKnowledgeModel>
  <dmn:decision id="_3151179A-E33D-4A7E-9D9C-8CFE388E8640" name="usingNormal">
    <dmn:extensionElements/>
    <dmn:variable id="_C1455FFB-C4C4-4ABA-A9DF-2E7A92F2588B" name="usingNormal" typeRef="date and time"/>
    <dmn:knowledgeRequirement id="_A1C84873-809C-44CD-90BE-AD32BFB8F79F">
      <dmn:requiredKnowledge href="#_80847A66-F03E-4B81-B406-0E3B8D177EC8"/>
    </dmn:knowledgeRequirement>
    <dmn:literalExpression id="_B29EE21C-702B-40BB-A98A-1717BBC83C8C">
      <dmn:text>normal( @"2019-03-31", duration( "P26M" ))</dmn:text>
    </dmn:literalExpression>
  </dmn:decision>

WIth my current knowledge of DMN spec, I think this implement the use-case in point; but during the execution the code still does not hit the code you mentioned (for the normal( @"2019-03-31", duration( "P26M" )) expression)
So, I have the following questions:

  1. may it be that this kind of modification has to be done in multiple/different places
  2. could you provide an example, a dmn snippet, or point to some already existing one, where that specific use-case is used ?
  3. I also tried to look at tck (both master and dmn1.5 branches), but I was unable to find where this new use-case is tested

@baldimir @yesamer ^^

@kie-ci3
Copy link

kie-ci3 commented Jan 29, 2024

PR job #8 was: UNSTABLE
Possible explanation: This should be test failures

Reproducer

build-chain build full_downstream -f 'https://raw.githubusercontent.com/${AUTHOR:apache}/incubator-kie-drools/${BRANCH:main}/.ci/buildchain-config-pr-cdb.yaml' -o 'bc' -p apache/incubator-kie-drools -u #5664 --skipParallelCheckout

NOTE: To install the build-chain tool, please refer to https://github.com/kiegroup/github-action-build-chain#local-execution

Please look here: https://ci-builds.apache.org/job/KIE/job/drools/job/main/job/pullrequest_jobs/job/drools-pr/job/PR-5664/8/display/redirect

Test results:

  • PASSED: 21883
  • FAILED: 20

Those are the test failures:

org.drools.persistence.command.MoreBatchExecutionPersistenceTest.testQuery[optimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.command.MoreBatchExecutionPersistenceTest.testFireAllRules[optimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.command.MoreBatchExecutionPersistenceTest.testQuery[pessimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.command.MoreBatchExecutionPersistenceTest.testFireAllRules[pessimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.command.SimpleBatchExecutionPersistenceTest.testInsertObjectCommand[optimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.command.SimpleBatchExecutionPersistenceTest.testInsertElementsCommand[optimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.command.SimpleBatchExecutionPersistenceTest.testGetObjectCommand[optimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.command.SimpleBatchExecutionPersistenceTest.testSetGlobalCommand[optimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.command.SimpleBatchExecutionPersistenceTest.testGetGlobalCommand[optimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.command.SimpleBatchExecutionPersistenceTest.testGetObjectsCommand[optimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.command.SimpleBatchExecutionPersistenceTest.testInsertObjectCommand[pessimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.command.SimpleBatchExecutionPersistenceTest.testInsertElementsCommand[pessimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.command.SimpleBatchExecutionPersistenceTest.testGetObjectCommand[pessimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.command.SimpleBatchExecutionPersistenceTest.testSetGlobalCommand[pessimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.command.SimpleBatchExecutionPersistenceTest.testGetGlobalCommand[pessimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.command.SimpleBatchExecutionPersistenceTest.testGetObjectsCommand[pessimistic] [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.jta.JtaTransactionManagerTest.basicTransactionRollbackTest There should not be an exception thrown here: Unable to acquire JDBC Connection [Unable to register transaction context listener] [n/a]
org.drools.persistence.jta.JtaTransactionManagerTest.testSingleSessionCommandServiceAndJtaTransactionManagerTogether [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.drools.persistence.jta.JtaTransactionManagerTest.showingTransactionTestObjectsNeedTransactions [PersistenceUnit: org.drools.persistence.jpa] Unable to build Hibernate SessionFactory
org.kie.dmn.core.DMNRuntimeTest.testDateToDateTimeFunction[false] expected:<3> but was:

@tarilabs
Copy link
Member

Can you folks (@gitgabrio @baldimir) kindly try first to elaborate further based on previous comments (if deemed helpful), and if questions are remaining based on that, to refer back to me for any new pending/remaining questions, please?

I believe most of the questions were actually addressed with code pointers in the old #5657 (comment) not only in the semantic portion but also made reference to a possible way to address it with the internals linked (of course there might be several alternative ways too).

I'm happy to be available for any (new) questions or doubts!

@gitgabrio
Copy link
Contributor Author

Hi @tarilabs
first of all, many thanks for your help!
We are actually taking that very comment as "implementation plan".
Point A is currently addressed by @baldimir, and hopefully will be done soon.
I'm currently focused on point B.1
Anyway, those are the bit I'm currently struggling with

[...]
2. could you provide an example, a dmn snippet, or point to some already existing one, where that specific use-case is used ?
3. I also tried to look at tck (both master and dmn1.5 branches), but I was unable to find where this new use-case is tested

because I could not find a way to verify/implement your suggestion; said differently, I understood the concept behind your suggestion (B.1) but I could not find a way to test it.

The snippet I posted above is my last attempt but it does not work as expected - i.e. the code you pointed at is not hit when executing the normal( @"2019-03-31", duration( "P26M" )) expression.
Instead, it goes to
DMNFunctionDefinitionEvaluato#invoke(EvaluationContext, Object[])

and it fails at
line160

if ((!performRuntimeTypeCheck) || parameters.get(i).type.isAssignableValue(params[i])) {

because at this point the first parameter (LocalDate) is not the expected type (LocalDateTime).

So, my very first step would be to have a proper dmn example/test to experiment with, since the ones I created so far seems not valid for that.
Thanks again!
Best!

@gitgabrio
Copy link
Contributor Author

@baldimir @yesamer
In my last commit I tried to:

  1. centralize "coerction" logic in one single place
  2. try to test the new use case

About 1)

  1. it turned out that I can't do in one single place, because of inheritance tree and required parameters - maybe you may have a suggestion to avoid that
  2. utility classes have same name, so I think I'll have to rename
  3. I tried to look for [...] a=[a].... comment to identify the coertion execution points, and modified them

About 2), it only resolve to my knowledge of the specs: if you have some suggestion, even related to previous discussions, feel free to share

@gitgabrio gitgabrio requested a review from yesamer February 7, 2024 10:14
@gitgabrio gitgabrio merged commit 3d60586 into apache:main Feb 7, 2024
9 checks passed
@gitgabrio gitgabrio deleted the incubator-kie-issues#854 branch February 7, 2024 14:26
rgdoliveira pushed a commit to rgdoliveira/drools that referenced this pull request Mar 11, 2024
… to date and time when necessary (apache#5664)

* [private-bamoe-issues#244] DMN - Add implicit type conversion of date to date and time when necessary

* [private-bamoe-issues#244] WIP

* [private-bamoe-issues#244] WIP

* [incubator-kie-issues#854] Experiment implicit date -> date-time conversion

* [incubator-kie-issues#854] Remove implicit date -> date-time conversion

* [incubator-kie-issues#854] Remove implicit date -> date-time conversion

* [incubator-kie-issues#854] Converting value after its evaluation, when needed

* [incubator-kie-issues#854] Minor modification on test

* [incubator-kie-issues#854] WIP

* [incubator-kie-issues#854] Centralize Coerce behaviour

* [incubator-kie-issues#854] Add tests. Removed strong assumption where Date is always to be treated as DateTime (not true).
Removed redundant code on DMNType

* [incubator-kie-issues#854] Enforcing coercion inside lists

* [incubator-kie-issues#854] Enforcing coercion inside collections

---------

Co-authored-by: BAMOE CI <bamoe.ci@ibm.com>
Co-authored-by: Gabriele-Cardosi <gabriele.cardosi@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DMN - Add implicit type conversion of date to date and time when necessary
5 participants