Add test case to cover the logic of computing runtime classpath (#602)
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
This commit is contained in:
parent
896243cf53
commit
acf916ece9
|
@ -539,3 +539,8 @@ Exception in thread "main" java.lang.IllegalStateException
|
|||
6. Open VS Code menu `Help -> Open Process Explorer`, find the Java Debuggger process in the `Process Explorer`. And its command line string should contain `--enable-preview` flag.
|
||||
|
||||

|
||||
|
||||
## Auto resolve classpath for maven projects
|
||||
1. Open `resolveClasspath` project in VS Code and wait for Java extensions are activated.
|
||||
2. Open `kie-client/src/main/java/client/EmbedMain.java` file, and click `Run` or `Debug` CodeLens to launch the application. Check DEBUG CONSOLE view to verify it is launched successfully.
|
||||
3. Open `insurance-decision/src/test/java/testscenario/Launch.java` file, and click `Run` or `Debug` CodeLens to launch the application. Check whether the message `Main Class in Test Folder!` is printed in DEBUG CONSOLE view.
|
|
@ -0,0 +1,15 @@
|
|||
/target
|
||||
/local
|
||||
**/project.repositories
|
||||
|
||||
# Eclipse, Netbeans and IntelliJ files
|
||||
**/.*
|
||||
!.gitignore
|
||||
!.gitattributes
|
||||
**/nbproject
|
||||
**/*.ipr
|
||||
**/*.iws
|
||||
**/*.iml
|
||||
|
||||
# Repository wide ignore mac DS_Store files
|
||||
.DS_Store
|
|
@ -0,0 +1,111 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.demo</groupId>
|
||||
<artifactId>InsuranceDecision</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>kjar</packaging>
|
||||
<name>InsuranceDecision</name>
|
||||
<description></description>
|
||||
<properties>
|
||||
<ba.version>7.3.1.GA-redhat-00002</ba.version>
|
||||
</properties>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.redhat.ba</groupId>
|
||||
<artifactId>ba-platform-bom</artifactId>
|
||||
<version>${ba.version}</version>
|
||||
<scope>import</scope>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.kie</groupId>
|
||||
<artifactId>kie-internal</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.kie</groupId>
|
||||
<artifactId>kie-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<!-- test -->
|
||||
<dependency>
|
||||
<groupId>com.thoughtworks.xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.drools</groupId>
|
||||
<artifactId>drools-wb-scenario-simulation-editor-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.drools</groupId>
|
||||
<artifactId>drools-wb-scenario-simulation-editor-backend</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.drools</groupId>
|
||||
<artifactId>drools-compiler</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.kie</groupId>
|
||||
<artifactId>kie-dmn-feel</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.kie</groupId>
|
||||
<artifactId>kie-dmn-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.kie</groupId>
|
||||
<artifactId>kie-dmn-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.kie</groupId>
|
||||
<artifactId>kie-maven-plugin</artifactId>
|
||||
<version>7.18.0.Final-redhat-00004</version>
|
||||
<extensions>true</extensions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jboss-ga-repository</id>
|
||||
<url>https://maven.repository.redhat.com/ga/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>jboss-ga-plugin-repository</id>
|
||||
<url>https://maven.repository.redhat.com/ga/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</project>
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<deployment-descriptor xsi:schemaLocation="http://www.jboss.org/jbpm deployment-descriptor.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<persistence-unit>org.jbpm.domain</persistence-unit>
|
||||
<audit-persistence-unit>org.jbpm.domain</audit-persistence-unit>
|
||||
<audit-mode>JPA</audit-mode>
|
||||
<persistence-mode>JPA</persistence-mode>
|
||||
<runtime-strategy>SINGLETON</runtime-strategy>
|
||||
<marshalling-strategies/>
|
||||
<event-listeners/>
|
||||
<task-event-listeners/>
|
||||
<globals/>
|
||||
<work-item-handlers/>
|
||||
<environment-entries/>
|
||||
<configurations/>
|
||||
<required-roles/>
|
||||
<remoteable-classes/>
|
||||
<limit-serialization-classes>true</limit-serialization-classes>
|
||||
</deployment-descriptor>
|
|
@ -0,0 +1 @@
|
|||
<kmodule xmlns="http://www.drools.org/xsd/kmodule" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
|
||||
<persistence-unit name="com.demo:InsuranceDecision:1.0.0" transaction-type="JTA">
|
||||
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
||||
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
|
||||
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
||||
<properties>
|
||||
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
|
||||
<property name="hibernate.max_fetch_depth" value="3"/>
|
||||
<property name="hibernate.hbm2ddl.auto" value="update"/>
|
||||
<property name="hibernate.show_sql" value="false"/>
|
||||
<property name="hibernate.id.new_generator_mappings" value="false"/>
|
||||
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform"/>
|
||||
</properties>
|
||||
</persistence-unit>
|
||||
</persistence>
|
|
@ -0,0 +1,237 @@
|
|||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<dmn11:definitions xmlns:dmn11="http://www.omg.org/spec/DMN/20180521/MODEL/" xmlns="http://www.trisotech.com/definitions/_bb8b9304-b29f-462e-9f88-03d0d868aec5" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/" xmlns:kie="http://www.drools.org/kie/dmn/1.2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:feel="http://www.omg.org/spec/DMN/20180521/FEEL/" xmlns:tc="http://www.omg.org/spec/DMN/20160719/testcase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:trisofeed="http://trisotech.com/feed" xmlns:dmndi="http://www.omg.org/spec/DMN/20180521/DMNDI/" xmlns:triso="http://www.trisotech.com/2015/triso/modeling" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" id="_bb8b9304-b29f-462e-9f88-03d0d868aec5" name="Insurance Pricing" expressionLanguage="http://www.omg.org/spec/DMN/20180521/FEEL/" typeLanguage="http://www.omg.org/spec/DMN/20180521/FEEL/" namespace="http://www.trisotech.com/definitions/_bb8b9304-b29f-462e-9f88-03d0d868aec5">
|
||||
<dmn11:extensionElements/>
|
||||
<dmn11:inputData id="_5e4d4ad2-97a3-4f51-a364-d8e8700d55fc" name="PreviousIncidents">
|
||||
<dmn11:description>previous Incidents</dmn11:description>
|
||||
<dmn11:variable id="_c87e768d-fd66-4eea-b5c1-8cf83b71fca3" name="PreviousIncidents" typeRef="boolean"/>
|
||||
</dmn11:inputData>
|
||||
<dmn11:inputData id="_97a2b7b9-613c-441f-b9c2-2bf04c3a63b8" name="CarAge">
|
||||
<dmn11:description>car age</dmn11:description>
|
||||
<dmn11:variable id="_b031a587-a061-44bc-94aa-1958ac80426c" name="CarAge" typeRef="number"/>
|
||||
</dmn11:inputData>
|
||||
<dmn11:inputData id="_921a00ec-6199-4073-b139-494835a422ce" name="Age">
|
||||
<dmn11:variable id="_a29a877b-cc11-4486-8631-055693d2600b" name="Age" typeRef="number"/>
|
||||
</dmn11:inputData>
|
||||
<dmn11:decision id="_7c68efef-3b20-4807-8d15-7f55995cc8fd" name="Insurance Base Price">
|
||||
<dmn11:variable id="_288cd944-5c0e-46be-9c66-ef018afad7c6" name="Insurance Base Price" typeRef="number"/>
|
||||
<dmn11:informationRequirement id="_D65EA838-489E-4980-A7FE-55C9BD3A5341">
|
||||
<dmn11:requiredInput href="#_921a00ec-6199-4073-b139-494835a422ce"/>
|
||||
</dmn11:informationRequirement>
|
||||
<dmn11:informationRequirement id="_031E2962-C864-4553-99B6-3708734D62B3">
|
||||
<dmn11:requiredInput href="#_5e4d4ad2-97a3-4f51-a364-d8e8700d55fc"/>
|
||||
</dmn11:informationRequirement>
|
||||
<dmn11:decisionTable id="_c521212f-52c8-4295-bf23-b277a7f42c23" typeRef="number" hitPolicy="UNIQUE" preferredOrientation="Rule-as-Row" outputLabel="Insurance Base Price">
|
||||
<dmn11:input id="_bb911948-1f55-411a-891d-52ddcd9afe47">
|
||||
<dmn11:inputExpression id="_0AF4BB00-6E2F-4BB4-95AA-AFF887DD0F49" typeRef="number">
|
||||
<dmn11:text>Age</dmn11:text>
|
||||
</dmn11:inputExpression>
|
||||
</dmn11:input>
|
||||
<dmn11:input id="_3f6b06ca-092e-4f2e-a33b-ad405c401089">
|
||||
<dmn11:inputExpression id="_F36E1FAC-23B3-424A-BB39-60C4ABB14459" typeRef="boolean">
|
||||
<dmn11:text>PreviousIncidents</dmn11:text>
|
||||
</dmn11:inputExpression>
|
||||
</dmn11:input>
|
||||
<dmn11:output id="_0e4b7ecc-c788-4b17-8bf0-65ea8c24b583" typeRef="Any"/>
|
||||
<dmn11:rule id="_437a79a9-a040-4c8b-aa9c-e537b8e853bb">
|
||||
<dmn11:inputEntry id="_b7ba74e6-a379-40c1-8877-f228ace47840">
|
||||
<dmn11:text>>25</dmn11:text>
|
||||
</dmn11:inputEntry>
|
||||
<dmn11:inputEntry id="_e1259729-4991-408c-842a-bba208269e8f">
|
||||
<dmn11:text>false</dmn11:text>
|
||||
</dmn11:inputEntry>
|
||||
<dmn11:outputEntry id="_7bfcb62c-a39c-457e-9816-04038f77f757" typeRef="Any">
|
||||
<dmn11:text>1000</dmn11:text>
|
||||
</dmn11:outputEntry>
|
||||
</dmn11:rule>
|
||||
<dmn11:rule id="_ae3a1342-e901-492f-b613-c0e0f3a94a9c">
|
||||
<dmn11:inputEntry id="_60501a55-262f-4aa0-a107-63d4e16a16e8">
|
||||
<dmn11:text>>25</dmn11:text>
|
||||
</dmn11:inputEntry>
|
||||
<dmn11:inputEntry id="_d322a6d4-8d8a-4d12-9883-14df20e60555">
|
||||
<dmn11:text>true</dmn11:text>
|
||||
</dmn11:inputEntry>
|
||||
<dmn11:outputEntry id="_6f863f74-2a35-42f2-8f1d-e92c50bb0542" typeRef="Any">
|
||||
<dmn11:text>1250</dmn11:text>
|
||||
</dmn11:outputEntry>
|
||||
</dmn11:rule>
|
||||
<dmn11:rule id="_f1f82aec-347d-4ab4-9636-d6237d4d97ad">
|
||||
<dmn11:inputEntry id="_ba6ac537-28de-4680-985a-24fa59832e0e">
|
||||
<dmn11:text>[18..25]</dmn11:text>
|
||||
</dmn11:inputEntry>
|
||||
<dmn11:inputEntry id="_0c2d6c9b-4d8e-46a6-a878-385f50e71889">
|
||||
<dmn11:text>false</dmn11:text>
|
||||
</dmn11:inputEntry>
|
||||
<dmn11:outputEntry id="_27e13d7d-e948-4ec4-b3cc-c93436eedbe2" typeRef="Any">
|
||||
<dmn11:text>1500</dmn11:text>
|
||||
</dmn11:outputEntry>
|
||||
</dmn11:rule>
|
||||
<dmn11:rule id="_62586e68-ffff-413a-94fa-8e27897aa7b2">
|
||||
<dmn11:inputEntry id="_9fd7d847-2b4b-4e61-8b46-4b158e680ec8">
|
||||
<dmn11:text>[18..25]</dmn11:text>
|
||||
</dmn11:inputEntry>
|
||||
<dmn11:inputEntry id="_6683e298-aca8-4206-8b02-cc17e449f6d9">
|
||||
<dmn11:text>true</dmn11:text>
|
||||
</dmn11:inputEntry>
|
||||
<dmn11:outputEntry id="_0233b414-5e0d-4aa2-95e5-2d97c9f01cfd" typeRef="Any">
|
||||
<dmn11:text>2000</dmn11:text>
|
||||
</dmn11:outputEntry>
|
||||
</dmn11:rule>
|
||||
</dmn11:decisionTable>
|
||||
</dmn11:decision>
|
||||
<dmn11:decision id="_75adccac-8a37-4312-94b7-48ec3236afde" name="FinalPrice">
|
||||
<dmn11:description>Insurance Final Price</dmn11:description>
|
||||
<dmn11:variable id="_9276fece-b6a9-46de-910f-92ddcb0c431e" name="FinalPrice" typeRef="number"/>
|
||||
<dmn11:informationRequirement id="_15B63923-EDF6-49AC-A90D-79B069768163">
|
||||
<dmn11:requiredDecision href="#_7c68efef-3b20-4807-8d15-7f55995cc8fd"/>
|
||||
</dmn11:informationRequirement>
|
||||
<dmn11:informationRequirement id="_350A88C6-41A1-4B41-B553-7E01CB21FDA1">
|
||||
<dmn11:requiredInput href="#_97a2b7b9-613c-441f-b9c2-2bf04c3a63b8"/>
|
||||
</dmn11:informationRequirement>
|
||||
<dmn11:knowledgeRequirement id="_D949A453-E8EB-4913-A64F-D9158364ECE0">
|
||||
<dmn11:requiredKnowledge href="#_c54f8fc4-0ca2-4771-891e-e5fff0bfaaf8"/>
|
||||
</dmn11:knowledgeRequirement>
|
||||
<dmn11:literalExpression id="_8e051de9-da52-41fe-a819-5bf6682a0e00" typeRef="Any">
|
||||
<dmn11:text>
|
||||
Insurance Base Price * Car reliability factor(CarAge)</dmn11:text>
|
||||
</dmn11:literalExpression>
|
||||
</dmn11:decision>
|
||||
<dmn11:businessKnowledgeModel id="_c54f8fc4-0ca2-4771-891e-e5fff0bfaaf8" name="Car reliability factor">
|
||||
<dmn11:variable id="_60897f4d-feda-47ab-814d-b9884af49ce2" name="Car reliability factor" typeRef="number"/>
|
||||
<dmn11:encapsulatedLogic id="_7BC1719B-25FA-4A06-835D-098D3F951DEF" typeRef="number" kind="FEEL">
|
||||
<dmn11:formalParameter id="_546C41F7-FE92-44F2-999B-74EFC0444FF8" name="car age" typeRef="number"/>
|
||||
<dmn11:decisionTable id="_72e3f63d-28c2-4f55-9452-029ff871e8bb" typeRef="Any" hitPolicy="UNIQUE" preferredOrientation="Rule-as-Row" outputLabel="Car reliability factor">
|
||||
<dmn11:input id="_c01d4e43-42c0-4986-a6a2-dbe506e662e3">
|
||||
<dmn11:inputExpression id="_A0B9BCE2-4FEC-46C0-B55F-0F10652918CE" typeRef="number">
|
||||
<dmn11:text>car age</dmn11:text>
|
||||
</dmn11:inputExpression>
|
||||
</dmn11:input>
|
||||
<dmn11:output id="_765805a6-5297-4032-a724-c57174a440b6" typeRef="Any"/>
|
||||
<dmn11:rule id="_2d3b5632-9768-4707-b29e-32748852e00c">
|
||||
<dmn11:inputEntry id="_052b19fd-1784-494d-89e8-24eabec1a1fd">
|
||||
<dmn11:text><=2</dmn11:text>
|
||||
</dmn11:inputEntry>
|
||||
<dmn11:outputEntry id="_f50d08d8-fad8-4153-a43a-dc75962ce967" typeRef="Any">
|
||||
<dmn11:text>1</dmn11:text>
|
||||
</dmn11:outputEntry>
|
||||
</dmn11:rule>
|
||||
<dmn11:rule id="_46b1e521-4d16-4d81-a883-7477ddebb64a">
|
||||
<dmn11:inputEntry id="_8cdd9c2a-32c8-4ea7-83bb-54cc4fd3c104">
|
||||
<dmn11:text>[3, 4]</dmn11:text>
|
||||
</dmn11:inputEntry>
|
||||
<dmn11:outputEntry id="_ba41d52b-ae8c-4282-817f-b28b6daf10f1" typeRef="Any">
|
||||
<dmn11:text>1.1</dmn11:text>
|
||||
</dmn11:outputEntry>
|
||||
</dmn11:rule>
|
||||
<dmn11:rule id="_c4d19400-534a-4645-bf6f-d5d82cc51f49">
|
||||
<dmn11:inputEntry id="_4d046c3b-c331-474b-b9bb-dca64203b8fc">
|
||||
<dmn11:text>[5,7]</dmn11:text>
|
||||
</dmn11:inputEntry>
|
||||
<dmn11:outputEntry id="_72e800e9-bfe1-4544-8a47-0f8e808e41f4" typeRef="Any">
|
||||
<dmn11:text>1.2</dmn11:text>
|
||||
</dmn11:outputEntry>
|
||||
</dmn11:rule>
|
||||
<dmn11:rule id="_8bd2c30a-cc0a-498f-bfa6-ca63bc9c31c0">
|
||||
<dmn11:inputEntry id="_b5d9697d-a593-4b6e-9e1c-a27839271f6a">
|
||||
<dmn11:text>>=8</dmn11:text>
|
||||
</dmn11:inputEntry>
|
||||
<dmn11:outputEntry id="_edc03b82-768f-49e1-8a0f-b90bf140e0c4" typeRef="Any">
|
||||
<dmn11:text>1.3</dmn11:text>
|
||||
</dmn11:outputEntry>
|
||||
</dmn11:rule>
|
||||
</dmn11:decisionTable>
|
||||
</dmn11:encapsulatedLogic>
|
||||
</dmn11:businessKnowledgeModel>
|
||||
<dmndi:DMNDI>
|
||||
<dmndi:DMNDiagram>
|
||||
<di:extension>
|
||||
<kie:ComponentsWidthsExtension>
|
||||
<kie:ComponentWidths dmnElementRef="_c521212f-52c8-4295-bf23-b277a7f42c23">
|
||||
<kie:width>50.0</kie:width>
|
||||
<kie:width>100.0</kie:width>
|
||||
<kie:width>100.0</kie:width>
|
||||
<kie:width>100.0</kie:width>
|
||||
<kie:width>100.0</kie:width>
|
||||
</kie:ComponentWidths>
|
||||
<kie:ComponentWidths dmnElementRef="_8e051de9-da52-41fe-a819-5bf6682a0e00">
|
||||
<kie:width>506.0</kie:width>
|
||||
</kie:ComponentWidths>
|
||||
<kie:ComponentWidths dmnElementRef="_72e3f63d-28c2-4f55-9452-029ff871e8bb"/>
|
||||
</kie:ComponentsWidthsExtension>
|
||||
</di:extension>
|
||||
<dmndi:DMNShape id="dmnshape-_5e4d4ad2-97a3-4f51-a364-d8e8700d55fc" dmnElementRef="_5e4d4ad2-97a3-4f51-a364-d8e8700d55fc" 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="79" y="300" width="143" height="50"/>
|
||||
<dmndi:DMNLabel/>
|
||||
</dmndi:DMNShape>
|
||||
<dmndi:DMNShape id="dmnshape-_97a2b7b9-613c-441f-b9c2-2bf04c3a63b8" dmnElementRef="_97a2b7b9-613c-441f-b9c2-2bf04c3a63b8" 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="367.29906542056074" y="179.3421052631579" width="100" height="50"/>
|
||||
<dmndi:DMNLabel/>
|
||||
</dmndi:DMNShape>
|
||||
<dmndi:DMNShape id="dmnshape-_921a00ec-6199-4073-b139-494835a422ce" dmnElementRef="_921a00ec-6199-4073-b139-494835a422ce" 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="313" y="300" width="100" height="50"/>
|
||||
<dmndi:DMNLabel/>
|
||||
</dmndi:DMNShape>
|
||||
<dmndi:DMNShape id="dmnshape-_7c68efef-3b20-4807-8d15-7f55995cc8fd" dmnElementRef="_7c68efef-3b20-4807-8d15-7f55995cc8fd" 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="180" y="179" width="134" height="60"/>
|
||||
<dmndi:DMNLabel/>
|
||||
</dmndi:DMNShape>
|
||||
<dmndi:DMNShape id="dmnshape-_75adccac-8a37-4312-94b7-48ec3236afde" dmnElementRef="_75adccac-8a37-4312-94b7-48ec3236afde" 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="225" y="50" width="140" height="60"/>
|
||||
<dmndi:DMNLabel/>
|
||||
</dmndi:DMNShape>
|
||||
<dmndi:DMNShape id="dmnshape-_c54f8fc4-0ca2-4771-891e-e5fff0bfaaf8" dmnElementRef="_c54f8fc4-0ca2-4771-891e-e5fff0bfaaf8" 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="470" y="54" width="100" height="50"/>
|
||||
<dmndi:DMNLabel/>
|
||||
</dmndi:DMNShape>
|
||||
<dmndi:DMNEdge id="dmnedge-_D65EA838-489E-4980-A7FE-55C9BD3A5341" dmnElementRef="_D65EA838-489E-4980-A7FE-55C9BD3A5341">
|
||||
<di:waypoint x="363" y="325"/>
|
||||
<di:waypoint x="247" y="209"/>
|
||||
</dmndi:DMNEdge>
|
||||
<dmndi:DMNEdge id="dmnedge-_031E2962-C864-4553-99B6-3708734D62B3" dmnElementRef="_031E2962-C864-4553-99B6-3708734D62B3">
|
||||
<di:waypoint x="150.5" y="325"/>
|
||||
<di:waypoint x="247" y="209"/>
|
||||
</dmndi:DMNEdge>
|
||||
<dmndi:DMNEdge id="dmnedge-_15B63923-EDF6-49AC-A90D-79B069768163" dmnElementRef="_15B63923-EDF6-49AC-A90D-79B069768163">
|
||||
<di:waypoint x="247" y="209"/>
|
||||
<di:waypoint x="295" y="80"/>
|
||||
</dmndi:DMNEdge>
|
||||
<dmndi:DMNEdge id="dmnedge-_350A88C6-41A1-4B41-B553-7E01CB21FDA1" dmnElementRef="_350A88C6-41A1-4B41-B553-7E01CB21FDA1">
|
||||
<di:waypoint x="417.29906542056074" y="204.3421052631579"/>
|
||||
<di:waypoint x="295" y="80"/>
|
||||
</dmndi:DMNEdge>
|
||||
<dmndi:DMNEdge id="dmnedge-_D949A453-E8EB-4913-A64F-D9158364ECE0" dmnElementRef="_D949A453-E8EB-4913-A64F-D9158364ECE0">
|
||||
<di:waypoint x="520" y="79"/>
|
||||
<di:waypoint x="295" y="80"/>
|
||||
</dmndi:DMNEdge>
|
||||
</dmndi:DMNDiagram>
|
||||
</dmndi:DMNDI>
|
||||
</dmn11:definitions>
|
|
@ -0,0 +1,8 @@
|
|||
package testscenario;
|
||||
|
||||
public class Launch {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Main Class in Test Folder!");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package testscenario;
|
||||
/**
|
||||
* Do not remove this file
|
||||
*/
|
||||
@org.junit.runner.RunWith(org.drools.workbench.screens.scenariosimulation.backend.server.runner.ScenarioJunitActivator.class)
|
||||
public class ScenarioJunitActivatorTest {
|
||||
}
|
|
@ -0,0 +1,331 @@
|
|||
<ScenarioSimulationModel version="1.3">
|
||||
<simulation>
|
||||
<simulationDescriptor>
|
||||
<factMappings>
|
||||
<FactMapping>
|
||||
<expressionElements/>
|
||||
<expressionIdentifier>
|
||||
<name>Index</name>
|
||||
<type>OTHER</type>
|
||||
</expressionIdentifier>
|
||||
<factIdentifier>
|
||||
<name>#</name>
|
||||
<className>java.lang.Integer</className>
|
||||
</factIdentifier>
|
||||
<className>java.lang.Integer</className>
|
||||
<factAlias>#</factAlias>
|
||||
</FactMapping>
|
||||
<FactMapping>
|
||||
<expressionElements/>
|
||||
<expressionIdentifier>
|
||||
<name>Description</name>
|
||||
<type>OTHER</type>
|
||||
</expressionIdentifier>
|
||||
<factIdentifier>
|
||||
<name>Scenario description</name>
|
||||
<className>java.lang.String</className>
|
||||
</factIdentifier>
|
||||
<className>java.lang.String</className>
|
||||
<factAlias>Scenario description</factAlias>
|
||||
</FactMapping>
|
||||
<FactMapping>
|
||||
<expressionElements>
|
||||
<ExpressionElement>
|
||||
<step>Age</step>
|
||||
</ExpressionElement>
|
||||
</expressionElements>
|
||||
<expressionIdentifier>
|
||||
<name>0|1</name>
|
||||
<type>GIVEN</type>
|
||||
</expressionIdentifier>
|
||||
<factIdentifier>
|
||||
<name>Age</name>
|
||||
<className>Age</className>
|
||||
</factIdentifier>
|
||||
<className>number</className>
|
||||
<factAlias>Age</factAlias>
|
||||
<expressionAlias>value</expressionAlias>
|
||||
</FactMapping>
|
||||
<FactMapping>
|
||||
<expressionElements>
|
||||
<ExpressionElement>
|
||||
<step>CarAge</step>
|
||||
</ExpressionElement>
|
||||
</expressionElements>
|
||||
<expressionIdentifier>
|
||||
<name>0|2</name>
|
||||
<type>GIVEN</type>
|
||||
</expressionIdentifier>
|
||||
<factIdentifier>
|
||||
<name>CarAge</name>
|
||||
<className>CarAge</className>
|
||||
</factIdentifier>
|
||||
<className>number</className>
|
||||
<factAlias>CarAge</factAlias>
|
||||
<expressionAlias>value</expressionAlias>
|
||||
</FactMapping>
|
||||
<FactMapping>
|
||||
<expressionElements>
|
||||
<ExpressionElement>
|
||||
<step>PreviousIncidents</step>
|
||||
</ExpressionElement>
|
||||
</expressionElements>
|
||||
<expressionIdentifier>
|
||||
<name>0|3</name>
|
||||
<type>GIVEN</type>
|
||||
</expressionIdentifier>
|
||||
<factIdentifier>
|
||||
<name>PreviousIncidents</name>
|
||||
<className>PreviousIncidents</className>
|
||||
</factIdentifier>
|
||||
<className>boolean</className>
|
||||
<factAlias>PreviousIncidents</factAlias>
|
||||
<expressionAlias>value</expressionAlias>
|
||||
</FactMapping>
|
||||
<FactMapping>
|
||||
<expressionElements>
|
||||
<ExpressionElement>
|
||||
<step>FinalPrice</step>
|
||||
</ExpressionElement>
|
||||
</expressionElements>
|
||||
<expressionIdentifier>
|
||||
<name>0|4</name>
|
||||
<type>EXPECT</type>
|
||||
</expressionIdentifier>
|
||||
<factIdentifier>
|
||||
<name>FinalPrice</name>
|
||||
<className>FinalPrice</className>
|
||||
</factIdentifier>
|
||||
<className>number</className>
|
||||
<factAlias>FinalPrice</factAlias>
|
||||
<expressionAlias>value</expressionAlias>
|
||||
</FactMapping>
|
||||
<FactMapping>
|
||||
<expressionElements>
|
||||
<ExpressionElement>
|
||||
<step>Insurance Base Price</step>
|
||||
</ExpressionElement>
|
||||
</expressionElements>
|
||||
<expressionIdentifier>
|
||||
<name>0|5</name>
|
||||
<type>EXPECT</type>
|
||||
</expressionIdentifier>
|
||||
<factIdentifier>
|
||||
<name>Insurance Base Price</name>
|
||||
<className>Insurance Base Price</className>
|
||||
</factIdentifier>
|
||||
<className>number</className>
|
||||
<factAlias>Insurance Base Price</factAlias>
|
||||
<expressionAlias>value</expressionAlias>
|
||||
</FactMapping>
|
||||
</factMappings>
|
||||
<dmnFilePath>src/main/resources/com/demo/InsurancePricing.dmn</dmnFilePath>
|
||||
<type>DMN</type>
|
||||
</simulationDescriptor>
|
||||
<scenarios>
|
||||
<Scenario>
|
||||
<factMappingValues>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[2]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[2]/expressionIdentifier"/>
|
||||
<rawValue class="string">young client</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[3]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[3]/expressionIdentifier"/>
|
||||
<rawValue class="string">25</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[4]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[4]/expressionIdentifier"/>
|
||||
<rawValue class="string">0</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[5]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[5]/expressionIdentifier"/>
|
||||
<rawValue class="string">false</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[6]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[6]/expressionIdentifier"/>
|
||||
<rawValue class="string">1500</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[7]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[7]/expressionIdentifier"/>
|
||||
<rawValue class="string">1500</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping/expressionIdentifier"/>
|
||||
<rawValue class="string">1</rawValue>
|
||||
</FactMappingValue>
|
||||
</factMappingValues>
|
||||
<simulationDescriptor reference="../../../simulationDescriptor"/>
|
||||
</Scenario>
|
||||
<Scenario>
|
||||
<factMappingValues>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[2]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[2]/expressionIdentifier"/>
|
||||
<rawValue class="string">young client with accident</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[3]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[3]/expressionIdentifier"/>
|
||||
<rawValue class="string">25</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[4]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[4]/expressionIdentifier"/>
|
||||
<rawValue class="string">0</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[5]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[5]/expressionIdentifier"/>
|
||||
<rawValue class="string">true</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[6]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[6]/expressionIdentifier"/>
|
||||
<rawValue class="string">2000</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[7]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[7]/expressionIdentifier"/>
|
||||
<rawValue class="string">2000</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping/expressionIdentifier"/>
|
||||
<rawValue class="string">2</rawValue>
|
||||
</FactMappingValue>
|
||||
</factMappingValues>
|
||||
<simulationDescriptor reference="../../../simulationDescriptor"/>
|
||||
</Scenario>
|
||||
<Scenario>
|
||||
<factMappingValues>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[2]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[2]/expressionIdentifier"/>
|
||||
<rawValue class="string">young client with accident car 3yo</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[3]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[3]/expressionIdentifier"/>
|
||||
<rawValue class="string">25</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[4]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[4]/expressionIdentifier"/>
|
||||
<rawValue class="string">3</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[5]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[5]/expressionIdentifier"/>
|
||||
<rawValue class="string">true</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[6]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[6]/expressionIdentifier"/>
|
||||
<rawValue class="string">2200</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[7]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[7]/expressionIdentifier"/>
|
||||
<rawValue class="string">2000</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping/expressionIdentifier"/>
|
||||
<rawValue class="string">3</rawValue>
|
||||
</FactMappingValue>
|
||||
</factMappingValues>
|
||||
<simulationDescriptor reference="../../../simulationDescriptor"/>
|
||||
</Scenario>
|
||||
<Scenario>
|
||||
<factMappingValues>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[2]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[2]/expressionIdentifier"/>
|
||||
<rawValue class="string">young client with accident car 3yo</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[3]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[3]/expressionIdentifier"/>
|
||||
<rawValue class="string">18</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[4]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[4]/expressionIdentifier"/>
|
||||
<rawValue class="string">5</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[5]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[5]/expressionIdentifier"/>
|
||||
<rawValue class="string">true</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[6]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[6]/expressionIdentifier"/>
|
||||
<rawValue class="string">2400</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[7]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[7]/expressionIdentifier"/>
|
||||
<rawValue class="string">2000</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping/expressionIdentifier"/>
|
||||
<rawValue class="string">4</rawValue>
|
||||
</FactMappingValue>
|
||||
</factMappingValues>
|
||||
<simulationDescriptor reference="../../../simulationDescriptor"/>
|
||||
</Scenario>
|
||||
<Scenario>
|
||||
<factMappingValues>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[2]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[2]/expressionIdentifier"/>
|
||||
<rawValue class="string">experienced client</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[3]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[3]/expressionIdentifier"/>
|
||||
<rawValue class="string">26</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[4]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[4]/expressionIdentifier"/>
|
||||
<rawValue class="string">0</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[5]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[5]/expressionIdentifier"/>
|
||||
<rawValue class="string">false</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[6]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[6]/expressionIdentifier"/>
|
||||
<rawValue class="string">1000</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[7]/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping[7]/expressionIdentifier"/>
|
||||
<rawValue class="string">1000</rawValue>
|
||||
</FactMappingValue>
|
||||
<FactMappingValue>
|
||||
<factIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping/factIdentifier"/>
|
||||
<expressionIdentifier reference="../../../../../simulationDescriptor/factMappings/FactMapping/expressionIdentifier"/>
|
||||
<rawValue class="string">5</rawValue>
|
||||
</FactMappingValue>
|
||||
</factMappingValues>
|
||||
<simulationDescriptor reference="../../../simulationDescriptor"/>
|
||||
</Scenario>
|
||||
</scenarios>
|
||||
</simulation>
|
||||
<imports>
|
||||
<imports/>
|
||||
</imports>
|
||||
</ScenarioSimulationModel>
|
|
@ -0,0 +1,15 @@
|
|||
/target
|
||||
/local
|
||||
**/project.repositories
|
||||
|
||||
# Eclipse, Netbeans and IntelliJ files
|
||||
**/.*
|
||||
!.gitignore
|
||||
!.gitattributes
|
||||
**/nbproject
|
||||
**/*.ipr
|
||||
**/*.iws
|
||||
**/*.iml
|
||||
|
||||
# Repository wide ignore mac DS_Store files
|
||||
.DS_Store
|
|
@ -0,0 +1,116 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>kie-client</artifactId>
|
||||
<groupId>com.demo</groupId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<properties>
|
||||
<ba.version>7.3.1.GA-redhat-00002</ba.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
</properties>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.redhat.ba</groupId>
|
||||
<artifactId>ba-platform-bom</artifactId>
|
||||
<version>${ba.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<dependencies>
|
||||
<!-- kie server client api -->
|
||||
<dependency>
|
||||
<groupId>org.kie.server</groupId>
|
||||
<artifactId>kie-server-client</artifactId>
|
||||
</dependency>
|
||||
<!-- embedding dmn -->
|
||||
<dependency>
|
||||
<groupId>com.demo</groupId>
|
||||
<artifactId>InsuranceDecision</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.kie</groupId>
|
||||
<artifactId>kie-dmn-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.kie</groupId>
|
||||
<artifactId>kie-ci</artifactId>
|
||||
</dependency>
|
||||
<!-- Logging -->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- run mvn exec:java -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>java</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<mainClass>client.EmbedMain</mainClass>
|
||||
<arguments>
|
||||
<argument>-verbose:class</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>jboss-ga-repository</id>
|
||||
<url>https://maven.repository.redhat.com/ga/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>jboss-ga-plugin-repository</id>
|
||||
<url>https://maven.repository.redhat.com/ga/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</project>
|
|
@ -0,0 +1,53 @@
|
|||
package client;
|
||||
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
|
||||
import org.kie.api.KieServices;
|
||||
import org.kie.api.runtime.KieContainer;
|
||||
import org.kie.dmn.api.core.DMNContext;
|
||||
import org.kie.dmn.api.core.DMNModel;
|
||||
import org.kie.dmn.api.core.DMNResult;
|
||||
import org.kie.dmn.api.core.DMNRuntime;
|
||||
|
||||
/**
|
||||
* EmbedMain
|
||||
*/
|
||||
public class EmbedMain {
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
Class.forName("org.drools.compiler.commons.jci.readers.ResourceReader");
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
ClassLoader cl = EmbedMain.class.getClassLoader();
|
||||
|
||||
URL[] urls = ((URLClassLoader) cl).getURLs();
|
||||
|
||||
for (URL url : urls) {
|
||||
System.out.println(url.getFile());
|
||||
}
|
||||
|
||||
KieServices kieServices = KieServices.Factory.get();
|
||||
|
||||
KieContainer kieContainer = kieServices.getKieClasspathContainer();
|
||||
|
||||
DMNRuntime dmnRuntime = kieContainer.newKieSession().getKieRuntime(DMNRuntime.class);
|
||||
|
||||
DMNContext dmnContext = dmnRuntime.newContext();
|
||||
|
||||
dmnContext.set("PreviousIncidents", false);
|
||||
dmnContext.set("Age", 28);
|
||||
dmnContext.set("CarAge", 3);
|
||||
|
||||
String namespace = "http://www.trisotech.com/definitions/_bb8b9304-b29f-462e-9f88-03d0d868aec5";
|
||||
String modelName = "Insurance Pricing";
|
||||
|
||||
DMNModel dmnModel = dmnRuntime.getModel(namespace, modelName);
|
||||
|
||||
DMNResult dmnResult = dmnRuntime.evaluateAll(dmnModel, dmnContext);
|
||||
|
||||
System.out.println(dmnResult);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package client;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.kie.dmn.api.core.DMNContext;
|
||||
import org.kie.dmn.api.core.DMNResult;
|
||||
import org.kie.server.api.model.ServiceResponse;
|
||||
import org.kie.server.client.DMNServicesClient;
|
||||
import org.kie.server.client.KieServicesClient;
|
||||
import org.kie.server.client.KieServicesConfiguration;
|
||||
import org.kie.server.client.KieServicesFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class Main {
|
||||
|
||||
final static Logger log = LoggerFactory.getLogger(Main.class);
|
||||
|
||||
private static final String URL = "http://localhost:8080/kie-server/services/rest/server";
|
||||
private static final String user = System.getProperty("username", "donato");
|
||||
private static final String password = System.getProperty("password", "donato");
|
||||
private static final String CONTAINER = "InsuranceDecision_1.0-SNAPSHOT";
|
||||
|
||||
public static void main(String[] args) {
|
||||
Main clientApp = new Main();
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
clientApp.evaluateDMN();
|
||||
|
||||
long end = System.currentTimeMillis();
|
||||
System.out.println("elapsed time: " + (end - start));
|
||||
}
|
||||
|
||||
private void evaluateDMN() {
|
||||
KieServicesClient client = getClient();
|
||||
DMNServicesClient dmnClient = client.getServicesClient(DMNServicesClient.class);
|
||||
|
||||
String namespace = "http://www.trisotech.com/definitions/_bb8b9304-b29f-462e-9f88-03d0d868aec5";
|
||||
String modelName = "Insurance Pricing";
|
||||
|
||||
DMNContext dmnContext = dmnClient.newContext();
|
||||
|
||||
dmnContext.set("PreviousIncidents", false);
|
||||
dmnContext.set("Age", 28);
|
||||
dmnContext.set("CarAge", 3);
|
||||
|
||||
ServiceResponse<DMNResult> result = dmnClient.evaluateAll(CONTAINER, namespace, modelName, dmnContext);
|
||||
System.out.println(result);
|
||||
|
||||
}
|
||||
|
||||
private KieServicesClient getClient() {
|
||||
KieServicesConfiguration config = KieServicesFactory.newRestConfiguration(URL, user, password);
|
||||
|
||||
// Configuration for JMS
|
||||
// KieServicesConfiguration config = KieServicesFactory.newJMSConfiguration(connectionFactory, requestQueue, responseQueue, username, password)
|
||||
|
||||
Map<String, String> headers = null;
|
||||
config.setHeaders(headers);
|
||||
KieServicesClient client = KieServicesFactory.newKieServicesClient(config);
|
||||
|
||||
return client;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
Manifest-Version: 1.0
|
||||
|
||||
Main-Class: client.Main
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
|
||||
<appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d [%t] %-5p %m%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- To override the debug log level from the command line, use the VM option "-Dlogback.level.org.optaplanner=trace" -->
|
||||
<logger name="org.kie" level="debug"/>
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="consoleAppender" />
|
||||
</root>
|
||||
|
||||
</configuration>
|
Loading…
Reference in New Issue