This is an automated email from the ASF dual-hosted git repository.
tiagobento pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git
The following commit(s) were added to refs/heads/main by this push:
new edcc26d99f4 kie-issues#2135: DMN Runner: Array results are not
displayed correctly (#3296)
edcc26d99f4 is described below
commit edcc26d99f48680b3c68b0255bc9f7d82bf25bf8
Author: Jozef Marko <[email protected]>
AuthorDate: Fri Oct 10 15:18:42 2025 +0200
kie-issues#2135: DMN Runner: Array results are not displayed correctly
(#3296)
---
packages/form-dmn/src/FormDmnOutputs.tsx | 2 +-
packages/unitables-dmn/src/DmnRunnerOutputsTable.tsx | 16 +++++++++++++---
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/packages/form-dmn/src/FormDmnOutputs.tsx
b/packages/form-dmn/src/FormDmnOutputs.tsx
index 9737257f8bc..3e146628e67 100644
--- a/packages/form-dmn/src/FormDmnOutputs.tsx
+++ b/packages/form-dmn/src/FormDmnOutputs.tsx
@@ -212,7 +212,7 @@ export function FormDmnOutputs({
return (
<>
{parentKey &&
<DescriptionListTerm>{parentKey}</DescriptionListTerm>}
- <i>(null)</i>
+ <i>[]</i>
</>
);
}
diff --git a/packages/unitables-dmn/src/DmnRunnerOutputsTable.tsx
b/packages/unitables-dmn/src/DmnRunnerOutputsTable.tsx
index 2d172654bdc..ef6f2c2a063 100644
--- a/packages/unitables-dmn/src/DmnRunnerOutputsTable.tsx
+++ b/packages/unitables-dmn/src/DmnRunnerOutputsTable.tsx
@@ -226,7 +226,13 @@ function OutputsBeeTable({
} else if (value === null) {
return "null";
} else if (Array.isArray(value)) {
- return value.map((element) => JSON.stringify(element, null,
2).replace(/"([^"]+)":/g, "$1:"));
+ return value.map((element) => {
+ if (typeof element === "string" || typeof element === "number" ||
typeof element === "boolean") {
+ return element.toString();
+ } else {
+ return JSON.stringify(element, null, 2).replace(/"([^"]+)":/g,
"$1:");
+ }
+ });
} else {
return JSON.stringify(value);
}
@@ -465,10 +471,14 @@ function OutputsBeeTable({
if (result !== null && !Array.isArray(result) && typeof result ===
"object") {
columnResults = deepFlattenObjectRow(result);
} else {
+ const extractedRowValue = getRowValue(result);
if (headerColumn.dataType === "context") {
- columnResults = { context: getRowValue(result) };
+ columnResults = { context: extractedRowValue };
} else {
- columnResults = { [`${decisionName}`]: getRowValue(result) };
+ columnResults = { [`${decisionName}`]: extractedRowValue };
+ }
+ if (Array.isArray(extractedRowValue)) {
+ extractedRowValue.forEach((elementValue, index) =>
(columnResults[`[${index}]`] = elementValue));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]