Skip to content

Commit

Permalink
[incubator-kie-issues#1609] Migrate dmn examples to springboot (apach…
Browse files Browse the repository at this point in the history
…e#2037)

* [incubator-kie-issues#1609] Migrated dmn-15-springboot-example

* [incubator-kie-issues#1609] Migrated dmn-resource-jar-springboot-example

* [incubator-kie-issues#1609] Remove duplicated module declaration

---------

Co-authored-by: Gabriele-Cardosi <gabriele.cardosi@ibm.com>
  • Loading branch information
2 people authored and rgdoliveira committed Nov 18, 2024
1 parent 50cce16 commit c5c7a27
Show file tree
Hide file tree
Showing 29 changed files with 2,182 additions and 22 deletions.
2 changes: 1 addition & 1 deletion kogito-quarkus-examples/dmn-15-quarkus-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ In this case, the models are contained in the `org.kie:kie-dmn-test-resources` a

Extracted models could be found under `target/generated-resources/valid_models.DMNv1_5` directory.

This example also features the `org.kie.dmn.runtime.typecheck` enviropnment variable, to enforce constraint checks
This example also features the `org.kie.dmn.runtime.typecheck` environment variable, to enforce constraint checks

```xml
<plugin>
Expand Down
4 changes: 2 additions & 2 deletions kogito-quarkus-examples/dmn-15-quarkus-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<resource>
<directory>src/main/resources</directory>
</resource>
<!-- DMN generated resources unpacked from org.kie.kogito.examples:dmn-resource-jar -->
<!-- DMN generated resources unpacked from org.kie:kie-dmn-test-resources -->
<resource>
<directory>${project.build.directory}/generated-resources</directory>
</resource>
Expand Down Expand Up @@ -136,7 +136,7 @@
</execution>
</executions>
</plugin>
<!-- Unpack DMN resources from from org.kie.kogito.examples:dmn-resource-jar -->
<!-- Unpack DMN resources from from org.kie:kie-dmn-test-resources -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand Down
19 changes: 10 additions & 9 deletions kogito-quarkus-examples/dmn-resource-jar-quarkus-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,25 @@ When using native image compilation, you will also need:
### Compile and Run in Local Dev Mode

```
cd ./dmn-consumer-example
mvn clean compile quarkus:dev
mvn clean install
cd ./dmn-quarkus-consumer-example
mvn quarkus:dev
```

(This requires a previous installation of `dmn-resource-jar`)
(This requires a previous installation of `dmn-quarkus-resource-jar`)

### Package and Run in JVM mode

```
mvn clean package
java -jar ./dmn-consumer-example/target/quarkus-app/quarkus-run.jar
java -jar ./dmn-quarkus-consumer-example/target/quarkus-app/quarkus-run.jar
```

or on Windows

```
mvn clean package
java -jar .\dmn-consumer-example\target\quarkus-app\quarkus-run.jar
java -jar .\dmn-quarkus-consumer-example\target\quarkus-app\quarkus-run.jar
```

### Package and Run using Local Native Image
Expand All @@ -50,10 +51,10 @@ Note that this requires GRAALVM_HOME to point to a valid GraalVM installation
mvn clean package -Pnative
```

To run the generated native executable, generated in `./dmn-consumer-example/target/`, execute
To run the generated native executable, generated in `./dmn-quarkus-consumer-example/target/`, execute

```
./dmn-consumer-example/target/dmn-consumer-example-runner
./dmn-quarkus-consumer-example/target/dmn-quarkus-consumer-example-runner
```

Note: This does not yet work on Windows, GraalVM and Quarkus should be rolling out support for Windows soon.
Expand All @@ -74,12 +75,12 @@ Validate the functionality of DMN models before deploying them into a production
To define test scenarios you need to create a .scesim file inside your project and link it to the DMN model you want to be tested. Run all Test Scenarios, executing:

```sh
cd ./dmn-consumer-example
cd ./dmn-quarkus-consumer-example
mvn clean test
```
See results in surefire test report `target/surefire-reports`

(This requires a previous installation of `dmn-resource-jar`)
(This requires a previous installation of `dmn-quarkus-resource-jar`)

## Example Usage

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<version>999-SNAPSHOT</version>
</parent>

<artifactId>dmn-consumer-example</artifactId>
<artifactId>dmn-quarkus-consumer-example</artifactId>

<properties>
<quarkus-plugin.version>3.8.6</quarkus-plugin.version>
Expand All @@ -26,7 +26,7 @@
<dependencies>
<dependency>
<groupId>org.kie.kogito.examples</groupId>
<artifactId>dmn-resource-jar</artifactId>
<artifactId>dmn-quarkus-resource-jar</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand All @@ -48,7 +48,7 @@
<dependencies>
<dependency>
<groupId>org.kie.kogito.examples</groupId>
<artifactId>dmn-resource-jar</artifactId>
<artifactId>dmn-quarkus-resource-jar</artifactId>
</dependency>
<dependency>
<groupId>org.drools</groupId>
Expand Down Expand Up @@ -96,7 +96,7 @@
<resource>
<directory>src/main/resources</directory>
</resource>
<!-- DMN generated resources unpacked from org.kie.kogito.examples:dmn-resource-jar -->
<!-- DMN generated resources unpacked from org.kie.kogito.examples:dmn-quarkus-resource-jar -->
<resource>
<directory>${project.build.directory}/generated-resources</directory>
</resource>
Expand All @@ -114,7 +114,7 @@
</execution>
</executions>
</plugin>
<!-- Unpack DMN resources from from org.kie.kogito.examples:dmn-resource-jar -->
<!-- Unpack DMN resources from from org.kie.kogito.examples:dmn-quarkus-resource-jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand All @@ -130,7 +130,7 @@
<artifactItems>
<artifactItem>
<groupId>org.kie.kogito.examples</groupId>
<artifactId>dmn-resource-jar</artifactId>
<artifactId>dmn-quarkus-resource-jar</artifactId>
<version>${project.version}</version>
<type>jar</type>
<overWrite>true</overWrite>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<version>999-SNAPSHOT</version>
</parent>

<artifactId>dmn-resource-jar</artifactId>
<artifactId>dmn-quarkus-resource-jar</artifactId>

<properties>
<maven.compiler.source>17</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</properties>
<packaging>pom</packaging>
<modules>
<module>dmn-resource-jar</module>
<module>dmn-consumer-example</module>
<module>dmn-quarkus-resource-jar</module>
<module>dmn-quarkus-consumer-example</module>
</modules>
</project>
Loading

0 comments on commit c5c7a27

Please sign in to comment.