Skip to content

kie-issues#315: DMN Runner table view should display validation messages #2943

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

Merged
merged 18 commits into from
May 14, 2025

Conversation

Kusuma04-dev
Copy link
Contributor

closes apache/incubator-kie-issues#315 DMN Runner table view should display validation messages
Before fix:
we are displaying messages from decisionresults which is in response because of this few error messages are not getting displayed.
example: using round up function
Screenshot 2025-02-27 at 3 52 32 PM

After fix:
Now we are displaying the messages directly from response.
Example:
Screenshot 2025-02-27 at 3 54 06 PM

Copy link
Contributor

@jomarko jomarko left a comment

Choose a reason for hiding this comment

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

Hi @Kusuma04-dev , thank you for the pull request. It will be very helpful for users to see these messages from backend 💪 .

However it seems we need to improve our code for transforming backend data into UI data. Once I created model with three decisions, the message was 'tripled' there. See the attached screenshot.

image

@Kusuma04-dev
Copy link
Contributor Author

Hi @Kusuma04-dev , thank you for the pull request. It will be very helpful for users to see these messages from backend 💪 .

However it seems we need to improve our code for transforming backend data into UI data. Once I created model with three decisions, the message was 'tripled' there. See the attached screenshot.

image

Thanks Jozef for the review, I have missed to check this type of scenario. I have handled now.Please validate.

Copy link
Contributor

@ljmotta ljmotta left a comment

Choose a reason for hiding this comment

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

@Kusuma04-dev Thanks for addressing this bug! I've made some comments and questions inline regarding some of your choices.

@jomarko
Copy link
Contributor

jomarko commented Mar 5, 2025

I will do my re-review after @ljmotta points are addressed, as he asked code changes that may change the final behavior.

@Kusuma04-dev Kusuma04-dev requested a review from ljmotta March 5, 2025 10:16
Copy link
Contributor

@jomarko jomarko left a comment

Choose a reason for hiding this comment

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

@Kusuma04-dev hi, I have a question, if DmnRunnerContextProvider could somehow reduce/aggregate messages information, to contain also row number. I mean, lest say we show validation messages for three rows, it would be nice to have some prefix in the message saying what row it is related to.

417547437-31f9552a-5b44-469c-b46b-cfd0f45321da

@Kusuma04-dev
Copy link
Contributor Author

@Kusuma04-dev hi, I have a question, if DmnRunnerContextProvider could somehow reduce/aggregate messages information, to contain also row number. I mean, lest say we show validation messages for three rows, it would be nice to have some prefix in the message saying what row it is related to.

417547437-31f9552a-5b44-469c-b46b-cfd0f45321da

Hi @jomarko , In case of form , we are showing messages for that particular row only , so i feel it's understandable without row number also , WDYT?For example if we have 3 rows then if u select row 1 - only messages related to that row will display and if u go to row 2 then only messages related to row 2 will display. but in case of table ,might be needed to show row numbers as we are displaying all messages at a time.Let me check if it is possible.

@jomarko
Copy link
Contributor

jomarko commented Mar 5, 2025

@Kusuma04-dev yes, I am sorry that I was not clear in my last comment. It is fine for me to keep formmode as it is. I spoke about table mode. In screenshot I used form mode but I wanted just highlight with the red text what information I speak about and what place in problems panel.

Copy link
Contributor

@jomarko jomarko left a comment

Choose a reason for hiding this comment

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

The current content of the execution tab may be very overwhelmed. What @ljmotta mentioned, the aggregation using node name could help. It would bring some consistency into the app behavior that could help with a user experience.

What do you think about change form:

Current

Screenshot 2025-03-06 090538

to

Proposal

aggregate-node

I have used model and data

@ljmotta
Copy link
Contributor

ljmotta commented Mar 7, 2025

@jomarko I agree with Jozef. We need to keep the errors under the node name, or having multiple errors can be very dificult to track.

@Kusuma04-dev Kusuma04-dev requested a review from jomarko May 6, 2025 05:14
Copy link
Contributor

@ljmotta ljmotta left a comment

Choose a reason for hiding this comment

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

Thanks for your PR @Kusuma04-dev ! I've made a comment inline.

@Kusuma04-dev Kusuma04-dev requested a review from ljmotta May 9, 2025 13:26
Copy link
Contributor

@ljmotta ljmotta left a comment

Choose a reason for hiding this comment

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

@Kusuma04-dev Thanks! LGTM

@yesamer yesamer requested a review from Copilot May 13, 2025 06:47
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue in the DMN Runner table view by ensuring that validation messages are now directly obtained from the extended services response instead of relying solely on decision results. Key changes include:

  • Returning an additional property, invalidElementPaths, in ExtendedServicesClient.ts.
  • Introducing new state hooks and helper functions in DmnRunnerContextProvider.tsx for handling and mapping response messages and invalid element paths.
  • Updating the ExtendedServicesDmnResult interface in dmnResult.ts to include invalidElementPaths.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/online-editor/src/extendedServices/ExtendedServicesClient.ts Updated error handling to return invalidElementPaths along with messages.
packages/online-editor/src/dmnRunner/DmnRunnerContextProvider.tsx Added state hooks and logic for processing response messages and invalid element paths, and introduced a helper function for decision ID lookup.
packages/extended-services-api/src/dmnResult.ts Extended the result interface with the invalidElementPaths property.
Comments suppressed due to low confidence (1)

packages/online-editor/src/dmnRunner/DmnRunnerContextProvider.tsx:338

  • The function name 'findDecisionIdIdBySourceId' is ambiguous due to the repeated 'Id'. Consider renaming it to 'findDecisionIdBySourceId' to improve clarity.
const findDecisionIdIdBySourceId = useCallback(

Copy link
Contributor

@jomarko jomarko 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. I am approving the PR. I am opening some points for discussion in private slack channel.

Copy link
Contributor

@danielzhe danielzhe left a comment

Choose a reason for hiding this comment

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

Great job, @Kusuma04-dev

@yesamer yesamer merged commit 1180bc4 into apache:main May 14, 2025
15 checks passed
kumaradityaraj pushed a commit to kumaradityaraj/kie-tools that referenced this pull request May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DMN Runner table view should display validation messages
7 participants