-
Notifications
You must be signed in to change notification settings - Fork 201
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
kie-issues#1466: A Decision Table with a single output column shouldn't have a name #2834
base: main
Are you sure you want to change the base?
Conversation
As discussed in the private chat, I think this PR is incorrect, but I'll clarify the issue better. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kusuma04-dev thank you for the PR. Currently, the failing tests are with high probability related to code changes you have introduced. But we need to wait for @danielzhe feedback before we fix the tests. It seems that @danielzhe will propose different solution and that may mean different or no tests failing.
@jomarko Yeah, we're working on it. |
Hi, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for changes @Kusuma04-dev
UI
I think we are fine on the UI side. There I see this behavior
Single output column
Is represented with single level column header. This column header informs about the decision ndoe name and the decision node data type.
Multiple output columns
Are represented by two level column header
| decision node name |
| - -col A - | - - col B - |
Backend
There I think we have still the issue that name
attribute is present in the output
tag. See:
<dmn:decision name="bbb" id="_055202A8-C02C-4A75-AE67-CFA23080D2B3">
<dmn:variable name="bbb" id="_E77AD5FF-91D7-4E03-84D8-87D82A8E002C" typeRef="boolean" />
<dmn:decisionTable id="_31E8BF8C-BE7E-456C-B9D4-0F42D9B11572" typeRef="boolean" hitPolicy="UNIQUE" label="bbb">
<dmn:input id="_A0628B74-A903-4833-B4FC-CD0DA4688E48">
<dmn:inputExpression id="_2678C2CE-521B-4032-83F2-1760A14E20CB" typeRef="Any">
<dmn:text>aaa</dmn:text>
</dmn:inputExpression>
</dmn:input>
<dmn:output id="_2FB820B3-99DE-4709-B2CB-F88B196C5063" name="Output-2" />
<dmn:annotation name="Annotations" />
<dmn:rule id="_BF8CA92E-8BDA-43AB-AAD6-8CE7510F5D08">
<dmn:inputEntry id="_92915712-1449-4D81-8354-43EC22F18B7A">
<dmn:text>-</dmn:text>
</dmn:inputEntry>
<dmn:outputEntry id="_96A3DC02-EBD9-49A4-B9D9-43C2AD22666F">
<dmn:text>false</dmn:text>
</dmn:outputEntry>
<dmn:annotationEntry>
<dmn:text>// Your annotations here</dmn:text>
</dmn:annotationEntry>
</dmn:rule>
</dmn:decisionTable>
</dmn:decision>
and my understanding is name="Output-2"
should not be produced in the source XML.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for updates, some comments to code from my side. I postponed a manual check as there is a chance the code will change after posting my review.
...xed-expression-component/src/expressions/DecisionTableExpression/DecisionTableExpression.tsx
Outdated
Show resolved
Hide resolved
...xed-expression-component/src/expressions/DecisionTableExpression/DecisionTableExpression.tsx
Outdated
Show resolved
Hide resolved
@Kusuma04-dev Can you please synchronize this PR with main? Thx |
Thanks for your PR, @Kusuma04-dev ! I did some review and found some issues: Having only a single output column that is hidden (the default behavior):
Let me know if you need more clarification. Video bellow: |
Btw, maybe the issue 4 is not related to your PR, @Kusuma04-dev . |
Hi Yeser, done. |
Hi Daniel,Thanks for the
Hi Daniel,Thanks for the review .I have modified the validation now and the above issues are resolved.Can you please confirm once. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @danielzhe @Kusuma04-dev for the discussion and updates. I think there is still some small inconsistency that we should address.
Please follow my steps, when I create single output decision table:
then it contains this code snippet:
<output id="_781CCB4D-6421-4D4B-B15F-43FF9AE7CA3E" />
There is no typeRef
attribute 🟠
then there is code snippet:
<output id="_781CCB4D-6421-4D4B-B15F-43FF9AE7CA3E" name="Output-1" typeRef="boolean" />
<output id="_80267764-71E9-4444-A786-904ADBA52E04" name="Output-2" typeRef="number" />
that has both name
and typeRef
🟢
and when I delete one output column:
<output id="_80267764-71E9-4444-A786-904ADBA52E04" typeRef="number" />
that has typeRef
🟠
the places I mark with 🟠 are inconsistent. Both are decision tables with single output column, however once there is typeRef
and once there is not typeRef
.
… deleting 2nd output column
hi @jomarko , Thank you for reviewing and noticing the issue , |
There was a problem hiding this 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 updates.
…ss deleted then there should be only one output column ,as we have removed column name for single output type is also ignored
Thanks for the changes @Kusuma04-dev , the tests look good! I've been testing it out locally, and noticed that the Column Type is still there (but disabled). Wasn't the final decision to remove it, similar to column name? |
Hi Kennedy,Thanks for the review.Yes i have removed column type as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Kusuma04-dev,
Tested and everything is looking great! Just one minor nitpick regarding the tests, and then it will be ready to merge.
@@ -673,7 +665,7 @@ test.describe("Decision Table - Cells Data Type - Constraint", () => { | |||
await expect(beePropertiesPanel.decisionTableOutputHeader.getExpressionDataType()).toHaveValue( | |||
/^\s*rangeType\s$/i | |||
); | |||
await expect(beePropertiesPanel.decisionTableOutputHeader.getColumnDataType()).toHaveValue(/^\s*rangeType\s$/i); | |||
await expect(beePropertiesPanel.decisionTableOutputHeader.getDataType()).toHaveValue(/^\s*rangeType\s$/i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can just be deleted instead of changed from
getColumnDataType to getDataType.
It's preceded by
await expect(beePropertiesPanel.decisionTableOutputHeader.getExpressionDataType()).toHaveValue(
/^\s*rangeType\s$/i
);
And due to the nature of the 2 functions it's just checking the same thing twice in a row.
This happens in multiple test cases, so please update all of them accordingly! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getExpressionDataType())
Hi Kennedy,Thanks for the review .I did the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Kusuma, LGTM! @jomarko given all the changes would you like to rereview before merge?
closes apache/incubator-kie-issues#1466 - A Decision Table with a single output column shouldn't have a name
Before fix:
After fix: