Skip to content

Commit 06c3b5d

Browse files
Merge pull request eugenp#2173 from eugenp/bael-804
BAEL-804 - Minor refactors
2 parents 4f5ccb9 + 94ac9f9 commit 06c3b5d

19 files changed

Lines changed: 306 additions & 458 deletions

‎spring-drools/pom.xml‎

Lines changed: 10 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,10 @@
1414
</parent>
1515

1616
<properties>
17-
<spring-boot-version>1.1.1.RELEASE</spring-boot-version>
18-
<http-component-version>4.0-alpha6</http-component-version>
19-
<drools-version>7.0.0.CR1</drools-version>
20-
<apache-poi-version>3.13</apache-poi-version>
17+
<drools-version>7.0.0.Final</drools-version>
18+
<spring-framework.version>4.3.3.RELEASE</spring-framework.version>
2119
</properties>
22-
<dependencyManagement>
23-
<dependencies>
24-
<dependency>
25-
<groupId>io.spring.platform</groupId>
26-
<artifactId>platform-bom</artifactId>
27-
<version>${spring-boot-version}</version>
28-
<type>pom</type>
29-
<scope>import</scope>
30-
</dependency>
31-
</dependencies>
32-
</dependencyManagement>
3320
<dependencies>
34-
<dependency>
35-
<groupId>org.springframework.boot</groupId>
36-
<artifactId>spring-boot-starter-web</artifactId>
37-
</dependency>
38-
39-
<dependency>
40-
<groupId>org.springframework.boot</groupId>
41-
<artifactId>spring-boot-starter-test</artifactId>
42-
<scope>test</scope>
43-
</dependency>
44-
<dependency>
45-
<groupId>org.springframework.boot</groupId>
46-
<artifactId>spring-boot-starter-actuator</artifactId>
47-
</dependency>
48-
<dependency>
49-
<groupId>org.apache.httpcomponents</groupId>
50-
<artifactId>httpcore</artifactId>
51-
<version>${http-component-version}</version>
52-
</dependency>
5321
<!-- ... -->
5422
<dependency>
5523
<groupId>org.kie</groupId>
@@ -61,7 +29,6 @@
6129
<artifactId>drools-decisiontables</artifactId>
6230
<version>${drools-version}</version>
6331
</dependency>
64-
6532
<dependency>
6633
<groupId>org.drools</groupId>
6734
<artifactId>drools-core</artifactId>
@@ -72,54 +39,18 @@
7239
<artifactId>drools-compiler</artifactId>
7340
<version>${drools-version}</version>
7441
</dependency>
75-
<dependency>
76-
<groupId>org.apache.poi</groupId>
77-
<artifactId>poi</artifactId>
78-
<version>${apache-poi-version}</version>
79-
</dependency>
8042

81-
<dependency>
82-
<groupId>org.apache.poi</groupId>
83-
<artifactId>poi-ooxml</artifactId>
84-
<version>${apache-poi-version}</version>
85-
</dependency>
43+
<!--spring integration-->
8644
<dependency>
8745
<groupId>org.kie</groupId>
8846
<artifactId>kie-spring</artifactId>
89-
<version>6.4.0.Final</version>
90-
<exclusions>
91-
<exclusion>
92-
<groupId>org.springframework</groupId>
93-
<artifactId>spring-tx</artifactId>
94-
</exclusion>
95-
<exclusion>
96-
<groupId>org.springframework</groupId>
97-
<artifactId>spring-beans</artifactId>
98-
</exclusion>
99-
<exclusion>
100-
<groupId>org.springframework</groupId>
101-
<artifactId>spring-core</artifactId>
102-
</exclusion>
103-
<exclusion>
104-
<groupId>org.springframework</groupId>
105-
<artifactId>spring-context</artifactId>
106-
</exclusion>
107-
</exclusions>
47+
<version>${drools-version}</version>
48+
</dependency>
49+
<dependency>
50+
<groupId>org.springframework</groupId>
51+
<artifactId>spring-test</artifactId>
52+
<version>${spring-framework.version}</version>
53+
<scope>test</scope>
10854
</dependency>
10955
</dependencies>
110-
<build>
111-
<plugins>
112-
<plugin>
113-
<groupId>org.springframework.boot</groupId>
114-
<artifactId>spring-boot-maven-plugin</artifactId>
115-
<executions>
116-
<execution>
117-
<goals>
118-
<goal>repackage</goal>
119-
</goals>
120-
</execution>
121-
</executions>
122-
</plugin>
123-
</plugins>
124-
</build>
12556
</project>

‎spring-drools/src/main/java/com/baeldung/spring/drools/Application.java‎

Lines changed: 0 additions & 30 deletions
This file was deleted.

‎spring-drools/src/main/java/com/baeldung/spring/drools/DroolConfiguration.java‎

Lines changed: 0 additions & 83 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.baeldung.spring.drools.app;
2+
3+
import org.springframework.context.ApplicationContext;
4+
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
5+
6+
import com.baeldung.spring.drools.model.TaxiRide;
7+
import com.baeldung.spring.drools.model.Fare;
8+
import com.baeldung.spring.drools.service.TaxiFareCalculatorService;
9+
import com.baeldung.spring.drools.service.TaxiFareConfiguration;
10+
11+
public class ApplicationRunner {
12+
13+
public static void main(String[] args) {
14+
ApplicationContext context = new AnnotationConfigApplicationContext(TaxiFareConfiguration.class);
15+
TaxiFareCalculatorService orderService = context.getBean(TaxiFareCalculatorService.class);
16+
17+
TaxiRide taxiRide = new TaxiRide();
18+
taxiRide.setbNightSurcharge(true);
19+
taxiRide.setDistanceInMile(190L);
20+
Fare rideFare = new Fare();
21+
orderService.calculateFare(taxiRide, rideFare);
22+
}
23+
24+
}

‎spring-drools/src/main/java/com/baeldung/spring/drools/model/Applicant.java‎

Lines changed: 0 additions & 48 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package com.baeldung.spring.drools.model;
2+
3+
public class Fare {
4+
5+
private Long nightSurcharge;
6+
private Long rideFare;
7+
private Long totalFare;
8+
9+
public Fare() {
10+
nightSurcharge = 0L;
11+
rideFare = 0L;
12+
totalFare = 0L;
13+
}
14+
15+
public Long getNightSurcharge() {
16+
return nightSurcharge;
17+
}
18+
19+
public void setNightSurcharge(Long nightSurcharge) {
20+
this.nightSurcharge = nightSurcharge;
21+
}
22+
23+
public Long getRideFare() {
24+
return rideFare;
25+
}
26+
27+
public void setRideFare(Long rideFare) {
28+
this.rideFare = rideFare;
29+
}
30+
31+
public Long getTotalFare() {
32+
return nightSurcharge + rideFare;
33+
}
34+
35+
public void setTotalFare(Long totalFare) {
36+
this.totalFare = totalFare;
37+
}
38+
39+
}

‎spring-drools/src/main/java/com/baeldung/spring/drools/model/Product.java‎

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)