From f3e50317e802fd7f1d31b2bf7b37e7183649e0a0 Mon Sep 17 00:00:00 2001 From: Gabriele-Cardosi Date: Mon, 4 Nov 2024 17:22:39 +0100 Subject: [PATCH 1/4] [NO ISSUE] Reorganizing java examples --- .../dmn-embedded-mode-example}/.gitignore | 0 .../dmn-embedded-mode-example/README.md | 6 ++++ .../dmn-embedded-mode-example}/pom.xml | 11 ++---- .../kogito/decisions/embedded/Applicant.java | 0 .../DecisionsEmbeddedModeExample.java | 0 .../decisions/embedded/LoanApplication.java | 0 .../src/main/resources/META-INF/MANIFEST.MF | 0 .../src/main/resources/META-INF/kmodule.xml | 0 .../embedded/loan-application-age-limit.dmn | 0 kogito-java-examples/pom.xml | 36 +++++++++++++++++++ .../rules-embedded-mode-example/.gitignore | 0 .../rules-embedded-mode-example/README.md | 0 .../rules-embedded-mode-example/pom.xml | 8 ----- .../kie/kogito/rules/embedded/Applicant.java | 0 .../rules/embedded/LoanApplication.java | 0 .../embedded/RulesEmbeddedModeExample.java | 0 .../src/main/resources/META-INF/MANIFEST.MF | 0 .../src/main/resources/META-INF/kmodule.xml | 0 .../embedded/loan-application-age-limit.drl | 0 .../decisions-embedded-mode-example/README.md | 6 ---- kogito-quarkus-examples/pom.xml | 2 -- pom.xml | 1 + 22 files changed, 45 insertions(+), 25 deletions(-) rename {kogito-quarkus-examples/decisions-embedded-mode-example => kogito-java-examples/dmn-embedded-mode-example}/.gitignore (100%) create mode 100644 kogito-java-examples/dmn-embedded-mode-example/README.md rename {kogito-quarkus-examples/decisions-embedded-mode-example => kogito-java-examples/dmn-embedded-mode-example}/pom.xml (90%) rename {kogito-quarkus-examples/decisions-embedded-mode-example => kogito-java-examples/dmn-embedded-mode-example}/src/main/java/org/kie/kogito/decisions/embedded/Applicant.java (100%) rename {kogito-quarkus-examples/decisions-embedded-mode-example => kogito-java-examples/dmn-embedded-mode-example}/src/main/java/org/kie/kogito/decisions/embedded/DecisionsEmbeddedModeExample.java (100%) rename {kogito-quarkus-examples/decisions-embedded-mode-example => kogito-java-examples/dmn-embedded-mode-example}/src/main/java/org/kie/kogito/decisions/embedded/LoanApplication.java (100%) rename {kogito-quarkus-examples/decisions-embedded-mode-example => kogito-java-examples/dmn-embedded-mode-example}/src/main/resources/META-INF/MANIFEST.MF (100%) rename {kogito-quarkus-examples/decisions-embedded-mode-example => kogito-java-examples/dmn-embedded-mode-example}/src/main/resources/META-INF/kmodule.xml (100%) rename {kogito-quarkus-examples/decisions-embedded-mode-example => kogito-java-examples/dmn-embedded-mode-example}/src/main/resources/org/kie/kogito/decisions/embedded/loan-application-age-limit.dmn (100%) create mode 100644 kogito-java-examples/pom.xml rename {kogito-quarkus-examples => kogito-java-examples}/rules-embedded-mode-example/.gitignore (100%) rename {kogito-quarkus-examples => kogito-java-examples}/rules-embedded-mode-example/README.md (100%) rename {kogito-quarkus-examples => kogito-java-examples}/rules-embedded-mode-example/pom.xml (91%) rename {kogito-quarkus-examples => kogito-java-examples}/rules-embedded-mode-example/src/main/java/org/kie/kogito/rules/embedded/Applicant.java (100%) rename {kogito-quarkus-examples => kogito-java-examples}/rules-embedded-mode-example/src/main/java/org/kie/kogito/rules/embedded/LoanApplication.java (100%) rename {kogito-quarkus-examples => kogito-java-examples}/rules-embedded-mode-example/src/main/java/org/kie/kogito/rules/embedded/RulesEmbeddedModeExample.java (100%) rename {kogito-quarkus-examples => kogito-java-examples}/rules-embedded-mode-example/src/main/resources/META-INF/MANIFEST.MF (100%) rename {kogito-quarkus-examples => kogito-java-examples}/rules-embedded-mode-example/src/main/resources/META-INF/kmodule.xml (100%) rename {kogito-quarkus-examples => kogito-java-examples}/rules-embedded-mode-example/src/main/resources/org/kie/kogito/rules/embedded/loan-application-age-limit.drl (100%) delete mode 100644 kogito-quarkus-examples/decisions-embedded-mode-example/README.md diff --git a/kogito-quarkus-examples/decisions-embedded-mode-example/.gitignore b/kogito-java-examples/dmn-embedded-mode-example/.gitignore similarity index 100% rename from kogito-quarkus-examples/decisions-embedded-mode-example/.gitignore rename to kogito-java-examples/dmn-embedded-mode-example/.gitignore diff --git a/kogito-java-examples/dmn-embedded-mode-example/README.md b/kogito-java-examples/dmn-embedded-mode-example/README.md new file mode 100644 index 0000000000..cda00cda4f --- /dev/null +++ b/kogito-java-examples/dmn-embedded-mode-example/README.md @@ -0,0 +1,6 @@ +# decisions-embedded-mode-example + +Is an example of running DMN decisions using plain java. This is an example decision for approving and declining the loan application. Please notice, the decision is only example that do not cover all cases from the banking domain. + +## Execute +Simply run the main class `org.kie.kogito.decisions.embedded.DecisionsEmbeddedModeExample` either from the IDE or your command line. \ No newline at end of file diff --git a/kogito-quarkus-examples/decisions-embedded-mode-example/pom.xml b/kogito-java-examples/dmn-embedded-mode-example/pom.xml similarity index 90% rename from kogito-quarkus-examples/decisions-embedded-mode-example/pom.xml rename to kogito-java-examples/dmn-embedded-mode-example/pom.xml index 75a6778bb0..7f6b3f2658 100644 --- a/kogito-quarkus-examples/decisions-embedded-mode-example/pom.xml +++ b/kogito-java-examples/dmn-embedded-mode-example/pom.xml @@ -22,10 +22,11 @@ 4.0.0 org.kie.kogito.decisions.embedded - decisions-embedded-mode-example + dmn-embedded-mode-example Kogito Example :: Decision Embedded Mode 999-SNAPSHOT kjar + UTF-8 17 @@ -38,19 +39,11 @@ 999-SNAPSHOT 999-SNAPSHOT - 3.8.6 2.0.13 - - io.quarkus - quarkus-bom - ${version.quarkus.platform} - pom - import - org.drools drools-bom diff --git a/kogito-quarkus-examples/decisions-embedded-mode-example/src/main/java/org/kie/kogito/decisions/embedded/Applicant.java b/kogito-java-examples/dmn-embedded-mode-example/src/main/java/org/kie/kogito/decisions/embedded/Applicant.java similarity index 100% rename from kogito-quarkus-examples/decisions-embedded-mode-example/src/main/java/org/kie/kogito/decisions/embedded/Applicant.java rename to kogito-java-examples/dmn-embedded-mode-example/src/main/java/org/kie/kogito/decisions/embedded/Applicant.java diff --git a/kogito-quarkus-examples/decisions-embedded-mode-example/src/main/java/org/kie/kogito/decisions/embedded/DecisionsEmbeddedModeExample.java b/kogito-java-examples/dmn-embedded-mode-example/src/main/java/org/kie/kogito/decisions/embedded/DecisionsEmbeddedModeExample.java similarity index 100% rename from kogito-quarkus-examples/decisions-embedded-mode-example/src/main/java/org/kie/kogito/decisions/embedded/DecisionsEmbeddedModeExample.java rename to kogito-java-examples/dmn-embedded-mode-example/src/main/java/org/kie/kogito/decisions/embedded/DecisionsEmbeddedModeExample.java diff --git a/kogito-quarkus-examples/decisions-embedded-mode-example/src/main/java/org/kie/kogito/decisions/embedded/LoanApplication.java b/kogito-java-examples/dmn-embedded-mode-example/src/main/java/org/kie/kogito/decisions/embedded/LoanApplication.java similarity index 100% rename from kogito-quarkus-examples/decisions-embedded-mode-example/src/main/java/org/kie/kogito/decisions/embedded/LoanApplication.java rename to kogito-java-examples/dmn-embedded-mode-example/src/main/java/org/kie/kogito/decisions/embedded/LoanApplication.java diff --git a/kogito-quarkus-examples/decisions-embedded-mode-example/src/main/resources/META-INF/MANIFEST.MF b/kogito-java-examples/dmn-embedded-mode-example/src/main/resources/META-INF/MANIFEST.MF similarity index 100% rename from kogito-quarkus-examples/decisions-embedded-mode-example/src/main/resources/META-INF/MANIFEST.MF rename to kogito-java-examples/dmn-embedded-mode-example/src/main/resources/META-INF/MANIFEST.MF diff --git a/kogito-quarkus-examples/decisions-embedded-mode-example/src/main/resources/META-INF/kmodule.xml b/kogito-java-examples/dmn-embedded-mode-example/src/main/resources/META-INF/kmodule.xml similarity index 100% rename from kogito-quarkus-examples/decisions-embedded-mode-example/src/main/resources/META-INF/kmodule.xml rename to kogito-java-examples/dmn-embedded-mode-example/src/main/resources/META-INF/kmodule.xml diff --git a/kogito-quarkus-examples/decisions-embedded-mode-example/src/main/resources/org/kie/kogito/decisions/embedded/loan-application-age-limit.dmn b/kogito-java-examples/dmn-embedded-mode-example/src/main/resources/org/kie/kogito/decisions/embedded/loan-application-age-limit.dmn similarity index 100% rename from kogito-quarkus-examples/decisions-embedded-mode-example/src/main/resources/org/kie/kogito/decisions/embedded/loan-application-age-limit.dmn rename to kogito-java-examples/dmn-embedded-mode-example/src/main/resources/org/kie/kogito/decisions/embedded/loan-application-age-limit.dmn diff --git a/kogito-java-examples/pom.xml b/kogito-java-examples/pom.xml new file mode 100644 index 0000000000..030ec77936 --- /dev/null +++ b/kogito-java-examples/pom.xml @@ -0,0 +1,36 @@ + + + 4.0.0 + + org.kie.kogito.examples + kogito-examples + 999-SNAPSHOT + + + kogito-java-examples + pom + Kogito Example :: Java + + + + 17 + 17 + UTF-8 + + + + + default + + true + + + dmn-embedded-mode-example + rules-embedded-mode-example + + + + + \ No newline at end of file diff --git a/kogito-quarkus-examples/rules-embedded-mode-example/.gitignore b/kogito-java-examples/rules-embedded-mode-example/.gitignore similarity index 100% rename from kogito-quarkus-examples/rules-embedded-mode-example/.gitignore rename to kogito-java-examples/rules-embedded-mode-example/.gitignore diff --git a/kogito-quarkus-examples/rules-embedded-mode-example/README.md b/kogito-java-examples/rules-embedded-mode-example/README.md similarity index 100% rename from kogito-quarkus-examples/rules-embedded-mode-example/README.md rename to kogito-java-examples/rules-embedded-mode-example/README.md diff --git a/kogito-quarkus-examples/rules-embedded-mode-example/pom.xml b/kogito-java-examples/rules-embedded-mode-example/pom.xml similarity index 91% rename from kogito-quarkus-examples/rules-embedded-mode-example/pom.xml rename to kogito-java-examples/rules-embedded-mode-example/pom.xml index ca6a7d6879..2a5eb76930 100644 --- a/kogito-quarkus-examples/rules-embedded-mode-example/pom.xml +++ b/kogito-java-examples/rules-embedded-mode-example/pom.xml @@ -38,19 +38,11 @@ 999-SNAPSHOT 999-SNAPSHOT - 3.8.6 2.0.13 - - io.quarkus - quarkus-bom - ${version.quarkus.platform} - pom - import - org.drools drools-bom diff --git a/kogito-quarkus-examples/rules-embedded-mode-example/src/main/java/org/kie/kogito/rules/embedded/Applicant.java b/kogito-java-examples/rules-embedded-mode-example/src/main/java/org/kie/kogito/rules/embedded/Applicant.java similarity index 100% rename from kogito-quarkus-examples/rules-embedded-mode-example/src/main/java/org/kie/kogito/rules/embedded/Applicant.java rename to kogito-java-examples/rules-embedded-mode-example/src/main/java/org/kie/kogito/rules/embedded/Applicant.java diff --git a/kogito-quarkus-examples/rules-embedded-mode-example/src/main/java/org/kie/kogito/rules/embedded/LoanApplication.java b/kogito-java-examples/rules-embedded-mode-example/src/main/java/org/kie/kogito/rules/embedded/LoanApplication.java similarity index 100% rename from kogito-quarkus-examples/rules-embedded-mode-example/src/main/java/org/kie/kogito/rules/embedded/LoanApplication.java rename to kogito-java-examples/rules-embedded-mode-example/src/main/java/org/kie/kogito/rules/embedded/LoanApplication.java diff --git a/kogito-quarkus-examples/rules-embedded-mode-example/src/main/java/org/kie/kogito/rules/embedded/RulesEmbeddedModeExample.java b/kogito-java-examples/rules-embedded-mode-example/src/main/java/org/kie/kogito/rules/embedded/RulesEmbeddedModeExample.java similarity index 100% rename from kogito-quarkus-examples/rules-embedded-mode-example/src/main/java/org/kie/kogito/rules/embedded/RulesEmbeddedModeExample.java rename to kogito-java-examples/rules-embedded-mode-example/src/main/java/org/kie/kogito/rules/embedded/RulesEmbeddedModeExample.java diff --git a/kogito-quarkus-examples/rules-embedded-mode-example/src/main/resources/META-INF/MANIFEST.MF b/kogito-java-examples/rules-embedded-mode-example/src/main/resources/META-INF/MANIFEST.MF similarity index 100% rename from kogito-quarkus-examples/rules-embedded-mode-example/src/main/resources/META-INF/MANIFEST.MF rename to kogito-java-examples/rules-embedded-mode-example/src/main/resources/META-INF/MANIFEST.MF diff --git a/kogito-quarkus-examples/rules-embedded-mode-example/src/main/resources/META-INF/kmodule.xml b/kogito-java-examples/rules-embedded-mode-example/src/main/resources/META-INF/kmodule.xml similarity index 100% rename from kogito-quarkus-examples/rules-embedded-mode-example/src/main/resources/META-INF/kmodule.xml rename to kogito-java-examples/rules-embedded-mode-example/src/main/resources/META-INF/kmodule.xml diff --git a/kogito-quarkus-examples/rules-embedded-mode-example/src/main/resources/org/kie/kogito/rules/embedded/loan-application-age-limit.drl b/kogito-java-examples/rules-embedded-mode-example/src/main/resources/org/kie/kogito/rules/embedded/loan-application-age-limit.drl similarity index 100% rename from kogito-quarkus-examples/rules-embedded-mode-example/src/main/resources/org/kie/kogito/rules/embedded/loan-application-age-limit.drl rename to kogito-java-examples/rules-embedded-mode-example/src/main/resources/org/kie/kogito/rules/embedded/loan-application-age-limit.drl diff --git a/kogito-quarkus-examples/decisions-embedded-mode-example/README.md b/kogito-quarkus-examples/decisions-embedded-mode-example/README.md deleted file mode 100644 index 1a6f797d0c..0000000000 --- a/kogito-quarkus-examples/decisions-embedded-mode-example/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# decisions-embedded-mode-example - -Is an example of runing DMN decisions using plain java. This is an example decision for approving and declining the loan application. Please notice, the decision is only example that do not cover all cases from the banking domain. - -## Execute -Simply run the main class `org.kie.kogito.decisions.embedded.DecisionsEmbeddedModeExample` either from the IDE or your command line. \ No newline at end of file diff --git a/kogito-quarkus-examples/pom.xml b/kogito-quarkus-examples/pom.xml index bfc912b7cc..1b555b56d0 100644 --- a/kogito-quarkus-examples/pom.xml +++ b/kogito-quarkus-examples/pom.xml @@ -50,7 +50,6 @@ decisiontable-quarkus-example - decisions-embedded-mode-example dmn-15-quarkus-example dmn-drools-quarkus-metrics dmn-event-driven-quarkus @@ -100,7 +99,6 @@ process-usertasks-timer-quarkus-with-console process-usertasks-with-security-oidc-quarkus process-usertasks-with-security-quarkus - rules-embedded-mode-example rules-incubation-api-quarkus rules-legacy-quarkus-example rules-legacy-scesim-quarkus-example diff --git a/pom.xml b/pom.xml index 4f796475d7..1626279866 100755 --- a/pom.xml +++ b/pom.xml @@ -137,6 +137,7 @@ true + kogito-java-examples kogito-quarkus-examples kogito-springboot-examples serverless-workflow-examples From ed1490bbec4c503f82470ae5352f754986467807 Mon Sep 17 00:00:00 2001 From: Gabriele-Cardosi Date: Mon, 4 Nov 2024 17:26:56 +0100 Subject: [PATCH 2/4] [NO ISSUE] Reorganizing java examples --- kogito-java-examples/pom.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/kogito-java-examples/pom.xml b/kogito-java-examples/pom.xml index 030ec77936..c21967f2c3 100644 --- a/kogito-java-examples/pom.xml +++ b/kogito-java-examples/pom.xml @@ -13,13 +13,6 @@ pom Kogito Example :: Java - - - 17 - 17 - UTF-8 - - default From bed608a775cc69c5009e7f2ed3e6300ce7bde9c7 Mon Sep 17 00:00:00 2001 From: Gabriele-Cardosi Date: Mon, 4 Nov 2024 17:36:35 +0100 Subject: [PATCH 3/4] [NO ISSUE] Fixing ci --- .ci/jenkins/Jenkinsfile.deploy | 2 +- .ci/jenkins/dsl/jobs.groovy | 9 +++++++++ .github/workflows/pr-kogito-examples.yml | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index 17f5aa52b2..1f64eac57b 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -162,7 +162,7 @@ pipeline { getMavenCommand() .withOptions(env.BUILD_MVN_OPTS_CURRENT ? [ env.BUILD_MVN_OPTS_CURRENT ] : []) .withOptions(env.KOGITO_EXAMPLES_BUILD_MVN_OPTS ? [ env.KOGITO_EXAMPLES_BUILD_MVN_OPTS ] : []) - .withOptions("-pl .,kogito-quarkus-examples,kogito-springboot-examples,serverless-workflow-examples") + .withOptions("-pl .,kogito-java-examples,kogito-quarkus-examples,kogito-springboot-examples,serverless-workflow-examples") .skipTests(true) .withSettingsXmlFile(MAVEN_SETTINGS_FILE) .run("deploy -DdeployAtEnd -Dapache.repository.username=${REPOSITORY_USER} -Dapache.repository.password=${REPOSITORY_TOKEN} -DretryFailedDeploymentCount=5") diff --git a/.ci/jenkins/dsl/jobs.groovy b/.ci/jenkins/dsl/jobs.groovy index ff19cc8924..78895e6f71 100644 --- a/.ci/jenkins/dsl/jobs.groovy +++ b/.ci/jenkins/dsl/jobs.groovy @@ -46,6 +46,15 @@ Map getMultijobPRConfig(JenkinsFolder jobFolder) { parallel: true, buildchain: true, jobs : [ + [ + id: 'kogito-java-examples', + primary: true, + env : [ + // Sonarcloud analysis is disabled for examples + KOGITO_EXAMPLES_SUBFOLDER_POM: 'kogito-java-examples/', + BUILD_MVN_OPTS_CURRENT: "${defaultBuildMvnOptsCurrent} ${getExamplesBuildMvnOptions(jobFolder).join(' ')}", + ] + ], [ id: 'kogito-quarkus-examples', primary: true, diff --git a/.github/workflows/pr-kogito-examples.yml b/.github/workflows/pr-kogito-examples.yml index b186957f84..4089fd8b6e 100644 --- a/.github/workflows/pr-kogito-examples.yml +++ b/.github/workflows/pr-kogito-examples.yml @@ -20,11 +20,14 @@ jobs: timeout-minutes: 180 strategy: matrix: - job_name: [ kogito-quarkus-examples, kogito-springboot-examples, serverless-workflow-examples ] + job_name: [ kogito-java-examples, kogito-quarkus-examples, kogito-springboot-examples, serverless-workflow-examples ] os: [ubuntu-latest] java-version: [17] maven-version: ['3.9.6'] include: + - job_name: kogito-java-examples + repository: incubator-kie-kogito-examples + env_KOGITO_EXAMPLES_SUBFOLDER_POM: kogito-java-examples/ - job_name: kogito-quarkus-examples repository: incubator-kie-kogito-examples env_KOGITO_EXAMPLES_SUBFOLDER_POM: kogito-quarkus-examples/ From cee472e4b473b33369548e6f3fe334a79d1fcefe Mon Sep 17 00:00:00 2001 From: Gabriele-Cardosi Date: Tue, 5 Nov 2024 10:16:01 +0100 Subject: [PATCH 4/4] [NO ISSUE] Fix as per PR suggestion --- kogito-java-examples/dmn-embedded-mode-example/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kogito-java-examples/dmn-embedded-mode-example/pom.xml b/kogito-java-examples/dmn-embedded-mode-example/pom.xml index 7f6b3f2658..7c54fe637e 100644 --- a/kogito-java-examples/dmn-embedded-mode-example/pom.xml +++ b/kogito-java-examples/dmn-embedded-mode-example/pom.xml @@ -23,7 +23,7 @@ 4.0.0 org.kie.kogito.decisions.embedded dmn-embedded-mode-example - Kogito Example :: Decision Embedded Mode + Kogito Example :: DMN Embedded Mode 999-SNAPSHOT kjar