Upgrade
This commit is contained in:
parent
2c0a9867b9
commit
f592787ab7
29 changed files with 173 additions and 451 deletions
|
|
@ -1,51 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
|
||||||
<output url="file://$MODULE_DIR$/target/classes" />
|
|
||||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" name="Maven: org.drools:drools-compiler:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.drools:drools-core-reflective:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.drools:drools-core:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.drools:drools-core-dynamic:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.kie.soup:kie-soup-project-datamodel-commons:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.kie.soup:kie-soup-project-datamodel-api:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.kie:kie-internal:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.kie.soup:kie-soup-maven-support:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.kie.soup:kie-soup-commons:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.antlr:antlr-runtime:3.5.2" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.mvel:mvel2:2.4.4.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.thoughtworks.xstream:xstream:1.4.11.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: xmlpull:xmlpull:1.1.3.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: xpp3:xpp3_min:1.1.4c" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.google.protobuf:protobuf-java:3.6.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.eclipse.jdt.core.compiler:ecj:4.4.2" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.jbpm:jbpm-bpmn2:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.jbpm:jbpm-flow-builder:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.jbpm:jbpm-flow:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.kie:kie-dmn-api:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.kie:kie-dmn-feel:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.kie:kie-dmn-model:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.antlr:antlr4-runtime:4.7.2" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: com.github.javaparser:javaparser-core:3.13.10" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.drools:drools-mvel-parser:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: ch.obermuhlner:big-math:2.0.1" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.kie:kie-dmn-core:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.kie:kie-dmn-backend:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.drools:drools-ruleunit:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.drools:drools-canonical-model:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.drools:drools-model-compiler:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.drools:drools-mvel-compiler:7.32.0.Final" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.jpmml:pmml-model:1.4.11" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.jpmml:pmml-agent:1.4.11" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.8.1" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.5" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.kie:kie-api:7.32.0.Final" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
|
|
@ -18,13 +18,12 @@
|
||||||
<artifactId>drools-compiler</artifactId>
|
<artifactId>drools-compiler</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>ecj</artifactId>
|
<artifactId>drools-ecj</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kie.kogito</groupId>
|
<groupId>org.kie.kogito</groupId>
|
||||||
<artifactId>jbpm-bpmn2</artifactId>
|
<artifactId>jbpm-bpmn2</artifactId>
|
||||||
<version>${drools.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
|
|
@ -41,11 +40,7 @@
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>${maven.compiler.version}</version>
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,16 @@
|
||||||
<artifactId>drools-compiler</artifactId>
|
<artifactId>drools-compiler</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>ecj</artifactId>
|
<artifactId>drools-engine-classic</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.drools</groupId>
|
||||||
|
<artifactId>drools-model-compiler</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.drools</groupId>
|
||||||
|
<artifactId>drools-ecj</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kie.kogito</groupId>
|
<groupId>org.kie.kogito</groupId>
|
||||||
|
|
@ -44,11 +52,8 @@
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>${maven.compiler.version}</version>
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.kie</groupId>
|
<groupId>org.kie</groupId>
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,15 @@
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.drools</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>drools-compiler</artifactId>
|
<artifactId>drools-engine-classic</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>ecj</artifactId>
|
<artifactId>drools-model-compiler</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.drools</groupId>
|
||||||
|
<artifactId>drools-ecj</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kie.kogito</groupId>
|
<groupId>org.kie.kogito</groupId>
|
||||||
|
|
@ -45,11 +49,7 @@
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>${maven.compiler.version}</version>
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.kie</groupId>
|
<groupId>org.kie</groupId>
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,15 @@
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.drools</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>drools-compiler</artifactId>
|
<artifactId>drools-engine-classic</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>ecj</artifactId>
|
<artifactId>drools-model-compiler</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.drools</groupId>
|
||||||
|
<artifactId>drools-ecj</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kie.kogito</groupId>
|
<groupId>org.kie.kogito</groupId>
|
||||||
|
|
@ -44,11 +48,7 @@
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>${maven.compiler.version}</version>
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.kie</groupId>
|
<groupId>org.kie</groupId>
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,15 @@
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.drools</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>drools-compiler</artifactId>
|
<artifactId>drools-engine-classic</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>ecj</artifactId>
|
<artifactId>drools-model-compiler</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.drools</groupId>
|
||||||
|
<artifactId>drools-ecj</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kie.kogito</groupId>
|
<groupId>org.kie.kogito</groupId>
|
||||||
|
|
@ -45,11 +49,7 @@
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>${maven.compiler.version}</version>
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.kie</groupId>
|
<groupId>org.kie</groupId>
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,15 @@
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.drools</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>drools-compiler</artifactId>
|
<artifactId>drools-engine-classic</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>ecj</artifactId>
|
<artifactId>drools-model-compiler</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.drools</groupId>
|
||||||
|
<artifactId>drools-ecj</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kie.kogito</groupId>
|
<groupId>org.kie.kogito</groupId>
|
||||||
|
|
@ -45,11 +49,7 @@
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>${maven.compiler.version}</version>
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.kie</groupId>
|
<groupId>org.kie</groupId>
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,15 @@
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.drools</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>drools-compiler</artifactId>
|
<artifactId>drools-engine-classic</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>ecj</artifactId>
|
<artifactId>drools-model-compiler</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.drools</groupId>
|
||||||
|
<artifactId>drools-ecj</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kie.kogito</groupId>
|
<groupId>org.kie.kogito</groupId>
|
||||||
|
|
@ -45,11 +49,7 @@
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>${maven.compiler.version}</version>
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.kie</groupId>
|
<groupId>org.kie</groupId>
|
||||||
|
|
|
||||||
|
|
@ -37,5 +37,5 @@ rule "Numbers of CashFlow Line"
|
||||||
from collect( CashFlow( mvtDate >= $sDate && mvtDate <= $eDate,accountNo == $acc ) )
|
from collect( CashFlow( mvtDate >= $sDate && mvtDate <= $eDate,accountNo == $acc ) )
|
||||||
|
|
||||||
then
|
then
|
||||||
showResult.showText("Found "+$number+" more than 2 CashFlow Lines");
|
showResult.showText("Found "+$number+" CashFlow Lines");
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,15 @@
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.drools</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>drools-compiler</artifactId>
|
<artifactId>drools-engine-classic</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>ecj</artifactId>
|
<artifactId>drools-model-compiler</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.drools</groupId>
|
||||||
|
<artifactId>drools-ecj</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kie.kogito</groupId>
|
<groupId>org.kie.kogito</groupId>
|
||||||
|
|
@ -45,11 +49,7 @@
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>${maven.compiler.version}</version>
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.kie</groupId>
|
<groupId>org.kie</groupId>
|
||||||
|
|
|
||||||
|
|
@ -19,18 +19,14 @@ rule "Credit and Debit Rule"
|
||||||
when
|
when
|
||||||
$c : Account( $acc : accountno )
|
$c : Account( $acc : accountno )
|
||||||
$p : AccountingPeriod ($sDate : startDate ,$eDate : endDate )
|
$p : AccountingPeriod ($sDate : startDate ,$eDate : endDate )
|
||||||
|
|
||||||
$totalCredit : Number( doubleValue > 100 )
|
$totalCredit : Number( doubleValue > 100 )
|
||||||
from accumulate( CashFlow( type ==CashFlow.CREDIT,$value : amount, mvtDate >= $sDate && mvtDate <= $eDate,accountNo == $acc ),
|
from accumulate( CashFlow( type ==CashFlow.CREDIT,$value : amount, mvtDate >= $sDate && mvtDate <= $eDate,accountNo == $acc ),
|
||||||
init( double total = 0; ),
|
sum($value))
|
||||||
action( total += $value; ),
|
|
||||||
reverse( total -= $value; ),
|
|
||||||
result( total ) )
|
|
||||||
$totalDebit : Number( doubleValue > 100 )
|
$totalDebit : Number( doubleValue > 100 )
|
||||||
from accumulate( CashFlow( type ==CashFlow.DEBIT,$value : amount, mvtDate >= $sDate && mvtDate <= $eDate,accountNo == $acc ),
|
from accumulate( CashFlow( type ==CashFlow.DEBIT,$value : amount, mvtDate >= $sDate && mvtDate <= $eDate,accountNo == $acc ),
|
||||||
init( double total = 0; ),
|
sum($value) )
|
||||||
action( total += $value; ),
|
|
||||||
reverse( total -= $value; ),
|
|
||||||
result( total ) )
|
|
||||||
|
|
||||||
then
|
then
|
||||||
showResult.showText(" Found "+$totalCredit+" as a credit");
|
showResult.showText(" Found "+$totalCredit+" as a credit");
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,15 @@
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.drools</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>drools-compiler</artifactId>
|
<artifactId>drools-engine-classic</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>ecj</artifactId>
|
<artifactId>drools-model-compiler</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.drools</groupId>
|
||||||
|
<artifactId>drools-ecj</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kie.kogito</groupId>
|
<groupId>org.kie.kogito</groupId>
|
||||||
|
|
@ -45,11 +49,8 @@
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>${maven.compiler.version}</version>
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.kie</groupId>
|
<groupId>org.kie</groupId>
|
||||||
|
|
@ -58,5 +59,6 @@
|
||||||
<extensions>true</extensions>
|
<extensions>true</extensions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<process xmlns="http://drools.org/drools-5.0/process"
|
|
||||||
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xs:schemaLocation="http://drools.org/drools-5.0/process drools-processes-5.0.xsd"
|
|
||||||
type="RuleFlow" name="RuleFlow1" id="RF1" package-name="lesson4" >
|
|
||||||
|
|
||||||
<header>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<nodes>
|
|
||||||
<start id="1" name="Start" x="62" y="79" width="80" height="40" />
|
|
||||||
<ruleSet id="2" name="Verify" x="162" y="77" width="80" height="40" ruleFlowGroup="Group1" />
|
|
||||||
<ruleSet id="3" name="Calculation" x="267" y="77" width="80" height="40" ruleFlowGroup="Group2" />
|
|
||||||
<end id="4" name="End" x="372" y="77" width="80" height="40" />
|
|
||||||
</nodes>
|
|
||||||
|
|
||||||
<connections>
|
|
||||||
<connection from="1" to="2" />
|
|
||||||
<connection from="2" to="3" />
|
|
||||||
<connection from="3" to="4" />
|
|
||||||
</connections>
|
|
||||||
|
|
||||||
</process>
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<process xmlns="http://drools.org/drools-5.0/process"
|
|
||||||
xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xs:schemaLocation="http://drools.org/drools-5.0/process drools-processes-5.0.xsd"
|
|
||||||
type="RuleFlow" name="RuleFlow3" id="RF3" package-name="lesson4a" >
|
|
||||||
|
|
||||||
<header>
|
|
||||||
<imports>
|
|
||||||
<import name="droolscours.Account" />
|
|
||||||
</imports>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<nodes>
|
|
||||||
<start id="1" name="Start" x="27" y="78" width="80" height="40" />
|
|
||||||
<ruleSet id="2" name="Calculate2" x="264" y="135" width="80" height="40" ruleFlowGroup="Group2" />
|
|
||||||
<ruleSet id="3" name="Calculate1" x="266" y="28" width="80" height="40" ruleFlowGroup="Group1" />
|
|
||||||
<end id="4" name="End" x="487" y="85" width="80" height="40" />
|
|
||||||
<join id="6" name="Join" x="357" y="91" width="80" height="40" type="2" />
|
|
||||||
<split id="7" name="Split" x="131" y="93" width="80" height="40" type="3" >
|
|
||||||
<constraints>
|
|
||||||
<constraint toNodeId="2" toType="DROOLS_DEFAULT" name="constraint" priority="1" type="rule" dialect="mvel" >Account(balance <= 1000 )</constraint>
|
|
||||||
<constraint toNodeId="3" toType="DROOLS_DEFAULT" name="constraint" priority="1" type="rule" dialect="mvel" >Account(balance > 1000 )</constraint>
|
|
||||||
</constraints>
|
|
||||||
</split>
|
|
||||||
</nodes>
|
|
||||||
|
|
||||||
<connections>
|
|
||||||
<connection from="7" to="2" />
|
|
||||||
<connection from="7" to="3" />
|
|
||||||
<connection from="6" to="4" />
|
|
||||||
<connection from="3" to="6" />
|
|
||||||
<connection from="2" to="6" />
|
|
||||||
<connection from="1" to="7" />
|
|
||||||
</connections>
|
|
||||||
|
|
||||||
</process>
|
|
||||||
|
|
@ -12,11 +12,7 @@ import droolscours.util.OutputDisplay;
|
||||||
|
|
||||||
global OutputDisplay showResult;
|
global OutputDisplay showResult;
|
||||||
|
|
||||||
rule "start process"
|
|
||||||
when
|
|
||||||
then
|
|
||||||
kcontext.getKieRuntime().startProcess("RF3");
|
|
||||||
end
|
|
||||||
|
|
||||||
rule "Account group1 4a"
|
rule "Account group1 4a"
|
||||||
ruleflow-group "Group1"
|
ruleflow-group "Group1"
|
||||||
|
|
|
||||||
|
|
@ -40,18 +40,8 @@ public class Testlesson4 {
|
||||||
Account a = new Account();
|
Account a = new Account();
|
||||||
sessionStatefull.insert(a);
|
sessionStatefull.insert(a);
|
||||||
sessionStatefull.startProcess("RF1");
|
sessionStatefull.startProcess("RF1");
|
||||||
sessionStatefull.fireAllRules();
|
|
||||||
}
|
|
||||||
@Test
|
|
||||||
public void testRuleFlow2() {
|
|
||||||
sessionStatefull = KnowledgeSessionHelper
|
|
||||||
.getStatefulKnowledgeSessionForJBPM(kieContainer, "lesson4-session");
|
|
||||||
OutputDisplay display = new OutputDisplay();
|
|
||||||
sessionStatefull.setGlobal("showResult", display);
|
|
||||||
Account a = new Account();
|
|
||||||
sessionStatefull.insert(a);
|
|
||||||
sessionStatefull.fireAllRules();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testRuleFlow3() {
|
public void testRuleFlow3() {
|
||||||
sessionStatefull = KnowledgeSessionHelper
|
sessionStatefull = KnowledgeSessionHelper
|
||||||
|
|
@ -64,7 +54,7 @@ public class Testlesson4 {
|
||||||
AccountingPeriod period = new AccountingPeriod();
|
AccountingPeriod period = new AccountingPeriod();
|
||||||
sessionStatefull.insert(period);
|
sessionStatefull.insert(period);
|
||||||
|
|
||||||
sessionStatefull.fireAllRules();
|
sessionStatefull.startProcess("RF3");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<description>Accounting project</description>
|
<description>Accounting project</description>
|
||||||
<modules>
|
<modules>
|
||||||
|
<module>drools-lesson4</module>
|
||||||
<module>drools-lesson1</module>
|
<module>drools-lesson1</module>
|
||||||
<module>drools-lesson2</module>
|
<module>drools-lesson2</module>
|
||||||
<module>drools-lesson31</module>
|
<module>drools-lesson31</module>
|
||||||
|
|
@ -18,70 +19,7 @@
|
||||||
<module>drools-lesson33</module>
|
<module>drools-lesson33</module>
|
||||||
<module>drools-lesson34</module>
|
<module>drools-lesson34</module>
|
||||||
<module>drools-lesson35</module>
|
<module>drools-lesson35</module>
|
||||||
<module>drools-lesson4</module>
|
|
||||||
<module>drools-lesson-pojo</module>
|
<module>drools-lesson-pojo</module>
|
||||||
</modules>
|
</modules>
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
|
|
||||||
<!--plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
|
||||||
<version>2.9.1</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>attach-javadocs</id>
|
|
||||||
<goals>
|
|
||||||
<goal>jar</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
</configuration>
|
|
||||||
</plugin-->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!--plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-gpg-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>sign-artifacts</id>
|
|
||||||
<phase>verify</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>sign</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin-->
|
|
||||||
</plugins>
|
|
||||||
|
|
||||||
|
|
||||||
</build>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.drools</groupId>
|
|
||||||
<artifactId>drools-compiler</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
|
||||||
<artifactId>ecj</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.kie.kogito</groupId>
|
|
||||||
<artifactId>jbpm-bpmn2</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>junit</groupId>
|
|
||||||
<artifactId>junit</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.kie</groupId>
|
|
||||||
<artifactId>kie-api</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -14,11 +14,15 @@
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.drools</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>drools-compiler</artifactId>
|
<artifactId>drools-engine-classic</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>ecj</artifactId>
|
<artifactId>drools-model-compiler</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.drools</groupId>
|
||||||
|
<artifactId>drools-ecj</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kie.kogito</groupId>
|
<groupId>org.kie.kogito</groupId>
|
||||||
|
|
@ -44,11 +48,7 @@
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>${maven.compiler.version}</version>
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.kie</groupId>
|
<groupId>org.kie</groupId>
|
||||||
|
|
|
||||||
|
|
@ -22,45 +22,27 @@ ruleflow-group "total"
|
||||||
$totalBoatTransport : Number( doubleValue > 100 )
|
$totalBoatTransport : Number( doubleValue > 100 )
|
||||||
from accumulate( $s : Step(transportType ==Step.Ship_TransportType) &&
|
from accumulate( $s : Step(transportType ==Step.Ship_TransportType) &&
|
||||||
TransportCostElement(step ==$s, $value : amount ),
|
TransportCostElement(step ==$s, $value : amount ),
|
||||||
init( double total = 0; ),
|
sum($value))
|
||||||
action( total += $value; ),
|
|
||||||
reverse( total -= $value; ),
|
|
||||||
result( total ) )
|
|
||||||
$totalTrainTransport : Number( doubleValue > 100 )
|
$totalTrainTransport : Number( doubleValue > 100 )
|
||||||
from accumulate( $s : Step(transportType ==Step.train_TransportType) &&
|
from accumulate( $s : Step(transportType ==Step.train_TransportType) &&
|
||||||
TransportCostElement(step ==$s, $value : amount ),
|
TransportCostElement(step ==$s, $value : amount ),
|
||||||
init( double total = 0; ),
|
sum($value) )
|
||||||
action( total += $value; ),
|
|
||||||
reverse( total -= $value; ),
|
|
||||||
result( total ) )
|
|
||||||
$totalTruckTransport : Number( doubleValue > 100 )
|
$totalTruckTransport : Number( doubleValue > 100 )
|
||||||
from accumulate( $s : Step(transportType ==Step.truck_TransportType) &&
|
from accumulate( $s : Step(transportType ==Step.truck_TransportType) &&
|
||||||
TransportCostElement(step ==$s, $value : amount ),
|
TransportCostElement(step ==$s, $value : amount ),
|
||||||
init( double total = 0; ),
|
sum($value) )
|
||||||
action( total += $value; ),
|
|
||||||
reverse( total -= $value; ),
|
|
||||||
result( total ) )
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$totalTransport : Number( doubleValue > 100 )
|
$totalTransport : Number( doubleValue > 100 )
|
||||||
from accumulate( TransportCostElement( $value : amount ),
|
from accumulate( TransportCostElement( $value : amount ),
|
||||||
init( double total = 0; ),
|
sum($value) )
|
||||||
action( total += $value; ),
|
|
||||||
reverse( total -= $value; ),
|
|
||||||
result( total ) )
|
|
||||||
$totalTaxes : Number( doubleValue > 100 )
|
$totalTaxes : Number( doubleValue > 100 )
|
||||||
from accumulate( TaxesCostElement( $value : amount ),
|
from accumulate( TaxesCostElement( $value : amount ),
|
||||||
init( double total = 0; ),
|
sum($value))
|
||||||
action( total += $value; ),
|
|
||||||
reverse( total -= $value; ),
|
|
||||||
result( total ) )
|
|
||||||
$totalHandling : Number( doubleValue > 100 )
|
$totalHandling : Number( doubleValue > 100 )
|
||||||
from accumulate( HandlingCostElement( $value : amount ),
|
from accumulate( HandlingCostElement( $value : amount ),
|
||||||
init( double total = 0; ),
|
sum($value) )
|
||||||
action( total += $value; ),
|
|
||||||
reverse( total -= $value; ),
|
|
||||||
result( total ) )
|
|
||||||
then
|
then
|
||||||
System.out.println("NumberOfPallets="+$c.getPallets().size());
|
System.out.println("NumberOfPallets="+$c.getPallets().size());
|
||||||
System.out.println("TotalShipTransport="+$totalBoatTransport);
|
System.out.println("TotalShipTransport="+$totalBoatTransport);
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,15 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.drools</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>drools-compiler</artifactId>
|
<artifactId>drools-engine-classic</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>ecj</artifactId>
|
<artifactId>drools-model-compiler</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.drools</groupId>
|
||||||
|
<artifactId>drools-ecj</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kie.kogito</groupId>
|
<groupId>org.kie.kogito</groupId>
|
||||||
|
|
@ -49,11 +53,7 @@
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>${maven.compiler.version}</version>
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.kie</groupId>
|
<groupId>org.kie</groupId>
|
||||||
|
|
|
||||||
|
|
@ -15,14 +15,19 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kiegroup</groupId>
|
<groupId>org.kiegroup</groupId>
|
||||||
<artifactId>cost-calculation-extension</artifactId>
|
<artifactId>cost-calculation-extension</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.drools</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>drools-compiler</artifactId>
|
<artifactId>drools-engine-classic</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>ecj</artifactId>
|
<artifactId>drools-model-compiler</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.drools</groupId>
|
||||||
|
<artifactId>drools-ecj</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kie.kogito</groupId>
|
<groupId>org.kie.kogito</groupId>
|
||||||
|
|
@ -48,11 +53,7 @@
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>${maven.compiler.version}</version>
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
|
||||||
|
|
@ -84,12 +84,12 @@ public class TestExecercice {
|
||||||
|
|
||||||
this.insertIntoSession(sessionStatefull, request);
|
this.insertIntoSession(sessionStatefull, request);
|
||||||
sessionStatefull.startProcess("P1");
|
sessionStatefull.startProcess("P1");
|
||||||
int i = sessionStatefull.fireAllRules();
|
// int i = sessionStatefull.fireAllRules();
|
||||||
long after = System.currentTimeMillis();
|
long after = System.currentTimeMillis();
|
||||||
System.out.println("NumberRules Executed " + i);
|
// System.out.println("NumberRules Executed " + i);
|
||||||
System.out.println("Rules executed in " + (after - before) + " ms");
|
System.out.println("Rules executed in " + (after - before) + " ms");
|
||||||
Double dd = new Double(i) / (after - before) * 1000;
|
// Double dd = new Double(i) / (after - before) * 1000;
|
||||||
System.out.println("NbreRules/seconde=" + dd);
|
//System.out.println("NbreRules/seconde=" + dd);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,15 @@
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.drools</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>drools-compiler</artifactId>
|
<artifactId>drools-engine-classic</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>ecj</artifactId>
|
<artifactId>drools-model-compiler</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.drools</groupId>
|
||||||
|
<artifactId>drools-ecj</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kie.kogito</groupId>
|
<groupId>org.kie.kogito</groupId>
|
||||||
|
|
@ -42,14 +46,10 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<!--plugin>
|
<plugin>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>${maven.compiler.version}</version>
|
||||||
<configuration>
|
</plugin>
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
</configuration>
|
|
||||||
</plugin-->
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.kie</groupId>
|
<groupId>org.kie</groupId>
|
||||||
<artifactId>kie-maven-plugin</artifactId>
|
<artifactId>kie-maven-plugin</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<kmodule xmlns="http://www.drools.org/xsd/kmodule">
|
<kmodule xmlns="http://www.drools.org/xsd/kmodule">
|
||||||
<kbase name="rules" packages="rules">
|
<kbase packages="rules">
|
||||||
<ksession name="ksession-rules"/>
|
<ksession name="ksession-rules"/>
|
||||||
</kbase>
|
</kbase>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -122,9 +122,9 @@ end
|
||||||
rule "GetSmallestHeight"
|
rule "GetSmallestHeight"
|
||||||
ruleflow-group "distribution"
|
ruleflow-group "distribution"
|
||||||
when
|
when
|
||||||
accumulate( Product( $h : height ,transportType==Product.transportType_pallet );
|
$min : Number( )
|
||||||
$min : min( $h );
|
from accumulate( Product( $h : height ,transportType==Product.transportType_pallet);
|
||||||
true )
|
min( $h ))
|
||||||
|
|
||||||
then
|
then
|
||||||
CalculatedElement elt = new CalculatedElement();
|
CalculatedElement elt = new CalculatedElement();
|
||||||
|
|
|
||||||
|
|
@ -22,45 +22,24 @@ ruleflow-group "total"
|
||||||
$totalBoatTransport : Number( doubleValue > 100 )
|
$totalBoatTransport : Number( doubleValue > 100 )
|
||||||
from accumulate( $s : Step(transportType ==Step.Ship_TransportType) &&
|
from accumulate( $s : Step(transportType ==Step.Ship_TransportType) &&
|
||||||
TransportCostElement(step ==$s, $value : amount ),
|
TransportCostElement(step ==$s, $value : amount ),
|
||||||
init( double total = 0; ),
|
sum($value) )
|
||||||
action( total += $value; ),
|
|
||||||
reverse( total -= $value; ),
|
|
||||||
result( total ) )
|
|
||||||
$totalTrainTransport : Number( doubleValue > 100 )
|
$totalTrainTransport : Number( doubleValue > 100 )
|
||||||
from accumulate( $s : Step(transportType ==Step.train_TransportType) &&
|
from accumulate( $s : Step(transportType ==Step.train_TransportType) &&
|
||||||
TransportCostElement(step ==$s, $value : amount ),
|
TransportCostElement(step ==$s, $value : amount ),
|
||||||
init( double total = 0; ),
|
sum($value) )
|
||||||
action( total += $value; ),
|
|
||||||
reverse( total -= $value; ),
|
|
||||||
result( total ) )
|
|
||||||
$totalTruckTransport : Number( doubleValue > 100 )
|
$totalTruckTransport : Number( doubleValue > 100 )
|
||||||
from accumulate( $s : Step(transportType ==Step.truck_TransportType) &&
|
from accumulate( $s : Step(transportType ==Step.truck_TransportType) &&
|
||||||
TransportCostElement(step ==$s, $value : amount ),
|
TransportCostElement(step ==$s, $value : amount ),
|
||||||
init( double total = 0; ),
|
sum($value) )
|
||||||
action( total += $value; ),
|
|
||||||
reverse( total -= $value; ),
|
|
||||||
result( total ) )
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$totalTransport : Number( doubleValue > 100 )
|
$totalTransport : Number( doubleValue > 100 )
|
||||||
from accumulate( TransportCostElement( $value : amount ),
|
from accumulate( TransportCostElement( $value : amount ),
|
||||||
init( double total = 0; ),
|
sum($value))
|
||||||
action( total += $value; ),
|
|
||||||
reverse( total -= $value; ),
|
|
||||||
result( total ) )
|
|
||||||
$totalTaxes : Number( doubleValue > 100 )
|
$totalTaxes : Number( doubleValue > 100 )
|
||||||
from accumulate( TaxesCostElement( $value : amount ),
|
from accumulate( TaxesCostElement( $value : amount ),
|
||||||
init( double total = 0; ),
|
sum($value) )
|
||||||
action( total += $value; ),
|
|
||||||
reverse( total -= $value; ),
|
|
||||||
result( total ) )
|
|
||||||
$totalHandling : Number( doubleValue > 100 )
|
$totalHandling : Number( doubleValue > 100 )
|
||||||
from accumulate( HandlingCostElement( $value : amount ),
|
from accumulate( HandlingCostElement( $value : amount ),
|
||||||
init( double total = 0; ),
|
sum($value))
|
||||||
action( total += $value; ),
|
|
||||||
reverse( total -= $value; ),
|
|
||||||
result( total ) )
|
|
||||||
then
|
then
|
||||||
System.out.println("NumberOfPallets="+$c.getPallets().size());
|
System.out.println("NumberOfPallets="+$c.getPallets().size());
|
||||||
System.out.println("TotalShipTransport="+$totalBoatTransport);
|
System.out.println("TotalShipTransport="+$totalBoatTransport);
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import org.junit.Test;
|
||||||
import org.kie.api.runtime.KieContainer;
|
import org.kie.api.runtime.KieContainer;
|
||||||
import org.kie.api.runtime.KieSession;
|
import org.kie.api.runtime.KieSession;
|
||||||
import org.kie.api.runtime.StatelessKieSession;
|
import org.kie.api.runtime.StatelessKieSession;
|
||||||
|
import org.kie.api.runtime.process.ProcessInstance;
|
||||||
import util.KnowledgeSessionHelper;
|
import util.KnowledgeSessionHelper;
|
||||||
|
|
||||||
@SuppressWarnings("restriction")
|
@SuppressWarnings("restriction")
|
||||||
|
|
@ -83,13 +84,13 @@ public class TestExecercice {
|
||||||
long before = System.currentTimeMillis();
|
long before = System.currentTimeMillis();
|
||||||
|
|
||||||
this.insertIntoSession(sessionStatefull, request);
|
this.insertIntoSession(sessionStatefull, request);
|
||||||
sessionStatefull.startProcess("P1");
|
ProcessInstance processInstance = sessionStatefull.startProcess("P1");
|
||||||
int i = sessionStatefull.fireAllRules();
|
|
||||||
long after = System.currentTimeMillis();
|
long after = System.currentTimeMillis();
|
||||||
System.out.println("NumberRules Executed " + i);
|
// System.out.println("NumberRules Executed " + i);
|
||||||
System.out.println("Rules executed in " + (after - before) + " ms");
|
System.out.println("Rules executed in " + (after - before) + " ms");
|
||||||
Double dd = new Double(i) / (after - before) * 1000;
|
// Double dd = new Double(i) / (after - before) * 1000;
|
||||||
System.out.println("NbreRules/seconde=" + dd);
|
// System.out.println("NbreRules/seconde=" + dd);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
|
||||||
<output url="file://$MODULE_DIR$/target/classes" />
|
|
||||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
61
pom.xml
61
pom.xml
|
|
@ -22,75 +22,34 @@
|
||||||
<cxf.version>2.2.6</cxf.version>
|
<cxf.version>2.2.6</cxf.version>
|
||||||
<spring-version>3.0.1.RELEASE</spring-version>
|
<spring-version>3.0.1.RELEASE</spring-version>
|
||||||
<commons-logging-version>1.1.1</commons-logging-version>
|
<commons-logging-version>1.1.1</commons-logging-version>
|
||||||
<drools.version>10.0.0</drools.version>
|
<drools.version>10.1.0-aletyx-rc.2</drools.version>
|
||||||
|
<maven.compiler.version>3.14.0</maven.compiler.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
|
||||||
<version>3.5.1</version>
|
|
||||||
<configuration>
|
|
||||||
<source>1.8</source>
|
|
||||||
<target>1.8</target>
|
|
||||||
<release>17</release>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
<pluginManagement>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
|
||||||
<version>2.18.1</version>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</pluginManagement>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kiegroup</groupId>
|
<groupId>org.drools</groupId>
|
||||||
<artifactId>cost-calculation-base</artifactId>
|
<artifactId>drools-bom</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${drools.version}</version>
|
||||||
</dependency>
|
<type>pom</type>
|
||||||
<dependency>
|
<scope>import</scope>
|
||||||
<groupId>org.kiegroup</groupId>
|
|
||||||
<artifactId>cost-calculation-extension</artifactId>
|
|
||||||
<version>${project.version}</version>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>joda-time</groupId>
|
<groupId>joda-time</groupId>
|
||||||
<artifactId>joda-time</artifactId>
|
<artifactId>joda-time</artifactId>
|
||||||
<version>2.2</version>
|
<version>2.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.drools</groupId>
|
|
||||||
<artifactId>drools-compiler</artifactId>
|
|
||||||
<version>${drools.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.jdt.core.compiler</groupId>
|
|
||||||
<artifactId>ecj</artifactId>
|
|
||||||
<version>4.4.2</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.kie.kogito</groupId>
|
<groupId>org.kie.kogito</groupId>
|
||||||
<artifactId>jbpm-bpmn2</artifactId>
|
<artifactId>jbpm-bpmn2</artifactId>
|
||||||
<version>${drools.version}</version>
|
<version>${drools.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.kie</groupId>
|
|
||||||
<artifactId>kie-api</artifactId>
|
|
||||||
<version>${drools.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Logging -->
|
<!-- Logging -->
|
||||||
|
|
|
||||||
Loading…
Add table
editor.link_modal.header
Reference in a new issue