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 54d41b55007 kie-issues#1919: Test Scenario Editor wrongly manages List
of complex object (#3050)
54d41b55007 is described below
commit 54d41b5500793d31caeb063a69a71b0d09c28254
Author: Yeser Amer <[email protected]>
AuthorDate: Wed Apr 9 21:14:01 2025 +0200
kie-issues#1919: Test Scenario Editor wrongly manages List of complex
object (#3050)
---
.../src/mutations/createNewDmnTypeTestScenario.ts | 3 +-
.../src/store/computed/computeDmnDataObjects.ts | 4 +-
.../stories/examples/AvailableDMNModels.ts | 15 +-
.../stories/examples/ExternalDmnModels.ts | 54 ++++++
.../stories/misc/collection/Collection.stories.tsx | 4 +-
.../misc/complexCollection/ComplexCollection.mdx | 39 ++++
.../ComplexCollection.stories.tsx} | 211 ++++++++++++++++-----
7 files changed, 276 insertions(+), 54 deletions(-)
diff --git
a/packages/scesim-editor/src/mutations/createNewDmnTypeTestScenario.ts
b/packages/scesim-editor/src/mutations/createNewDmnTypeTestScenario.ts
index edea66531e9..dc93aef4e80 100644
--- a/packages/scesim-editor/src/mutations/createNewDmnTypeTestScenario.ts
+++ b/packages/scesim-editor/src/mutations/createNewDmnTypeTestScenario.ts
@@ -194,8 +194,9 @@ function recursevlyNavigateItemComponent(
const currentItemDefinition =
allItemDefinitionsMap.has(itemComponent?.typeRef?.__$$text ?? "")
? allItemDefinitionsMap.get(itemComponent?.typeRef?.__$$text ?? "")
: itemComponent;
+ const isCollection = itemComponent?.["@_isCollection"] ?? false;
- if (!currentItemDefinition?.typeRef && currentItemDefinition?.itemComponent)
{
+ if (!currentItemDefinition?.typeRef && currentItemDefinition?.itemComponent
&& !isCollection) {
currentItemDefinition.itemComponent.forEach((nestedItemComponent) => {
factMappingsToReturn.push(
...recursevlyNavigateItemComponent(
diff --git a/packages/scesim-editor/src/store/computed/computeDmnDataObjects.ts
b/packages/scesim-editor/src/store/computed/computeDmnDataObjects.ts
index 85eac2c4ce3..7632332612e 100644
--- a/packages/scesim-editor/src/store/computed/computeDmnDataObjects.ts
+++ b/packages/scesim-editor/src/store/computed/computeDmnDataObjects.ts
@@ -101,8 +101,9 @@ function createChildrenTestScenarioObjects(
const currentItemDefinition =
allItemDefinitionsMap.has(itemComponent?.typeRef?.__$$text ?? "")
? allItemDefinitionsMap.get(itemComponent?.typeRef?.__$$text ?? "")
: itemComponent;
+ const isCollection = itemComponent["@_isCollection"] ?? false;
- if (!currentItemDefinition?.typeRef) {
+ if (!currentItemDefinition?.typeRef && !isCollection) {
const ns = createChildrenTestScenarioObjects(
currentItemDefinition,
allItemDefinitionsMap,
@@ -112,7 +113,6 @@ function createChildrenTestScenarioObjects(
nestedChildren.push(...ns);
}
- const isCollection = itemComponent["@_isCollection"] ?? false;
const name = itemComponent["@_name"];
const className = isCollection ? "java.util.List" :
itemComponent.typeRef?.__$$text;
diff --git a/packages/scesim-editor/stories/examples/AvailableDMNModels.ts
b/packages/scesim-editor/stories/examples/AvailableDMNModels.ts
index 4b135055404..4e320bd0657 100644
--- a/packages/scesim-editor/stories/examples/AvailableDMNModels.ts
+++ b/packages/scesim-editor/stories/examples/AvailableDMNModels.ts
@@ -20,7 +20,15 @@
import * as TestScenarioEditor from "../../src/TestScenarioEditor";
import { getMarshaller } from "@kie-tools/dmn-marshaller";
import { normalize } from
"@kie-tools/dmn-marshaller/dist/normalization/normalize";
-import { COLLECTION, EMPTY, LOAN_PRE_QUALIFICATION, MIXED, SIMPLE,
TRAFFIC_VIOLATION } from "./ExternalDmnModels";
+import {
+ COLLECTION,
+ COMPLEX_COLLECTION,
+ EMPTY,
+ LOAN_PRE_QUALIFICATION,
+ MIXED,
+ SIMPLE,
+ TRAFFIC_VIOLATION,
+} from "./ExternalDmnModels";
export const availableModels: TestScenarioEditor.ExternalDmn[] = [
{
@@ -28,6 +36,11 @@ export const availableModels:
TestScenarioEditor.ExternalDmn[] = [
svg: "",
normalizedPosixPathRelativeToTheOpenFile:
"dev-webapp/available-dmn-models/collection.dmn",
},
+ {
+ model: normalize(getMarshaller(COMPLEX_COLLECTION, { upgradeTo: "latest"
}).parser.parse()),
+ svg: "",
+ normalizedPosixPathRelativeToTheOpenFile:
"dev-webapp/available-dmn-models/complex_collection.dmn",
+ },
{
model: normalize(getMarshaller(EMPTY, { upgradeTo: "latest"
}).parser.parse()),
svg: "",
diff --git a/packages/scesim-editor/stories/examples/ExternalDmnModels.ts
b/packages/scesim-editor/stories/examples/ExternalDmnModels.ts
index bc0e41b6da5..eb2060a3324 100644
--- a/packages/scesim-editor/stories/examples/ExternalDmnModels.ts
+++ b/packages/scesim-editor/stories/examples/ExternalDmnModels.ts
@@ -1040,6 +1040,60 @@ export const EMPTY = `<?xml version="1.0"
encoding="UTF-8" ?>
<definitions xmlns="https://www.omg.org/spec/DMN/20230324/MODEL/"
expressionLanguage="https://www.omg.org/spec/DMN/20230324/FEEL/"
namespace="https://kie.org/dmn/_14487CEE-1B30-453E-976D-C11ED911548F"
id="_6FEE4554-BE5D-4F30-B523-6DFDA563221A" name="Empty"
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" />
`;
+export const COMPLEX_COLLECTION = `<?xml version="1.0" encoding="UTF-8" ?>
+<definitions xmlns="https://www.omg.org/spec/DMN/20230324/MODEL/"
expressionLanguage="https://www.omg.org/spec/DMN/20230324/FEEL/"
namespace="https://kie.org/dmn/_8D6316E7-ED43-4528-BB0B-2A7587B20853"
id="_A736BA8A-E346-48F8-8504-421B0CB288AD"
name="DMN_EE8B8820-C396-45D8-BB02-3317B5C43C3F"
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/extens [...]
+ <itemDefinition id="_41EE4053-C229-4E41-BD2D-832953944AB0" name="tPerson"
isCollection="false" typeLanguage="https://www.omg.org/spec/DMN/20230324/FEEL/">
+ <itemComponent id="_58BA4949-52D2-4482-978A-D7C0D48209F7" name="name"
isCollection="false" typeLanguage="https://www.omg.org/spec/DMN/20230324/FEEL/">
+ <typeRef>string</typeRef>
+ </itemComponent>
+ <itemComponent id="_45828076-7AB5-4F38-A40C-DEB2E9A098AF" name="age"
isCollection="false" typeLanguage="https://www.omg.org/spec/DMN/20230324/FEEL/">
+ <typeRef>number</typeRef>
+ </itemComponent>
+ </itemDefinition>
+ <itemDefinition id="_0072B1FA-04DA-4759-9933-50513F26B4EF" name="tTeam"
isCollection="false" typeLanguage="https://www.omg.org/spec/DMN/20230324/FEEL/">
+ <itemComponent id="_17166342-0AF1-4005-83BE-B5EBDE3CBF77" name="name"
isCollection="false" typeLanguage="https://www.omg.org/spec/DMN/20230324/FEEL/">
+ <typeRef>string</typeRef>
+ </itemComponent>
+ <itemComponent id="_B39FD1B3-05BA-4F9F-A240-4B2DC14E6530" name="people"
isCollection="true" typeLanguage="https://www.omg.org/spec/DMN/20230324/FEEL/">
+ <typeRef>tPerson</typeRef>
+ </itemComponent>
+ </itemDefinition>
+ <decision name="isHuge" id="_982FFEA7-F410-4EDD-8BB1-340FAA1C0F1F">
+ <variable name="isHuge" id="_AB149C33-D656-4887-A0FC-52DDA521C9A9"
typeRef="boolean" />
+ <informationRequirement id="_4C988496-B381-43C3-8187-F54A433BEFAB">
+ <requiredInput href="#_2CDCFED2-6202-49F5-8724-26331747F477" />
+ </informationRequirement>
+ <literalExpression id="_AB8BFDDB-5A6F-41EB-B91B-EAC05AE1D03A"
typeRef="boolean" label="isHuge">
+ <text>count(Team.people) > 3</text>
+ </literalExpression>
+ </decision>
+ <inputData name="Team" id="_2CDCFED2-6202-49F5-8724-26331747F477">
+ <variable name="Team" id="_0F9E50E7-F90D-4B58-B208-34C0898D6B33"
typeRef="tTeam" />
+ </inputData>
+ <dmndi:DMNDI>
+ <dmndi:DMNDiagram id="_FBF98DC8-E60B-47F1-8CC8-853F72D7B324" name="Default
DRD" useAlternativeInputDataShape="false">
+ <di:extension>
+ <kie:ComponentsWidthsExtension>
+ <kie:ComponentWidths
dmnElementRef="_AB8BFDDB-5A6F-41EB-B91B-EAC05AE1D03A">
+ <kie:width>190</kie:width>
+ </kie:ComponentWidths>
+ </kie:ComponentsWidthsExtension>
+ </di:extension>
+ <dmndi:DMNShape id="_33C12334-6CD6-4171-827E-B522C04EA7C1"
dmnElementRef="_982FFEA7-F410-4EDD-8BB1-340FAA1C0F1F" isCollapsed="false"
isListedInputData="false">
+ <dc:Bounds x="340" y="100" width="160" height="80" />
+ </dmndi:DMNShape>
+ <dmndi:DMNShape id="_AF43A8F2-23F1-40C5-A1E1-CF7CF7027EDB"
dmnElementRef="_2CDCFED2-6202-49F5-8724-26331747F477" isCollapsed="false"
isListedInputData="false">
+ <dc:Bounds x="340" y="320" width="160" height="80" />
+ </dmndi:DMNShape>
+ <dmndi:DMNEdge id="_BF3354A2-BD20-448B-A4C7-A29F63867F75"
dmnElementRef="_4C988496-B381-43C3-8187-F54A433BEFAB"
sourceElement="_AF43A8F2-23F1-40C5-A1E1-CF7CF7027EDB"
targetElement="_33C12334-6CD6-4171-827E-B522C04EA7C1">
+ <di:waypoint x="420" y="360" />
+ <di:waypoint x="420" y="180" />
+ </dmndi:DMNEdge>
+ </dmndi:DMNDiagram>
+ </dmndi:DMNDI>
+</definitions>
+`;
+
export const COLLECTION = `<?xml version="1.0" encoding="UTF-8"?>
<dmn:definitions xmlns:dmn="http://www.omg.org/spec/DMN/20180521/MODEL/"
xmlns="https://kie.apache.org/dmn/_D1C37750-2078-4CB7-AF77-850947718867"
xmlns:feel="http://www.omg.org/spec/DMN/20180521/FEEL/"
xmlns:kie="http://www.drools.org/kie/dmn/1.2"
xmlns:dmndi="http://www.omg.org/spec/DMN/20180521/DMNDI/"
xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/"
xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"
id="_DF7B05D2-BB62-417C-B852-48E260429F21" name="Collection"
typeLanguage="http:// [...]
<dmn:extensionElements/>
diff --git
a/packages/scesim-editor/stories/misc/collection/Collection.stories.tsx
b/packages/scesim-editor/stories/misc/collection/Collection.stories.tsx
index 545a60ac35c..adf1a1fe02f 100644
--- a/packages/scesim-editor/stories/misc/collection/Collection.stories.tsx
+++ b/packages/scesim-editor/stories/misc/collection/Collection.stories.tsx
@@ -165,7 +165,7 @@ export const collectionScesim = `<?xml version="1.0"
encoding="UTF-8" ?>
<name>_33694C8E-C795-435F-B0F0-F1101F9DE403</name>
<type>GIVEN</type>
</expressionIdentifier>
- <rawValue class="string">"[10,20,30]"</rawValue>
+ <rawValue class="string">[10,20,30]</rawValue>
</FactMappingValue>
<FactMappingValue>
<factIdentifier>
@@ -176,7 +176,7 @@ export const collectionScesim = `<?xml version="1.0"
encoding="UTF-8" ?>
<name>_11DBB39A-5749-420D-A007-3A0D19A66916</name>
<type>GIVEN</type>
</expressionIdentifier>
- <rawValue class="string">"[40,50,60]"</rawValue>
+ <rawValue class="string">[40,50,60]</rawValue>
</FactMappingValue>
<FactMappingValue>
<factIdentifier>
diff --git
a/packages/scesim-editor/stories/misc/complexCollection/ComplexCollection.mdx
b/packages/scesim-editor/stories/misc/complexCollection/ComplexCollection.mdx
new file mode 100644
index 00000000000..17cad40adb5
--- /dev/null
+++
b/packages/scesim-editor/stories/misc/complexCollection/ComplexCollection.mdx
@@ -0,0 +1,39 @@
+{/* Licensed to the Apache Software Foundation (ASF) under one */}
+{/* or more contributor license agreements. See the NOTICE file */}
+{/* distributed with this work for additional information */}
+{/* regarding copyright ownership. The ASF licenses this file */}
+{/* to you under the Apache License, Version 2.0 (the */}
+{/* "License"); you may not use this file except in compliance */}
+{/* with the License. You may obtain a copy of the License at */}
+{/* */}
+{/* http://www.apache.org/licenses/LICENSE-2.0 */}
+{/* */}
+{/* Unless required by applicable law or agreed to in writing, */}
+{/* software distributed under the License is distributed on an */}
+{/* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY */}
+{/* KIND, either express or implied. See the License for the */}
+{/* specific language governing permissions and limitations */}
+{/* under the License. */}
+
+import { Meta, Story } from "@storybook/blocks";
+import * as ComplexCollection from "./ComplexCollection.stories";
+
+<Meta title="MDX/ComplexCollection" of={ComplexCollection} />
+
+# Complex Collection
+
+This is an example of a Test Scenario with a column representing a List of
Complex DMN object.
+
+The related DMN is `complex_collection.dmn`, defined in the
`ExternalDmnModel.ts` file
+
+The GIVEN parameters of the Test Scenario are composed by a Team (of type
tTeam) input node. Its attributes are:
+
+- name : string (The team name)
+- people : List of tPerson (The list of the people in the team).
+
+tPerson type is composed by:
+
+- name : string
+- age : number
+
+The EXPECT paramenter determines if the team is huge or not (Based on the DMN
logic, a team is huge if cointains more than 3 people)
diff --git
a/packages/scesim-editor/stories/misc/collection/Collection.stories.tsx
b/packages/scesim-editor/stories/misc/complexCollection/ComplexCollection.stories.tsx
similarity index 52%
copy from packages/scesim-editor/stories/misc/collection/Collection.stories.tsx
copy to
packages/scesim-editor/stories/misc/complexCollection/ComplexCollection.stories.tsx
index 545a60ac35c..f98438f098a 100644
--- a/packages/scesim-editor/stories/misc/collection/Collection.stories.tsx
+++
b/packages/scesim-editor/stories/misc/complexCollection/ComplexCollection.stories.tsx
@@ -23,11 +23,11 @@ import { TestScenarioEditor } from
"../../../src/TestScenarioEditor";
import { SceSimEditorWrapper, StorybookTestScenarioEditorProps } from
"../../scesimEditorStoriesWrapper";
import { normalize } from
"@kie-tools/dmn-marshaller/dist/normalization/normalize";
import { getMarshaller as getDmnMarshaller } from "@kie-tools/dmn-marshaller";
-import { COLLECTION } from "../../examples/ExternalDmnModels";
+import { COMPLEX_COLLECTION } from "../../examples/ExternalDmnModels";
-export const collectionFileName = "collection.scesim";
+export const collectionFileName = "complex_collection.scesim";
export const collectionScesim = `<?xml version="1.0" encoding="UTF-8" ?>
-<ScenarioSimulationModel xmlns="https://kie.org/scesim/1.8" version="1.8">
+<ScenarioSimulationModel version="1.8">
<simulation>
<scesimModelDescriptor>
<factMappings>
@@ -64,68 +64,68 @@ export const collectionScesim = `<?xml version="1.0"
encoding="UTF-8" ?>
<FactMapping>
<expressionElements>
<ExpressionElement>
- <step>input</step>
+ <step>Team</step>
+ </ExpressionElement>
+ <ExpressionElement>
+ <step>name</step>
</ExpressionElement>
</expressionElements>
<expressionIdentifier>
- <name>_33694C8E-C795-435F-B0F0-F1101F9DE403</name>
+ <name>_39AB4241-7722-4608-A36B-39063D1CE681</name>
<type>GIVEN</type>
</expressionIdentifier>
<factIdentifier>
- <name>input</name>
- <className>tNumber</className>
+ <name>Team</name>
+ <className>tTeam</className>
</factIdentifier>
- <className>java.util.List</className>
- <factAlias>input</factAlias>
- <expressionAlias>value</expressionAlias>
- <genericTypes>
- <string>tNumber</string>
- </genericTypes>
- <columnWidth>141</columnWidth>
+ <className>string</className>
+ <factAlias>Team</factAlias>
+ <expressionAlias>name</expressionAlias>
+ <columnWidth>100</columnWidth>
<factMappingValueType>NOT_EXPRESSION</factMappingValueType>
</FactMapping>
<FactMapping>
<expressionElements>
<ExpressionElement>
- <step>input2</step>
+ <step>Team</step>
</ExpressionElement>
<ExpressionElement>
- <step>nums</step>
+ <step>people</step>
</ExpressionElement>
</expressionElements>
<expressionIdentifier>
- <name>_11DBB39A-5749-420D-A007-3A0D19A66916</name>
+ <name>_DB037929-348D-4631-92AB-77A9565E4646</name>
<type>GIVEN</type>
</expressionIdentifier>
<factIdentifier>
- <name>input2</name>
- <className>tComplex</className>
+ <name>Team</name>
+ <className>tTeam</className>
</factIdentifier>
<className>java.util.List</className>
- <factAlias>input2</factAlias>
- <expressionAlias>nums</expressionAlias>
+ <factAlias>Team</factAlias>
+ <expressionAlias>people</expressionAlias>
<genericTypes>
- <string>number</string>
+ <string>tPerson</string>
</genericTypes>
- <columnWidth>157</columnWidth>
+ <columnWidth>289</columnWidth>
<factMappingValueType>NOT_EXPRESSION</factMappingValueType>
</FactMapping>
<FactMapping>
<expressionElements>
<ExpressionElement>
- <step>output</step>
+ <step>isHuge</step>
</ExpressionElement>
</expressionElements>
<expressionIdentifier>
- <name>_E38BFF0C-040B-464E-8C18-7BD1C7372EEA</name>
+ <name>_4C87F59F-DBD2-42E6-A884-4D700AEDC2D0</name>
<type>EXPECT</type>
</expressionIdentifier>
<factIdentifier>
- <name>output</name>
+ <name>isHuge</name>
<className>boolean</className>
</factIdentifier>
<className>boolean</className>
- <factAlias>output</factAlias>
+ <factAlias>isHuge</factAlias>
<expressionAlias>value</expressionAlias>
<columnWidth>100</columnWidth>
<factMappingValueType>NOT_EXPRESSION</factMappingValueType>
@@ -155,36 +155,153 @@ export const collectionScesim = `<?xml version="1.0"
encoding="UTF-8" ?>
<name>Description</name>
<type>OTHER</type>
</expressionIdentifier>
+ <rawValue class="string">Empty team</rawValue>
+ </FactMappingValue>
+ <FactMappingValue>
+ <factIdentifier>
+ <name>Team</name>
+ <className>tTeam</className>
+ </factIdentifier>
+ <expressionIdentifier>
+ <name>_39AB4241-7722-4608-A36B-39063D1CE681</name>
+ <type>GIVEN</type>
+ </expressionIdentifier>
+ <rawValue class="string">"Team1"</rawValue>
+ </FactMappingValue>
+ <FactMappingValue>
+ <factIdentifier>
+ <name>Team</name>
+ <className>tTeam</className>
+ </factIdentifier>
+ <expressionIdentifier>
+ <name>_DB037929-348D-4631-92AB-77A9565E4646</name>
+ <type>GIVEN</type>
+ </expressionIdentifier>
+ <rawValue class="string">[]</rawValue>
+ </FactMappingValue>
+ <FactMappingValue>
+ <factIdentifier>
+ <name>isHuge</name>
+ <className>boolean</className>
+ </factIdentifier>
+ <expressionIdentifier>
+ <name>_4C87F59F-DBD2-42E6-A884-4D700AEDC2D0</name>
+ <type>EXPECT</type>
+ </expressionIdentifier>
+ <rawValue class="string">false</rawValue>
+ </FactMappingValue>
+ </factMappingValues>
+ </Scenario>
+ <Scenario>
+ <factMappingValues>
+ <FactMappingValue>
+ <factIdentifier>
+ <name>#</name>
+ <className>java.lang.Integer</className>
+ </factIdentifier>
+ <expressionIdentifier>
+ <name>Index</name>
+ <type>OTHER</type>
+ </expressionIdentifier>
+ </FactMappingValue>
+ <FactMappingValue>
+ <factIdentifier>
+ <name>Scenario description</name>
+ <className>java.lang.String</className>
+ </factIdentifier>
+ <expressionIdentifier>
+ <name>Description</name>
+ <type>OTHER</type>
+ </expressionIdentifier>
+ <rawValue class="string">A tiny little team</rawValue>
+ </FactMappingValue>
+ <FactMappingValue>
+ <factIdentifier>
+ <name>Team</name>
+ <className>tTeam</className>
+ </factIdentifier>
+ <expressionIdentifier>
+ <name>_39AB4241-7722-4608-A36B-39063D1CE681</name>
+ <type>GIVEN</type>
+ </expressionIdentifier>
+ <rawValue class="string">"Team 2"</rawValue>
+ </FactMappingValue>
+ <FactMappingValue>
+ <factIdentifier>
+ <name>Team</name>
+ <className>tTeam</className>
+ </factIdentifier>
+ <expressionIdentifier>
+ <name>_DB037929-348D-4631-92AB-77A9565E4646</name>
+ <type>GIVEN</type>
+ </expressionIdentifier>
+ <rawValue class="string">[{"name":
"\"John\"", "age": "10"},
{"name": "\"Ashley\"", "age":
"10"}, {"name": "\"Pete\"",
"age": "10"}]</rawValue>
+ </FactMappingValue>
+ <FactMappingValue>
+ <factIdentifier>
+ <name>isHuge</name>
+ <className>boolean</className>
+ </factIdentifier>
+ <expressionIdentifier>
+ <name>_4C87F59F-DBD2-42E6-A884-4D700AEDC2D0</name>
+ <type>EXPECT</type>
+ </expressionIdentifier>
+ <rawValue class="string">false</rawValue>
+ </FactMappingValue>
+ </factMappingValues>
+ </Scenario>
+ <Scenario>
+ <factMappingValues>
+ <FactMappingValue>
+ <factIdentifier>
+ <name>#</name>
+ <className>java.lang.Integer</className>
+ </factIdentifier>
+ <expressionIdentifier>
+ <name>Index</name>
+ <type>OTHER</type>
+ </expressionIdentifier>
+ </FactMappingValue>
+ <FactMappingValue>
+ <factIdentifier>
+ <name>Scenario description</name>
+ <className>java.lang.String</className>
+ </factIdentifier>
+ <expressionIdentifier>
+ <name>Description</name>
+ <type>OTHER</type>
+ </expressionIdentifier>
+ <rawValue class="string">A Huge team</rawValue>
</FactMappingValue>
<FactMappingValue>
<factIdentifier>
- <name>input</name>
- <className>tNumber</className>
+ <name>Team</name>
+ <className>tTeam</className>
</factIdentifier>
<expressionIdentifier>
- <name>_33694C8E-C795-435F-B0F0-F1101F9DE403</name>
+ <name>_39AB4241-7722-4608-A36B-39063D1CE681</name>
<type>GIVEN</type>
</expressionIdentifier>
- <rawValue class="string">"[10,20,30]"</rawValue>
+ <rawValue class="string">"Team 3"</rawValue>
</FactMappingValue>
<FactMappingValue>
<factIdentifier>
- <name>input2</name>
- <className>tComplex</className>
+ <name>Team</name>
+ <className>tTeam</className>
</factIdentifier>
<expressionIdentifier>
- <name>_11DBB39A-5749-420D-A007-3A0D19A66916</name>
+ <name>_DB037929-348D-4631-92AB-77A9565E4646</name>
<type>GIVEN</type>
</expressionIdentifier>
- <rawValue class="string">"[40,50,60]"</rawValue>
+ <rawValue class="string">[{"name":
"\"John\"", "age": "10"},
{"name": "\"Ashley\"", "age":
"10"}, {"name": "\"Pete\"",
"age": "10"}, {"name":
"\"Becky\"", "age": "24"}]</rawValue>
</FactMappingValue>
<FactMappingValue>
<factIdentifier>
- <name>output</name>
+ <name>isHuge</name>
<className>boolean</className>
</factIdentifier>
<expressionIdentifier>
- <name>_E38BFF0C-040B-464E-8C18-7BD1C7372EEA</name>
+ <name>_4C87F59F-DBD2-42E6-A884-4D700AEDC2D0</name>
<type>EXPECT</type>
</expressionIdentifier>
<rawValue class="string">true</rawValue>
@@ -232,10 +349,10 @@ export const collectionScesim = `<?xml version="1.0"
encoding="UTF-8" ?>
</scesimData>
</background>
<settings>
- <dmnFilePath>dev-webapp/available-dmn-models/collection.dmn</dmnFilePath>
+ <dmnFilePath>../../main/resources/ComplexCollection.dmn</dmnFilePath>
<type>DMN</type>
-
<dmnNamespace>https://kie.apache.org/dmn/_D1C37750-2078-4CB7-AF77-850947718867</dmnNamespace>
- <dmnName>Collection</dmnName>
+
<dmnNamespace>https://kie.org/dmn/_8D6316E7-ED43-4528-BB0B-2A7587B20853</dmnNamespace>
+ <dmnName>DMN_EE8B8820-C396-45D8-BB02-3317B5C43C3F</dmnName>
<skipFromBuild>false</skipFromBuild>
</settings>
<imports>
@@ -245,7 +362,7 @@ export const collectionScesim = `<?xml version="1.0"
encoding="UTF-8" ?>
`;
const meta: Meta<{}> = {
- title: "Misc/Collection",
+ title: "Misc/ComplexCollection",
component: TestScenarioEditor,
includeStories: /^[A-Z]/,
};
@@ -256,22 +373,20 @@ type Story = StoryObj<StorybookTestScenarioEditorProps>;
const marshaller = getMarshaller(collectionScesim);
const currentModel = marshaller.parser.parse();
const dmnModel = {
- normalizedPosixPathRelativeToTheOpenFile:
"dev-webapp/available-dmn-models/collection.dmn",
+ normalizedPosixPathRelativeToTheOpenFile:
"dev-webapp/available-dmn-models/complex_collection.dmn",
type: "dmn",
- model: normalize(getDmnMarshaller(COLLECTION ?? "", { upgradeTo: "latest"
}).parser.parse()),
+ model: normalize(getDmnMarshaller(COMPLEX_COLLECTION ?? "", { upgradeTo:
"latest" }).parser.parse()),
svg: "",
};
-export const Collection: Story = {
+export const ComplexCollection: Story = {
render: (args) => SceSimEditorWrapper(args),
args: {
model: marshaller.parser.parse(),
openFileNormalizedPosixPathRelativeToTheWorkspaceRoot: collectionFileName,
- externalModelsByNamespace: new Map([
- ["https://kie.apache.org/dmn/_D1C37750-2078-4CB7-AF77-850947718867",
dmnModel],
- ]),
+ externalModelsByNamespace: new
Map([["https://kie.org/dmn/_8D6316E7-ED43-4528-BB0B-2A7587B20853", dmnModel]]),
xml: marshaller.builder.build(currentModel),
- onRequestExternalModelsAvailableToInclude: () =>
Promise.resolve(["collection.dmn"]),
+ onRequestExternalModelsAvailableToInclude: () =>
Promise.resolve(["complex_collection.dmn"]),
onRequestExternalModelByPath: () => Promise.resolve(dmnModel),
},
};
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]