This is an automated email from the ASF dual-hosted git repository.
gitgabrio pushed a commit to branch main
in repository
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-runtimes.git
The following commit(s) were added to refs/heads/main by this push:
new 02c6b00b98 [incubator-kie-issues#1044] DMN: Copy shared models (#3458)
02c6b00b98 is described below
commit 02c6b00b983818bf0d8c17bc14c7e424c3060b0f
Author: Gabriele Cardosi <[email protected]>
AuthorDate: Tue Apr 2 15:19:49 2024 +0200
[incubator-kie-issues#1044] DMN: Copy shared models (#3458)
Co-authored-by: Gabriele-Cardosi <[email protected]>
---
.../kogito-codegen-decisions/pom.xml | 55 +++++
.../kogito/codegen/decision/CodegenUtilsTest.java | 19 +-
.../codegen/decision/DecisionCodegenTest.java | 2 +-
.../resources/decision-empty-name/vacationDays.dmn | 247 ++++++++++++++++-----
.../Traffic Violation.dmn | 241 --------------------
5 files changed, 256 insertions(+), 308 deletions(-)
diff --git a/kogito-codegen-modules/kogito-codegen-decisions/pom.xml
b/kogito-codegen-modules/kogito-codegen-decisions/pom.xml
index 5b72746941..52b841b01d 100644
--- a/kogito-codegen-modules/kogito-codegen-decisions/pom.xml
+++ b/kogito-codegen-modules/kogito-codegen-decisions/pom.xml
@@ -33,6 +33,7 @@
<properties>
<java.module.name>org.kie.kogito.codegen.decision</java.module.name>
+ <dependency-plugin.version>3.6.1</dependency-plugin.version>
</properties>
<dependencyManagement>
@@ -44,6 +45,12 @@
<type>pom</type>
<scope>import</scope>
</dependency>
+ <dependency>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-dmn-test-resources</artifactId>
+ <version>${project.version}</version>
+ <classifier>tests</classifier>
+ </dependency>
</dependencies>
</dependencyManagement>
@@ -73,6 +80,12 @@
<!-- test -->
+ <dependency>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-dmn-test-resources</artifactId>
+ <classifier>tests</classifier>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-codegen-api</artifactId>
@@ -110,4 +123,46 @@
</dependency>
</dependencies>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ <testResource>
+
<directory>${project.build.directory}/generated-test-resources</directory>
+ </testResource>
+ </testResources>
+ <plugins>
+ <!-- Unpack DMN resources from org.kie:kie-dmn-test-resources -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>${dependency-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>generate-test-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.kie</groupId>
+ <artifactId>kie-dmn-test-resources</artifactId>
+ <version>${project.version}</version>
+ <classifier>tests</classifier>
+ <type>jar</type>
+ <overWrite>true</overWrite>
+
<outputDirectory>${project.build.directory}/generated-test-resources</outputDirectory>
+ <includes>**/*.dmn</includes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
\ No newline at end of file
diff --git
a/kogito-codegen-modules/kogito-codegen-decisions/src/test/java/org/kie/kogito/codegen/decision/CodegenUtilsTest.java
b/kogito-codegen-modules/kogito-codegen-decisions/src/test/java/org/kie/kogito/codegen/decision/CodegenUtilsTest.java
index 9accd55530..599c49c222 100644
---
a/kogito-codegen-modules/kogito-codegen-decisions/src/test/java/org/kie/kogito/codegen/decision/CodegenUtilsTest.java
+++
b/kogito-codegen-modules/kogito-codegen-decisions/src/test/java/org/kie/kogito/codegen/decision/CodegenUtilsTest.java
@@ -42,7 +42,8 @@ class CodegenUtilsTest {
@Test
void getDefinitionsFileFromModelWithSpace() {
- File dmnFile = FileUtils.getFile("Traffic Violation.dmn");
+ String modelFile = "Traffic Violation Simple.dmn";
+ File dmnFile = FileUtils.getFile(modelFile);
assertNotNull(dmnFile);
assertTrue(dmnFile.exists());
Resource dmnResource = new FileSystemResource(dmnFile,
StandardCharsets.UTF_8.name());
@@ -53,15 +54,15 @@ class CodegenUtilsTest {
.fromResources(Collections.singleton(dmnResource))
.getOrElseThrow(e -> new RuntimeException("Error compiling DMN
model(s)", e));
assertThat(dmnRuntime.getModels()).hasSize(1);
- final DMNModel dmnModel =
dmnRuntime.getModel("https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF",
"Traffic Violation Model Name");
+ final DMNModel dmnModel =
dmnRuntime.getModel("https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF",
"Traffic Violation");
assertNotNull(dmnModel);
- String expected = "Traffic_Violation.json";
+ String expected = "Traffic_Violation_Simple.json";
assertEquals(expected,
CodegenUtils.getDefinitionsFileFromModel(dmnModel));
}
@Test
void geNameForDefinitionsFileWithSourcePath() {
- File dmnFile = FileUtils.getFile("Traffic Violation.dmn");
+ File dmnFile = FileUtils.getFile("Traffic Violation Simple.dmn");
assertNotNull(dmnFile);
assertTrue(dmnFile.exists());
Resource dmnResource = new FileSystemResource(dmnFile,
StandardCharsets.UTF_8.name());
@@ -71,23 +72,23 @@ class CodegenUtilsTest {
.fromResources(Collections.singleton(dmnResource))
.getOrElseThrow(e -> new RuntimeException("Error compiling DMN
model(s)", e));
assertThat(dmnRuntime.getModels()).hasSize(1);
- final DMNModel dmnModel =
dmnRuntime.getModel("https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF",
"Traffic Violation Model Name");
+ final DMNModel dmnModel =
dmnRuntime.getModel("https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF",
"Traffic Violation");
assertNotNull(dmnModel);
- String expected = "Traffic Violation.dmn";
+ String expected = "Traffic Violation Simple.dmn";
assertEquals(expected,
CodegenUtils.geNameForDefinitionsFile(dmnModel));
}
@Test
void geNameForDefinitionsFileWithoutSourcePath() throws
FileNotFoundException {
- File dmnFile = FileUtils.getFile("Traffic Violation.dmn");
+ File dmnFile = FileUtils.getFile("Traffic Violation Simple.dmn");
assertNotNull(dmnFile);
assertTrue(dmnFile.exists());
DMNRuntime dmnRuntime = DMNKogito.createGenericDMNRuntime(new
FileReader(dmnFile));
assertNotNull(dmnRuntime);
assertThat(dmnRuntime.getModels()).hasSize(1);
- final DMNModel dmnModel =
dmnRuntime.getModel("https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF",
"Traffic Violation Model Name");
+ final DMNModel dmnModel =
dmnRuntime.getModel("https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF",
"Traffic Violation");
assertNotNull(dmnModel);
- String expected = "Traffic Violation Model Name.dmn";
+ String expected = "Traffic Violation.dmn";
assertEquals(expected,
CodegenUtils.geNameForDefinitionsFile(dmnModel));
}
}
diff --git
a/kogito-codegen-modules/kogito-codegen-decisions/src/test/java/org/kie/kogito/codegen/decision/DecisionCodegenTest.java
b/kogito-codegen-modules/kogito-codegen-decisions/src/test/java/org/kie/kogito/codegen/decision/DecisionCodegenTest.java
index 962d99632e..9e3a9438bb 100644
---
a/kogito-codegen-modules/kogito-codegen-decisions/src/test/java/org/kie/kogito/codegen/decision/DecisionCodegenTest.java
+++
b/kogito-codegen-modules/kogito-codegen-decisions/src/test/java/org/kie/kogito/codegen/decision/DecisionCodegenTest.java
@@ -212,7 +212,7 @@ public class DecisionCodegenTest {
public void emptyName(KogitoBuildContext.Builder contextBuilder) {
DecisionCodegen codeGenerator =
getDecisionCodegen("src/test/resources/decision-empty-name", contextBuilder);
RuntimeException re = Assertions.assertThrows(RuntimeException.class,
codeGenerator::generate);
- String expected = "DMN: Invalid name '': Name cannot be null or empty
(DMN id: _f27bb64b-6fc7-4e1f-9848-11ba35e0df44, The listed name is not a valid
FEEL identifier)";
+ String expected = "DMN: Invalid name '': Name cannot be null or empty
(DMN id: _9efe7fc6-f41b-422c-accd-95dcaaa67a39, The listed name is not a valid
FEEL identifier)";
assertTrue(re.getMessage().contains(expected));
}
diff --git
a/kogito-codegen-modules/kogito-codegen-decisions/src/test/resources/decision-empty-name/vacationDays.dmn
b/kogito-codegen-modules/kogito-codegen-decisions/src/test/resources/decision-empty-name/vacationDays.dmn
index 69a239b267..e6b96c58a7 100644
---
a/kogito-codegen-modules/kogito-codegen-decisions/src/test/resources/decision-empty-name/vacationDays.dmn
+++
b/kogito-codegen-modules/kogito-codegen-decisions/src/test/resources/decision-empty-name/vacationDays.dmn
@@ -1,63 +1,196 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<dmn:definitions
xmlns="http://www.trisotech.com/dmn/definitions/_f27bb64b-6fc7-4e1f-9848-11ba35e0df44"
- xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"
- xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/"
- xmlns:dmndi="https://www.omg.org/spec/DMN/20230324/DMNDI/"
- xmlns:feel="https://www.omg.org/spec/DMN/20230324/FEEL/"
- xmlns:dmn="https://www.omg.org/spec/DMN/20230324/MODEL/"
- xmlns:tc="http://www.omg.org/spec/DMN/20160719/testcase"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- exporter="DMN Modeler"
- exporterVersion="6.0.3.201802231629"
- id="_f27bb64b-6fc7-4e1f-9848-11ba35e0df44"
- name=""
-
namespace="http://www.trisotech.com/dmn/definitions/_f27bb64b-6fc7-4e1f-9848-11ba35e0df44">
- <dmn:extensionElements>
- </dmn:extensionElements>
- <dmn:itemDefinition id="_63824D3F-9173-446D-A940-6A7F0FA056BB"
name="tPerson" isCollection="false">
- <dmn:itemComponent id="_9bb0759c-b3c1-482f-87f5-c047dc65cef0" name="name">
- <dmn:typeRef>string</dmn:typeRef>
- </dmn:itemComponent>
- <dmn:itemComponent id="_929acc15-101c-4e49-9b11-494fff411e50" name="age">
+<dmn:definitions xmlns:dmn="http://www.omg.org/spec/DMN/20180521/MODEL/"
xmlns="decision" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/"
xmlns:kie="http://www.drools.org/kie/dmn/1.2"
xmlns:dmndi="http://www.omg.org/spec/DMN/20180521/DMNDI/"
xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"
xmlns:feel="http://www.omg.org/spec/DMN/20180521/FEEL/"
id="_9efe7fc6-f41b-422c-accd-95dcaaa67a39" name=""
typeLanguage="http://www.omg.org/spec/DMN/20180521/FEEL/" namespace="decision">
+ <dmn:extensionElements/>
+ <dmn:itemDefinition id="_77BCBBC4-3599-49B2-9C72-EF94037F83FC"
name="tAddress" isCollection="false">
+ <dmn:itemComponent id="_2c4e3950-8304-4f47-b04a-3d440df9ef82"
name="street" isCollection="false">
+ <dmn:typeRef>string</dmn:typeRef>
+ </dmn:itemComponent>
+ <dmn:itemComponent id="_629c8baf-7b05-4144-949c-22bafd14c0fb" name="city"
isCollection="false">
+ <dmn:typeRef>string</dmn:typeRef>
+ </dmn:itemComponent>
+ <dmn:itemComponent id="_c766b628-2079-4e01-81ba-c2e79cb0dbf5"
name="zipCode" isCollection="false">
+ <dmn:typeRef>string</dmn:typeRef>
+ </dmn:itemComponent>
+ <dmn:itemComponent id="_49d284b2-1ff1-4b8a-b533-ac12c49146a0"
name="country" isCollection="false">
+ <dmn:typeRef>string</dmn:typeRef>
+ </dmn:itemComponent>
+ </dmn:itemDefinition>
+ <dmn:itemDefinition id="_F3190760-6356-4CEB-A694-433F2E2ECB13"
name="tEmployee" isCollection="false">
+ <dmn:itemComponent id="_19795644-4d75-4618-9922-6e3009294f27"
name="firstName" isCollection="false">
+ <dmn:typeRef>string</dmn:typeRef>
+ </dmn:itemComponent>
+ <dmn:itemComponent id="_8af0d078-2fa5-4929-9821-d3c6328330d1"
name="lastName" isCollection="false">
+ <dmn:typeRef>string</dmn:typeRef>
+ </dmn:itemComponent>
+ <dmn:itemComponent id="_67a5b40e-7616-41f7-857e-8e74ff2ea9d0"
name="personalId" isCollection="false">
+ <dmn:typeRef>string</dmn:typeRef>
+ </dmn:itemComponent>
+ <dmn:itemComponent id="_4004aa03-31c6-4aee-8b7a-2120b679d6f9"
name="birthDate" isCollection="false">
+ <dmn:typeRef>Any</dmn:typeRef>
+ </dmn:itemComponent>
+ <dmn:itemComponent id="_26e93058-1683-427e-b013-7159fcaafe81"
name="address" isCollection="false">
+ <dmn:typeRef>tAddress</dmn:typeRef>
+ </dmn:itemComponent>
+ </dmn:itemDefinition>
+ <dmn:itemDefinition id="_D30FD01A-1017-4D96-B59F-0B73ADC8D7B2"
name="tPayroll" isCollection="false">
+ <dmn:itemComponent id="_cddacc9c-69a7-44bf-bb6a-500754af2ea1"
name="vacationDays" isCollection="false">
+ <dmn:typeRef>number</dmn:typeRef>
+ </dmn:itemComponent>
+ <dmn:itemComponent id="_9bae87e7-0171-40c3-9f14-187268bd70ce"
name="taxRate" isCollection="false">
<dmn:typeRef>number</dmn:typeRef>
</dmn:itemComponent>
+ <dmn:itemComponent id="_98ccb461-70dc-45fc-9a73-f5fa6ea4efa6"
name="paymentDate" isCollection="false">
+ <dmn:typeRef>string</dmn:typeRef>
+ </dmn:itemComponent>
+ <dmn:itemComponent id="_9180ce6c-817a-4769-81a6-a99bace8fa3a"
name="employee" isCollection="false">
+ <dmn:typeRef>tEmployee</dmn:typeRef>
+ </dmn:itemComponent>
</dmn:itemDefinition>
-
- <dmn:inputData id="_51190b90-924d-479b-872b-4c6f3486c2de" name="An Imported
Person">
- <dmn:variable id="_44a44de4-c0ab-408e-9ba9-983d8ec2f6c6"
- name="An Imported Person"
- typeRef="tPerson"/>
+ <dmn:inputData id="_89e85ee4-f052-4977-bee5-a3b81a600c6c" name="employee">
+ <dmn:extensionElements/>
+ <dmn:variable id="_682874bf-b580-4a33-858d-7c1c4c8b9f3e" name="employee"/>
</dmn:inputData>
- <dmn:decision id="_bf4a9628-15ae-4887-97f2-7099426cb61g" name="Remote
Greeting">
- <dmn:variable id="_ecc6e0bb-a0af-4e99-aac6-5b8bed09c549"
- name="Remote Greeting"
- typeRef="string"/>
- <dmn:informationRequirement>
- <dmn:requiredInput href="#_51190b90-924d-479b-872b-4c6f3486c2de"/>
+ <dmn:decision id="_eac3ef9e-37de-4dca-8802-ee08ded9e268" name="vacationDays">
+ <dmn:extensionElements/>
+ <dmn:variable id="_92a674f9-ebf5-4605-aa18-4731239cffe2"
name="vacationDays" typeRef="number"/>
+ <dmn:informationRequirement id="_5e303927-d1c9-403c-a1b2-2af72044737d">
+ <dmn:requiredInput href="#_89e85ee4-f052-4977-bee5-a3b81a600c6c"/>
+ </dmn:informationRequirement>
+ <dmn:decisionTable id="_c7a83474-a6bc-49c6-8296-4428c9285f4d"
typeRef="number" hitPolicy="UNIQUE" preferredOrientation="Rule-as-Row"
outputLabel="vacationDays">
+ <dmn:input id="_22cc8d8b-037c-4d0b-a00d-9e0943b1278a">
+ <dmn:inputExpression id="_8B01AC29-3610-4661-92FE-C0B8A6EFA828"
typeRef="string">
+ <dmn:text>employee.address.country</dmn:text>
+ </dmn:inputExpression>
+ </dmn:input>
+ <dmn:output id="_ebc17c96-82c4-4373-ac30-4dbae4b4c886">
+ <dmn:defaultOutputEntry id="_F6809D61-1EE0-439B-8B00-3590D3922529">
+ <dmn:text>15</dmn:text>
+ </dmn:defaultOutputEntry>
+ </dmn:output>
+ <dmn:rule id="_a346eaa2-d5f3-48b7-8623-348e53b26d4c">
+ <dmn:inputEntry id="_94a86171-b02d-493a-b3a7-f333402dfe71">
+ <dmn:text>"US"</dmn:text>
+ </dmn:inputEntry>
+ <dmn:outputEntry id="_f42f5ec5-0f78-4a82-b769-9027ef1545f8">
+ <dmn:text>10</dmn:text>
+ </dmn:outputEntry>
+ </dmn:rule>
+ <dmn:rule id="_f2778f91-68e7-4af8-bbd8-7ba73c0ad3d0">
+ <dmn:inputEntry id="_13ea8161-c6c9-4810-a50f-59b639c74729">
+ <dmn:text>"IT"</dmn:text>
+ </dmn:inputEntry>
+ <dmn:outputEntry id="_311804d4-3ecb-4a9d-9674-5e96a600058f">
+ <dmn:text>20</dmn:text>
+ </dmn:outputEntry>
+ </dmn:rule>
+ </dmn:decisionTable>
+ </dmn:decision>
+ <dmn:decision id="_5b8d18fb-39d8-4f5c-84a0-b79913b7aded" name="compute
Payroll">
+ <dmn:extensionElements/>
+ <dmn:variable id="_81066090-2dba-43d3-89ca-8144b20d73b8" name="compute
Payroll" typeRef="tPayroll"/>
+ <dmn:informationRequirement id="_de1a99cb-c0c9-4e58-be9c-dc619e856fa6">
+ <dmn:requiredDecision href="#_eac3ef9e-37de-4dca-8802-ee08ded9e268"/>
+ </dmn:informationRequirement>
+ <dmn:informationRequirement id="_621c38e6-638b-4907-bbc4-e7daf9d4272d">
+ <dmn:requiredInput href="#_89e85ee4-f052-4977-bee5-a3b81a600c6c"/>
</dmn:informationRequirement>
- <dmn:knowledgeRequirement>
- <dmn:requiredKnowledge href="#_32543811-b499-4608-b784-6c6f294b1c58"/>
- </dmn:knowledgeRequirement>
- <dmn:literalExpression
xmlns:triso="http://www.trisotech.com/2015/triso/modeling"
- id="_d7e6836b-8491-487a-a653-5735daa85bf2"
- triso:unparsed="true">
- <dmn:text>Say Hello( An Imported Person )</dmn:text>
- </dmn:literalExpression>
+ <dmn:context id="_d1950d38-3f02-4339-af1b-aaeeed847baa" typeRef="tPayroll">
+ <dmn:contextEntry>
+ <dmn:variable id="_7a08f51d-28b5-4cd0-b508-8eaaedfcf48b"
name="employee"/>
+ <dmn:literalExpression id="_590f5f1d-bc73-43e4-8b87-1b18ee5b5d8d">
+ <dmn:text>employee</dmn:text>
+ </dmn:literalExpression>
+ </dmn:contextEntry>
+ <dmn:contextEntry>
+ <dmn:variable id="_065dbf8c-b4a0-4e1c-8484-2e7933907796"
name="paymentDate" typeRef="string"/>
+ <dmn:literalExpression id="_02d83b5e-33ff-4075-8edc-de24f4c5bd57">
+ <dmn:text>null</dmn:text>
+ </dmn:literalExpression>
+ </dmn:contextEntry>
+ <dmn:contextEntry>
+ <dmn:variable id="_fd31c524-408d-453a-9849-f7a5a35e469c"
name="vacationDays" typeRef="number"/>
+ <dmn:literalExpression id="_5ec20766-f390-4a66-b146-8f6c2239ceb5">
+ <dmn:text>vacationDays</dmn:text>
+ </dmn:literalExpression>
+ </dmn:contextEntry>
+ <dmn:contextEntry>
+ <dmn:variable id="_d1845af2-3a42-44b6-9037-b76f71b71193"
name="taxRate" typeRef="number"/>
+ <dmn:literalExpression id="_3db60313-218f-4384-b34c-8188afb3d0a8">
+ <dmn:text>null</dmn:text>
+ </dmn:literalExpression>
+ </dmn:contextEntry>
+ </dmn:context>
</dmn:decision>
-
- <dmn:businessKnowledgeModel id="_32543811-b499-4608-b784-6c6f294b1c58"
name="Say Hello">
- <dmn:variable id="_a8eb10e1-30e6-40d8-a564-a868f4e0af34"
- name="Say Hello"
- typeRef="string"/>
- <dmn:encapsulatedLogic kind="FEEL"
id="_acbb96c9-34a3-4628-8179-dfc5f583e695">
- <dmn:formalParameter id="_4a626f74-2ecc-4759-b76a-04baec6b795d"
- name="Person"
- typeRef="tPerson"/>
- <dmn:literalExpression id="_c173a894-3719-4d2f-a365-25850e217310">
- <dmn:text>"Hello " + Person.name + "!"</dmn:text>
- </dmn:literalExpression>
- </dmn:encapsulatedLogic>
- </dmn:businessKnowledgeModel>
-
-</dmn:definitions>
+ <dmn:decisionService id="_fcf22829-0fd8-4f41-919e-3e909f01fbff" name="days">
+ <dmn:extensionElements/>
+ <dmn:variable id="_8ea3497e-8969-4aa6-9a39-254e4e8edea5" name="days"
typeRef="Any"/>
+ <dmn:outputDecision href="#_5b8d18fb-39d8-4f5c-84a0-b79913b7aded"/>
+ <dmn:encapsulatedDecision href="#_eac3ef9e-37de-4dca-8802-ee08ded9e268"/>
+ <dmn:inputData href="#_89e85ee4-f052-4977-bee5-a3b81a600c6c"/>
+ </dmn:decisionService>
+ <dmndi:DMNDI>
+ <dmndi:DMNDiagram>
+ <di:extension>
+ <kie:ComponentsWidthsExtension>
+ <kie:ComponentWidths
dmnElementRef="_c7a83474-a6bc-49c6-8296-4428c9285f4d"/>
+ <kie:ComponentWidths
dmnElementRef="_d1950d38-3f02-4339-af1b-aaeeed847baa"/>
+ <kie:ComponentWidths
dmnElementRef="_590f5f1d-bc73-43e4-8b87-1b18ee5b5d8d"/>
+ <kie:ComponentWidths
dmnElementRef="_02d83b5e-33ff-4075-8edc-de24f4c5bd57"/>
+ <kie:ComponentWidths
dmnElementRef="_5ec20766-f390-4a66-b146-8f6c2239ceb5"/>
+ <kie:ComponentWidths
dmnElementRef="_3db60313-218f-4384-b34c-8188afb3d0a8"/>
+ </kie:ComponentsWidthsExtension>
+ </di:extension>
+ <dmndi:DMNShape
xmlns:p0="http://www.trisotech.com/definitions/_9efe7fc6-f41b-422c-accd-95dcaaa67a39"
id="dmnshape-_89e85ee4-f052-4977-bee5-a3b81a600c6c"
dmnElementRef="p0:_89e85ee4-f052-4977-bee5-a3b81a600c6c" isCollapsed="false">
+ <dmndi:DMNStyle>
+ <dmndi:FillColor red="255" green="255" blue="255"/>
+ <dmndi:StrokeColor red="0" green="0" blue="0"/>
+ <dmndi:FontColor red="0" green="0" blue="0"/>
+ </dmndi:DMNStyle>
+ <dc:Bounds x="260" y="320.99999618530273" width="135.48234176635742"
height="60.00000762939453"/>
+ <dmndi:DMNLabel/>
+ </dmndi:DMNShape>
+ <dmndi:DMNShape
xmlns:p1="http://www.trisotech.com/definitions/_9efe7fc6-f41b-422c-accd-95dcaaa67a39"
id="dmnshape-_eac3ef9e-37de-4dca-8802-ee08ded9e268"
dmnElementRef="p1:_eac3ef9e-37de-4dca-8802-ee08ded9e268" isCollapsed="false">
+ <dmndi:DMNStyle>
+ <dmndi:FillColor red="255" green="255" blue="255"/>
+ <dmndi:StrokeColor red="0" green="0" blue="0"/>
+ <dmndi:FontColor red="0" green="0" blue="0"/>
+ </dmndi:DMNStyle>
+ <dc:Bounds x="951.7411708831787" y="348" width="153" height="60"/>
+ <dmndi:DMNLabel/>
+ </dmndi:DMNShape>
+ <dmndi:DMNShape
xmlns:p2="http://www.trisotech.com/definitions/_9efe7fc6-f41b-422c-accd-95dcaaa67a39"
id="dmnshape-_5b8d18fb-39d8-4f5c-84a0-b79913b7aded"
dmnElementRef="p2:_5b8d18fb-39d8-4f5c-84a0-b79913b7aded" isCollapsed="false">
+ <dmndi:DMNStyle>
+ <dmndi:FillColor red="255" green="255" blue="255"/>
+ <dmndi:StrokeColor red="0" green="0" blue="0"/>
+ <dmndi:FontColor red="0" green="0" blue="0"/>
+ </dmndi:DMNStyle>
+ <dc:Bounds x="828.7411708831787" y="228" width="153" height="60"/>
+ <dmndi:DMNLabel/>
+ </dmndi:DMNShape>
+ <dmndi:DMNShape
xmlns:p3="http://www.trisotech.com/definitions/_9efe7fc6-f41b-422c-accd-95dcaaa67a39"
id="dmnshape-_fcf22829-0fd8-4f41-919e-3e909f01fbff"
dmnElementRef="p3:_fcf22829-0fd8-4f41-919e-3e909f01fbff" isCollapsed="false">
+ <dmndi:DMNStyle>
+ <dmndi:FillColor red="255" green="255" blue="255"/>
+ <dmndi:StrokeColor red="0" green="0" blue="0"/>
+ <dmndi:FontColor red="0" green="0" blue="0"/>
+ </dmndi:DMNStyle>
+ <dc:Bounds x="192.5" y="49" width="367.7411708831787" height="250"/>
+ <dmndi:DMNLabel/>
+ <dmndi:DMNDecisionServiceDividerLine>
+ <di:waypoint x="192.5" y="178"/>
+ <di:waypoint x="560.2411708831787" y="178"/>
+ </dmndi:DMNDecisionServiceDividerLine>
+ </dmndi:DMNShape>
+ <dmndi:DMNEdge
xmlns:p4="http://www.trisotech.com/definitions/_9efe7fc6-f41b-422c-accd-95dcaaa67a39"
id="dmnedge-_5e303927-d1c9-403c-a1b2-2af72044737d"
dmnElementRef="p4:_5e303927-d1c9-403c-a1b2-2af72044737d">
+ <di:waypoint x="396.2379722595215" y="350.99999618530273"/>
+ <di:waypoint x="1028.2411708831787" y="408"/>
+ </dmndi:DMNEdge>
+ <dmndi:DMNEdge
xmlns:p5="http://www.trisotech.com/definitions/_9efe7fc6-f41b-422c-accd-95dcaaa67a39"
id="dmnedge-_de1a99cb-c0c9-4e58-be9c-dc619e856fa6"
dmnElementRef="p5:_de1a99cb-c0c9-4e58-be9c-dc619e856fa6">
+ <di:waypoint x="1028.2411708831787" y="348"/>
+ <di:waypoint x="955.2411708831787" y="288"/>
+ </dmndi:DMNEdge>
+ <dmndi:DMNEdge
xmlns:p6="http://www.trisotech.com/definitions/_9efe7fc6-f41b-422c-accd-95dcaaa67a39"
id="dmnedge-_621c38e6-638b-4907-bbc4-e7daf9d4272d"
dmnElementRef="p6:_621c38e6-638b-4907-bbc4-e7daf9d4272d">
+ <di:waypoint x="327.7379722595215" y="320.99999618530273"/>
+ <di:waypoint x="905.2411708831787" y="288"/>
+ </dmndi:DMNEdge>
+ </dmndi:DMNDiagram>
+ </dmndi:DMNDI>
+</dmn:definitions>
\ No newline at end of file
diff --git
a/kogito-codegen-modules/kogito-codegen-decisions/src/test/resources/decision-model-space-name/Traffic
Violation.dmn
b/kogito-codegen-modules/kogito-codegen-decisions/src/test/resources/decision-model-space-name/Traffic
Violation.dmn
deleted file mode 100644
index 7665bc2c90..0000000000
---
a/kogito-codegen-modules/kogito-codegen-decisions/src/test/resources/decision-model-space-name/Traffic
Violation.dmn
+++ /dev/null
@@ -1,241 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<dmn:definitions xmlns:dmn="http://www.omg.org/spec/DMN/20180521/MODEL/"
-
xmlns="https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF"
- xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/"
- xmlns:kie="http://www.drools.org/kie/dmn/1.2"
- xmlns:feel="http://www.omg.org/spec/DMN/20180521/FEEL/"
- xmlns:dmndi="http://www.omg.org/spec/DMN/20180521/DMNDI/"
- xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"
- id="_1C792953-80DB-4B32-99EB-25FBE32BAF9E"
- name="Traffic Violation Model Name"
-
expressionLanguage="http://www.omg.org/spec/DMN/20180521/FEEL/"
- typeLanguage="http://www.omg.org/spec/DMN/20180521/FEEL/"
-
namespace="https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF">
- <dmn:extensionElements/>
- <dmn:itemDefinition id="_63824D3F-9173-446D-A940-6A7F0FA056BB"
name="tDriver" isCollection="false">
- <dmn:itemComponent id="_9DAB5DAA-3B44-4F6D-87F2-95125FB2FEE4" name="Name"
isCollection="false">
- <dmn:typeRef>string</dmn:typeRef>
- </dmn:itemComponent>
- <dmn:itemComponent id="_856BA8FA-EF7B-4DF9-A1EE-E28263CE9955" name="Age"
isCollection="false">
- <dmn:typeRef>number</dmn:typeRef>
- </dmn:itemComponent>
- <dmn:itemComponent id="_FDC2CE03-D465-47C2-A311-98944E8CC23F" name="State"
isCollection="false">
- <dmn:typeRef>string</dmn:typeRef>
- </dmn:itemComponent>
- <dmn:itemComponent id="_D6FD34C4-00DC-4C79-B1BF-BBCF6FC9B6D7" name="City"
isCollection="false">
- <dmn:typeRef>string</dmn:typeRef>
- </dmn:itemComponent>
- <dmn:itemComponent id="_7110FE7E-1A38-4C39-B0EB-AEEF06BA37F4"
name="Points" isCollection="false">
- <dmn:typeRef>number</dmn:typeRef>
- </dmn:itemComponent>
- </dmn:itemDefinition>
- <dmn:itemDefinition id="_40731093-0642-4588-9183-1660FC55053B"
name="tViolation" isCollection="false">
- <dmn:itemComponent id="_39E88D9F-AE53-47AD-B3DE-8AB38D4F50B3" name="Code"
isCollection="false">
- <dmn:typeRef>string</dmn:typeRef>
- </dmn:itemComponent>
- <dmn:itemComponent id="_1648EA0A-2463-4B54-A12A-D743A3E3EE7B" name="Date"
isCollection="false">
- <dmn:typeRef>date</dmn:typeRef>
- </dmn:itemComponent>
- <dmn:itemComponent id="_9F129EAA-4E71-4D99-B6D0-84EEC3AC43CC" name="Type"
isCollection="false">
- <dmn:typeRef>string</dmn:typeRef>
- <dmn:allowedValues kie:constraintType="enumeration"
id="_626A8F9C-9DD1-44E0-9568-0F6F8F8BA228">
- <dmn:text>"speed", "parking", "driving under the influence"</dmn:text>
- </dmn:allowedValues>
- </dmn:itemComponent>
- <dmn:itemComponent id="_DDD10D6E-BD38-4C79-9E2F-8155E3A4B438" name="Speed
Limit" isCollection="false">
- <dmn:typeRef>number</dmn:typeRef>
- </dmn:itemComponent>
- <dmn:itemComponent id="_229F80E4-2892-494C-B70D-683ABF2345F6" name="Actual
Speed" isCollection="false">
- <dmn:typeRef>number</dmn:typeRef>
- </dmn:itemComponent>
- </dmn:itemDefinition>
- <dmn:itemDefinition id="_2D4F30EE-21A6-4A78-A524-A5C238D433AE" name="tFine"
isCollection="false">
- <dmn:itemComponent id="_B9F70BC7-1995-4F51-B949-1AB65538B405"
name="Amount" isCollection="false">
- <dmn:typeRef>number</dmn:typeRef>
- </dmn:itemComponent>
- <dmn:itemComponent id="_F49085D6-8F08-4463-9A1A-EF6B57635DBD"
name="Points" isCollection="false">
- <dmn:typeRef>number</dmn:typeRef>
- </dmn:itemComponent>
- </dmn:itemDefinition>
- <dmn:inputData id="_1929CBD5-40E0-442D-B909-49CEDE0101DC" name="Violation">
- <dmn:variable id="_C16CF9B1-5FAB-48A0-95E0-5FCD661E0406" name="Violation"
typeRef="tViolation"/>
- </dmn:inputData>
- <dmn:decision id="_4055D956-1C47-479C-B3F4-BAEB61F1C929" name="Fine">
- <dmn:variable id="_8C1EAC83-F251-4D94-8A9E-B03ACF6849CD" name="Fine"
typeRef="tFine"/>
- <dmn:informationRequirement id="_800A3BBB-90A3-4D9D-BA5E-A311DED0134F">
- <dmn:requiredInput href="#_1929CBD5-40E0-442D-B909-49CEDE0101DC"/>
- </dmn:informationRequirement>
- <dmn:decisionTable id="_C8F7F579-E06C-4A2F-8485-65FAFAC3FE6A"
hitPolicy="UNIQUE" preferredOrientation="Rule-as-Row">
- <dmn:input id="_B53A6F0D-F72C-41EF-96B3-F31269AC0FED">
- <dmn:inputExpression id="_974C8D01-728F-4CE5-8C69-BE884125B859"
typeRef="string">
- <dmn:text>Violation.Type</dmn:text>
- </dmn:inputExpression>
- </dmn:input>
- <dmn:input id="_D5319F80-1C59-4736-AF2D-D29DE6B7E76D">
- <dmn:inputExpression id="_3FEB4DE3-90C6-438E-99BF-9BB1BF5B078A"
typeRef="number">
- <dmn:text>Violation.Actual Speed - Violation.Speed Limit</dmn:text>
- </dmn:inputExpression>
- </dmn:input>
- <dmn:output id="_9012031F-9C01-44E5-8CD2-E6704D594504" name="Amount"
typeRef="number"/>
- <dmn:output id="_7CAC8240-E1A5-4FEB-A0D4-B8613F0DE54B" name="Points"
typeRef="number"/>
- <dmn:rule id="_424A80AE-916F-4451-9B6B-71557F7EC65A">
- <dmn:inputEntry id="_EDA4F336-AA28-4F5F-ADFC-401E6DCC8D35">
- <dmn:text>"speed"</dmn:text>
- </dmn:inputEntry>
- <dmn:inputEntry id="_246AAB08-A945-4599-9220-7C24B6716FDD">
- <dmn:text>[10..30)</dmn:text>
- </dmn:inputEntry>
- <dmn:outputEntry id="_E49345EE-51D3-47C7-B658-3607E723FF37">
- <dmn:text>500</dmn:text>
- </dmn:outputEntry>
- <dmn:outputEntry id="_1D56F3CB-6BAE-4415-940F-00F37121813D">
- <dmn:text>3</dmn:text>
- </dmn:outputEntry>
- </dmn:rule>
- <dmn:rule id="_B1ECE6A9-6B82-4A85-A7CA-5F96CDB0DCB6">
- <dmn:inputEntry id="_2390F686-65CF-40FF-BF9A-72DFBAEBACAC">
- <dmn:text>"speed"</dmn:text>
- </dmn:inputEntry>
- <dmn:inputEntry id="_8CEBE4D5-DBEF-46EF-BD95-7B96148B6D8A">
- <dmn:text>>= 30</dmn:text>
- </dmn:inputEntry>
- <dmn:outputEntry id="_5FCC56B7-6BAA-4B09-AC61-7EB9D4CD58C3">
- <dmn:text>1000</dmn:text>
- </dmn:outputEntry>
- <dmn:outputEntry id="_79FF8FDD-3299-4DFD-AA14-D2022504BDAD">
- <dmn:text>7</dmn:text>
- </dmn:outputEntry>
- </dmn:rule>
- <dmn:rule id="_8FC7068C-A3FD-44D9-AC2B-69C160A12E5D">
- <dmn:inputEntry id="_02EEE8A9-1AD7-4708-8EC8-9B4177B05167">
- <dmn:text>"parking"</dmn:text>
- </dmn:inputEntry>
- <dmn:inputEntry id="_A5141FF4-8D63-49DB-8979-3B64A3BD9A82">
- <dmn:text>-</dmn:text>
- </dmn:inputEntry>
- <dmn:outputEntry id="_EFDA632D-113D-46C9-94B8-78E9F9770CA4">
- <dmn:text>100</dmn:text>
- </dmn:outputEntry>
- <dmn:outputEntry id="_05F86973-52CE-4C9D-B785-47B6340D10FD">
- <dmn:text>1</dmn:text>
- </dmn:outputEntry>
- </dmn:rule>
- <dmn:rule id="_A742DF2B-DC91-4166-9773-6EF86A45A625">
- <dmn:inputEntry id="_F5B5AE87-D9E6-4142-B01D-D79D4BA49EEE">
- <dmn:text>"driving under the influence"</dmn:text>
- </dmn:inputEntry>
- <dmn:inputEntry id="_BD2A43F5-46D8-436A-B8A1-D98747C836B1">
- <dmn:text>-</dmn:text>
- </dmn:inputEntry>
- <dmn:outputEntry id="_ECAF3378-46B6-4F40-B95A-E90DB700BF7D">
- <dmn:text>1000</dmn:text>
- </dmn:outputEntry>
- <dmn:outputEntry id="_F0016A9C-D1D0-472A-9FB3-ABE77AD15F7D">
- <dmn:text>5</dmn:text>
- </dmn:outputEntry>
- </dmn:rule>
- </dmn:decisionTable>
- </dmn:decision>
- <dmn:inputData id="_1F9350D7-146D-46F1-85D8-15B5B68AF22A" name="Driver">
- <dmn:variable id="_A80F16DF-0DB4-43A2-B041-32900B1A3F3D" name="Driver"
typeRef="tDriver"/>
- </dmn:inputData>
- <dmn:decision id="_8A408366-D8E9-4626-ABF3-5F69AA01F880" name="Should the
driver be suspended?">
- <dmn:question>Should the driver be suspended due to points on his
license?</dmn:question>
- <dmn:allowedAnswers>"Yes", "No"</dmn:allowedAnswers>
- <dmn:variable id="_40387B66-5D00-48C8-BB90-E83EE3332C72" name="Should the
driver be suspended?" typeRef="string"/>
- <dmn:informationRequirement id="_982211B1-5246-49CD-BE85-3211F71253CF">
- <dmn:requiredInput href="#_1F9350D7-146D-46F1-85D8-15B5B68AF22A"/>
- </dmn:informationRequirement>
- <dmn:informationRequirement id="_AEC4AA5F-50C3-4FED-A0C2-261F90290731">
- <dmn:requiredDecision href="#_4055D956-1C47-479C-B3F4-BAEB61F1C929"/>
- </dmn:informationRequirement>
- <dmn:context id="_F39732F1-0AA7-468F-86C4-DCC07E6F81CF">
- <dmn:contextEntry>
- <dmn:variable id="_09385E8D-68E0-4DFD-AAD8-141C15C96B71" name="Total
Points" typeRef="number"/>
- <dmn:literalExpression id="_F1BEBF16-033F-4A25-9523-CAC23ACC5DFC">
- <dmn:text>Driver.Points + Fine.Points</dmn:text>
- </dmn:literalExpression>
- </dmn:contextEntry>
- <dmn:contextEntry>
- <dmn:literalExpression id="_1929D813-B1C9-43C5-9497-CE5D8B2B040C">
- <dmn:text>if Total Points >= 20 then "Yes" else "No"</dmn:text>
- </dmn:literalExpression>
- </dmn:contextEntry>
- </dmn:context>
- </dmn:decision>
- <dmndi:DMNDI>
- <dmndi:DMNDiagram>
- <di:extension>
- <kie:ComponentsWidthsExtension>
- <kie:ComponentWidths
dmnElementRef="_C8F7F579-E06C-4A2F-8485-65FAFAC3FE6A">
- <kie:width>50.0</kie:width>
- <kie:width>254.0</kie:width>
- <kie:width>329.0</kie:width>
- <kie:width>119.0</kie:width>
- <kie:width>100.0</kie:width>
- <kie:width>186.0</kie:width>
- </kie:ComponentWidths>
- <kie:ComponentWidths
dmnElementRef="_F39732F1-0AA7-468F-86C4-DCC07E6F81CF">
- <kie:width>50.0</kie:width>
- <kie:width>100.0</kie:width>
- <kie:width>398.0</kie:width>
- </kie:ComponentWidths>
- <kie:ComponentWidths
dmnElementRef="_F1BEBF16-033F-4A25-9523-CAC23ACC5DFC">
- <kie:width>398.0</kie:width>
- </kie:ComponentWidths>
- <kie:ComponentWidths
dmnElementRef="_1929D813-B1C9-43C5-9497-CE5D8B2B040C">
- <kie:width>398.0</kie:width>
- </kie:ComponentWidths>
- </kie:ComponentsWidthsExtension>
- </di:extension>
- <dmndi:DMNShape id="dmnshape-_1929CBD5-40E0-442D-B909-49CEDE0101DC"
dmnElementRef="_1929CBD5-40E0-442D-B909-49CEDE0101DC" isCollapsed="false">
- <dmndi:DMNStyle>
- <dmndi:FillColor red="255" green="255" blue="255"/>
- <dmndi:StrokeColor red="0" green="0" blue="0"/>
- <dmndi:FontColor red="0" green="0" blue="0"/>
- </dmndi:DMNStyle>
- <dc:Bounds x="708" y="350" width="100" height="50"/>
- <dmndi:DMNLabel/>
- </dmndi:DMNShape>
- <dmndi:DMNShape id="dmnshape-_4055D956-1C47-479C-B3F4-BAEB61F1C929"
dmnElementRef="_4055D956-1C47-479C-B3F4-BAEB61F1C929" isCollapsed="false">
- <dmndi:DMNStyle>
- <dmndi:FillColor red="255" green="255" blue="255"/>
- <dmndi:StrokeColor red="0" green="0" blue="0"/>
- <dmndi:FontColor red="0" green="0" blue="0"/>
- </dmndi:DMNStyle>
- <dc:Bounds x="709" y="210" width="100" height="50"/>
- <dmndi:DMNLabel/>
- </dmndi:DMNShape>
- <dmndi:DMNShape id="dmnshape-_1F9350D7-146D-46F1-85D8-15B5B68AF22A"
dmnElementRef="_1F9350D7-146D-46F1-85D8-15B5B68AF22A" isCollapsed="false">
- <dmndi:DMNStyle>
- <dmndi:FillColor red="255" green="255" blue="255"/>
- <dmndi:StrokeColor red="0" green="0" blue="0"/>
- <dmndi:FontColor red="0" green="0" blue="0"/>
- </dmndi:DMNStyle>
- <dc:Bounds x="369" y="344" width="100" height="50"/>
- <dmndi:DMNLabel/>
- </dmndi:DMNShape>
- <dmndi:DMNShape id="dmnshape-_8A408366-D8E9-4626-ABF3-5F69AA01F880"
dmnElementRef="_8A408366-D8E9-4626-ABF3-5F69AA01F880" isCollapsed="false">
- <dmndi:DMNStyle>
- <dmndi:FillColor red="255" green="255" blue="255"/>
- <dmndi:StrokeColor red="0" green="0" blue="0"/>
- <dmndi:FontColor red="0" green="0" blue="0"/>
- </dmndi:DMNStyle>
- <dc:Bounds x="534" y="83" width="133" height="63"/>
- <dmndi:DMNLabel/>
- </dmndi:DMNShape>
- <dmndi:DMNEdge id="dmnedge-_800A3BBB-90A3-4D9D-BA5E-A311DED0134F"
dmnElementRef="_800A3BBB-90A3-4D9D-BA5E-A311DED0134F">
- <di:waypoint x="758" y="375"/>
- <di:waypoint x="759" y="235"/>
- </dmndi:DMNEdge>
- <dmndi:DMNEdge id="dmnedge-_982211B1-5246-49CD-BE85-3211F71253CF"
dmnElementRef="_982211B1-5246-49CD-BE85-3211F71253CF">
- <di:waypoint x="419" y="369"/>
- <di:waypoint x="600.5" y="114.5"/>
- </dmndi:DMNEdge>
- <dmndi:DMNEdge id="dmnedge-_AEC4AA5F-50C3-4FED-A0C2-261F90290731"
dmnElementRef="_AEC4AA5F-50C3-4FED-A0C2-261F90290731">
- <di:waypoint x="759" y="235"/>
- <di:waypoint x="600.5" y="114.5"/>
- </dmndi:DMNEdge>
- </dmndi:DMNDiagram>
- </dmndi:DMNDI>
-</dmn:definitions>
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]