diff --git a/.ci/environments/quarkus-3/patches/0001_before_sh.patch b/.ci/environments/quarkus-3/patches/0001_before_sh.patch index 11ffbf329c..7ca34e741f 100644 --- a/.ci/environments/quarkus-3/patches/0001_before_sh.patch +++ b/.ci/environments/quarkus-3/patches/0001_before_sh.patch @@ -3812,7 +3812,7 @@ index 13129a50a..a0b3ebde7 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-event-service/pom.xml b/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-event-service/pom.xml index 4e4602148..6f4e3d857 100644 --- a/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-event-service/pom.xml @@ -3833,7 +3833,7 @@ index 4e4602148..6f4e3d857 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-event-service/src/main/java/org/kie/kogito/examples/CallbackResource.java b/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-event-service/src/main/java/org/kie/kogito/examples/CallbackResource.java index 91ad34b97..a28d9f40e 100644 --- a/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/callback-event-service/src/main/java/org/kie/kogito/examples/CallbackResource.java @@ -3893,7 +3893,7 @@ index 76a5fd018..a20b704ed 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-callback-quarkus/pom.xml b/serverless-workflow-examples/serverless-workflow-callback-quarkus/pom.xml index 2f1c84d57..4dbcc325b 100644 --- a/serverless-workflow-examples/serverless-workflow-callback-quarkus/pom.xml @@ -3914,7 +3914,7 @@ index 2f1c84d57..4dbcc325b 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-callback-quarkus/src/main/java/org/kie/kogito/examples/PrintService.java b/serverless-workflow-examples/serverless-workflow-callback-quarkus/src/main/java/org/kie/kogito/examples/PrintService.java index a1ee770e7..77b636420 100644 --- a/serverless-workflow-examples/serverless-workflow-callback-quarkus/src/main/java/org/kie/kogito/examples/PrintService.java @@ -3950,7 +3950,7 @@ index 519234897..05e2b0dd8 100644 + 3.0.0-SNAPSHOT 11 3.8.1 - 3.0.0-M7 + 3.1.2 3.5.4 @@ -3978,7 +3978,7 @@ index 480206687..015d82784 100644 - 2.0.0-SNAPSHOT + 3.0.0-SNAPSHOT 3.8.1 - 3.0.0-M7 + 3.1.2 11 diff --git a/serverless-workflow-examples/serverless-workflow-consuming-events-over-http-quarkus/pom.xml b/serverless-workflow-examples/serverless-workflow-consuming-events-over-http-quarkus/pom.xml index 4cc5b957b..15d303eec 100644 @@ -4000,7 +4000,7 @@ index 4cc5b957b..15d303eec 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-correlation-quarkus/pom.xml b/serverless-workflow-examples/serverless-workflow-correlation-quarkus/pom.xml index 4cb87747c..f67a88ec0 100644 --- a/serverless-workflow-examples/serverless-workflow-correlation-quarkus/pom.xml @@ -4021,7 +4021,7 @@ index 4cb87747c..f67a88ec0 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-correlation-quarkus/src/main/java/org/kie/kogito/examples/EventsService.java b/serverless-workflow-examples/serverless-workflow-correlation-quarkus/src/main/java/org/kie/kogito/examples/EventsService.java index ff08208ed..82e1404b2 100644 --- a/serverless-workflow-examples/serverless-workflow-correlation-quarkus/src/main/java/org/kie/kogito/examples/EventsService.java @@ -4080,7 +4080,7 @@ index bb232125f..ceedd0272 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-custom-function-knative/workflow/pom.xml b/serverless-workflow-examples/serverless-workflow-custom-function-knative/workflow/pom.xml index a92ad9e89..94b538fb1 100644 --- a/serverless-workflow-examples/serverless-workflow-custom-function-knative/workflow/pom.xml @@ -4101,7 +4101,7 @@ index a92ad9e89..94b538fb1 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-custom-type/pom.xml b/serverless-workflow-examples/serverless-workflow-custom-type/pom.xml index 519f3d236..43270cc84 100644 --- a/serverless-workflow-examples/serverless-workflow-custom-type/pom.xml @@ -4120,7 +4120,7 @@ index 519f3d236..43270cc84 100644 kogito-bom - 2.0.0-SNAPSHOT + 3.0.0-SNAPSHOT - 3.0.0-M7 + 3.1.2 11 1.7.30 diff --git a/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc/src/main/java/org/kie/kogito/examples/sw/custom/RPCCustomWorkItemHandler.java b/serverless-workflow-examples/serverless-workflow-custom-type/serverless-workflow-custom-rpc/src/main/java/org/kie/kogito/examples/sw/custom/RPCCustomWorkItemHandler.java @@ -4174,7 +4174,7 @@ index b7b0a4ada..2e0b986da 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-data-index-quarkus/src/main/java/org/kie/kogito/examples/PrintService.java b/serverless-workflow-examples/serverless-workflow-data-index-quarkus/src/main/java/org/kie/kogito/examples/PrintService.java index 80259f870..14cb03297 100644 --- a/serverless-workflow-examples/serverless-workflow-data-index-quarkus/src/main/java/org/kie/kogito/examples/PrintService.java @@ -4210,7 +4210,7 @@ index f4f65c528..17baa4d8a 100644 + 3.0.0-SNAPSHOT 11 3.8.1 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-error-quarkus/src/main/java/org/kie/kogito/examples/EvenService.java b/serverless-workflow-examples/serverless-workflow-error-quarkus/src/main/java/org/kie/kogito/examples/EvenService.java index 59c077d86..6468384d5 100644 --- a/serverless-workflow-examples/serverless-workflow-error-quarkus/src/main/java/org/kie/kogito/examples/EvenService.java @@ -4244,7 +4244,7 @@ index 874e192c9..7379a037a 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 - 2.0.0-SNAPSHOT + 3.0.0-SNAPSHOT @@ -4282,7 +4282,7 @@ diff --git a/serverless-workflow-examples/serverless-workflow-events-quarkus/src index 287b775c6..c969da8c7 100644 --- a/serverless-workflow-examples/serverless-workflow-events-quarkus/src/main/java/org/kogito/serverless/examples/AvroMarshallerProducer.java +++ b/serverless-workflow-examples/serverless-workflow-events-quarkus/src/main/java/org/kogito/serverless/examples/AvroMarshallerProducer.java -@@ -17,11 +17,11 @@ package org.kogito.serverless.examples; +@@ -17,11 +17,11 @@ package org.acme.serverless.examples; import java.io.IOException; @@ -4304,7 +4304,7 @@ index a9615feff..54a8b9a5a 100644 +++ b/serverless-workflow-examples/serverless-workflow-events-quarkus/src/main/java/org/kogito/serverless/examples/DecisionResource.java @@ -15,11 +15,11 @@ */ - package org.kogito.serverless.examples; + package org.acme.serverless.examples; -import javax.inject.Inject; -import javax.ws.rs.GET; @@ -4360,7 +4360,7 @@ index d866929bf..2144e8b6b 100644 + 3.0.0-SNAPSHOT 11 3.8.1 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-foreach-quarkus/pom.xml b/serverless-workflow-examples/serverless-workflow-foreach-quarkus/pom.xml index 781162a98..dffac3171 100644 --- a/serverless-workflow-examples/serverless-workflow-foreach-quarkus/pom.xml @@ -4381,7 +4381,7 @@ index 781162a98..dffac3171 100644 + 3.0.0-SNAPSHOT 11 3.8.1 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/pom.xml b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/pom.xml index 9424dc1b5..1d43def93 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/pom.xml @@ -4402,7 +4402,7 @@ index 9424dc1b5..1d43def93 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/resources/AppointmentResource.java b/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/resources/AppointmentResource.java index b5584de03..1f9a0bdb8 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/src/main/java/org/acme/sw/onboarding/resources/AppointmentResource.java @@ -4539,7 +4539,7 @@ index 35c91d68b..a4136e6f8 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-functions-quarkus/src/main/java/org/acme/numbers/NumbersResource.java b/serverless-workflow-examples/serverless-workflow-functions-quarkus/src/main/java/org/acme/numbers/NumbersResource.java index b9cbab2e8..6980366b7 100644 --- a/serverless-workflow-examples/serverless-workflow-functions-quarkus/src/main/java/org/acme/numbers/NumbersResource.java @@ -4593,84 +4593,84 @@ index cda3b7296..011e97147 100644 + 3.0.0.Final 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/ClassificationFunction.java b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/ClassificationFunction.java index 6f90bae6d..56b1e20e5 100644 --- a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/ClassificationFunction.java +++ b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/ClassificationFunction.java @@ -15,7 +15,7 @@ */ - package org.kogito.serverless.examples.functions; + package org.acme.serverless.examples.functions; -import javax.inject.Inject; +import jakarta.inject.Inject; - import org.kogito.serverless.examples.input.Country; - import org.kogito.serverless.examples.services.ClassificationService; + import org.acme.serverless.examples.input.Country; + import org.acme.serverless.examples.services.ClassificationService; diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/CountriesFunction.java b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/CountriesFunction.java index 750823546..f17e7bea9 100644 --- a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/CountriesFunction.java +++ b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/CountriesFunction.java @@ -15,7 +15,7 @@ */ - package org.kogito.serverless.examples.functions; + package org.acme.serverless.examples.functions; -import javax.inject.Inject; +import jakarta.inject.Inject; - import org.kogito.serverless.examples.input.Country; - import org.kogito.serverless.examples.services.CountriesService; + import org.acme.serverless.examples.input.Country; + import org.acme.serverless.examples.services.CountriesService; diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/PopulationFunction.java b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/PopulationFunction.java index 69066c4ec..8249c76b2 100644 --- a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/PopulationFunction.java +++ b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/functions/PopulationFunction.java @@ -15,7 +15,7 @@ */ - package org.kogito.serverless.examples.functions; + package org.acme.serverless.examples.functions; -import javax.inject.Inject; +import jakarta.inject.Inject; - import org.kogito.serverless.examples.input.Country; - import org.kogito.serverless.examples.services.CountriesService; + import org.acme.serverless.examples.input.Country; + import org.acme.serverless.examples.services.CountriesService; diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/ClassificationService.java b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/ClassificationService.java index 3731e3707..1f9bd1377 100644 --- a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/ClassificationService.java +++ b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/ClassificationService.java -@@ -18,7 +18,7 @@ package org.kogito.serverless.examples.services; +@@ -18,7 +18,7 @@ package org.acme.serverless.examples.services; import java.util.HashMap; import java.util.Map; -import javax.enterprise.context.ApplicationScoped; +import jakarta.enterprise.context.ApplicationScoped; - import org.kogito.serverless.examples.input.Country; + import org.acme.serverless.examples.input.Country; diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/CountriesService.java b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/CountriesService.java index acce33496..a6ffe63d9 100644 --- a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/CountriesService.java +++ b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/CountriesService.java -@@ -18,7 +18,7 @@ package org.kogito.serverless.examples.services; +@@ -18,7 +18,7 @@ package org.acme.serverless.examples.services; import java.util.ArrayList; import java.util.List; -import javax.enterprise.context.ApplicationScoped; +import jakarta.enterprise.context.ApplicationScoped; - import org.kogito.serverless.examples.input.Country; + import org.acme.serverless.examples.input.Country; diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/PopulationService.java b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/PopulationService.java index 8aa404d54..60910c580 100644 --- a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/PopulationService.java +++ b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-services/src/main/java/org/kogito/serverless/examples/services/PopulationService.java -@@ -18,7 +18,7 @@ package org.kogito.serverless.examples.services; +@@ -18,7 +18,7 @@ package org.acme.serverless.examples.services; import java.util.HashMap; import java.util.Map; -import javax.enterprise.context.ApplicationScoped; +import jakarta.enterprise.context.ApplicationScoped; - import org.kogito.serverless.examples.input.Country; + import org.acme.serverless.examples.input.Country; diff --git a/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-workflow/pom.xml b/serverless-workflow-examples/serverless-workflow-funqy/sw-funqy-workflow/pom.xml index f651b169d..f72762b0b 100644 @@ -4692,7 +4692,7 @@ index f651b169d..f72762b0b 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-greeting-quarkus/pom.xml b/serverless-workflow-examples/serverless-workflow-greeting-quarkus/pom.xml index 7ac2e39db..738e86c3f 100644 --- a/serverless-workflow-examples/serverless-workflow-greeting-quarkus/pom.xml @@ -4713,7 +4713,7 @@ index 7ac2e39db..738e86c3f 100644 + 3.0.0-SNAPSHOT 11 3.8.1 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-client-rpc-quarkus/pom.xml b/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-client-rpc-quarkus/pom.xml index 8c6563339..707894ba9 100644 --- a/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-client-rpc-quarkus/pom.xml @@ -4734,14 +4734,14 @@ index 8c6563339..707894ba9 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-server-rpc-quarkus/pom.xml b/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-server-rpc-quarkus/pom.xml index c2ca6f930..d004b2cc1 100644 --- a/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-server-rpc-quarkus/pom.xml +++ b/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-server-rpc-quarkus/pom.xml @@ -16,7 +16,7 @@ 11 - 3.0.0-M7 + 3.1.2 3.22.0 - 1.51.1 + 1.54.0 @@ -4779,7 +4779,7 @@ index 12e44987a..a2eeb214a 100644 + 3.0.0-SNAPSHOT 11 3.8.1 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/CloudEventDataFormat.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/CloudEventDataFormat.java index 4a5671fe4..d3039a141 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/CloudEventDataFormat.java @@ -5076,7 +5076,7 @@ index efd654500..368067c17 100644 - 2.14.0 + 3.0.0-M1 - 3.0.0-M7 + 3.1.2 3.8.1 diff --git a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/pom.xml b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/pom.xml index 2e08e9a86..d9f50f983 100644 @@ -5096,7 +5096,7 @@ index 2e08e9a86..d9f50f983 100644 kogito-bom - 2.0.0-SNAPSHOT + 3.0.0-SNAPSHOT - 3.0.0-M7 + 3.1.2 5.1.3 3.6.0 diff --git a/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/main/java/org/kie/kogito/examples/VertxRouter.java b/serverless-workflow-examples/serverless-workflow-newsletter-subscription/subscription-flow/src/main/java/org/kie/kogito/examples/VertxRouter.java @@ -5245,7 +5245,7 @@ index cdda9bb4f..dd69b0cc3 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/src/main/java/org/acme/AcmeFinancialApplication.java b/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/src/main/java/org/acme/AcmeFinancialApplication.java index af5d49198..c77a16ba7 100644 --- a/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/src/main/java/org/acme/AcmeFinancialApplication.java @@ -5317,7 +5317,7 @@ index e0132a7d4..b7f310a7f 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/currency-exchange-workflow/src/main/java/org/kie/kogito/examples/ExchangeWorkflowHelper.java b/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/currency-exchange-workflow/src/main/java/org/kie/kogito/examples/ExchangeWorkflowHelper.java index 335f6f86a..903e39aef 100644 --- a/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/currency-exchange-workflow/src/main/java/org/kie/kogito/examples/ExchangeWorkflowHelper.java @@ -5408,7 +5408,7 @@ index f8d635e57..16804f95a 100644 + 3.0.0-SNAPSHOT 11 3.8.1 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-python-quarkus/pom.xml b/serverless-workflow-examples/serverless-workflow-python-quarkus/pom.xml index 850e11d5b..162da1ab5 100644 --- a/serverless-workflow-examples/serverless-workflow-python-quarkus/pom.xml @@ -5746,7 +5746,7 @@ index d15fe8e64..8b3f1d9d3 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/main/java/org/kogito/serverless/examples/CountriesClassifierResource.java b/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/main/java/org/kogito/serverless/examples/CountriesClassifierResource.java index 3917c23b4..2d64f52f3 100644 --- a/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/main/java/org/kogito/serverless/examples/CountriesClassifierResource.java @@ -5772,7 +5772,7 @@ diff --git a/serverless-workflow-examples/serverless-workflow-service-calls-quar index f49df157e..b6a6a617a 100644 --- a/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/test/java/org/kogito/serverless/examples/CountryServiceWorkflowTest.java +++ b/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/src/test/java/org/kogito/serverless/examples/CountryServiceWorkflowTest.java -@@ -18,8 +18,8 @@ package org.kogito.serverless.examples; +@@ -18,8 +18,8 @@ package org.acme.serverless.examples; import java.util.HashMap; import java.util.Map; @@ -5820,7 +5820,7 @@ index 730e56f86..d7531a2f2 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-stock-profit/real-stock-service/src/main/java/org/acme/RealStockPriceResource.java b/serverless-workflow-examples/serverless-workflow-stock-profit/real-stock-service/src/main/java/org/acme/RealStockPriceResource.java index 219f20cd6..26b3a8c66 100644 --- a/serverless-workflow-examples/serverless-workflow-stock-profit/real-stock-service/src/main/java/org/acme/RealStockPriceResource.java @@ -5881,7 +5881,7 @@ index f3ee8d2f9..d1e45b1ff 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-function/pom.xml b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-function/pom.xml index a0a03fe0b..e7f5ac799 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-function/pom.xml @@ -5902,7 +5902,7 @@ index a0a03fe0b..e7f5ac799 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-spec/pom.xml b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-spec/pom.xml index 8db50c271..9e56146b4 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow-spec/pom.xml @@ -5923,7 +5923,7 @@ index 8db50c271..9e56146b4 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow/pom.xml b/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow/pom.xml index 29686f3ca..1a4352b34 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow/pom.xml @@ -5944,7 +5944,7 @@ index 29686f3ca..1a4352b34 100644 + 3.0.0-SNAPSHOT 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/pom.xml b/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/pom.xml index 5d9b652af..7f0331124 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/pom.xml @@ -5961,7 +5961,7 @@ index 5d9b652af..7f0331124 100644 + 3.0.0.Final 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/src/main/java/org/kie/kogito/examples/sw/temp/multiplication/OperationResource.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/src/main/java/org/kie/kogito/examples/sw/temp/multiplication/OperationResource.java index b88993082..2cd120fc4 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/src/main/java/org/kie/kogito/examples/sw/temp/multiplication/OperationResource.java @@ -6003,7 +6003,7 @@ index 50157e0d9..33bb58bbc 100644 + 3.0.0.Final 3.8.1 11 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/main/java/org/kie/kogito/examples/sw/temp/subtraction/OperationResource.java b/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/main/java/org/kie/kogito/examples/sw/temp/subtraction/OperationResource.java index fbddc22c5..671a17c91 100644 --- a/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/main/java/org/kie/kogito/examples/sw/temp/subtraction/OperationResource.java @@ -6049,7 +6049,7 @@ index 29a3d7a38..57f37d0a2 100644 + 3.0.0-SNAPSHOT 11 3.8.1 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/pom.xml b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/pom.xml index 9ecc52d5a..d8a9582be 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/pom.xml @@ -6066,7 +6066,7 @@ index 9ecc52d5a..d8a9582be 100644 + 3.0.0-SNAPSHOT 11 3.8.1 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/src/main/java/org/kie/kogito/examples/EventsProducerResource.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/src/main/java/org/kie/kogito/examples/EventsProducerResource.java index 85ecdad6e..8a3b7a2cf 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/src/main/java/org/kie/kogito/examples/EventsProducerResource.java @@ -6126,7 +6126,7 @@ index 1d26d223f..bb27a5aa8 100644 + 3.0.0-SNAPSHOT 11 3.8.1 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/main/java/org/kie/kogito/examples/EventsProducerResource.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/main/java/org/kie/kogito/examples/EventsProducerResource.java index 3be5d1511..546c55c33 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/src/main/java/org/kie/kogito/examples/EventsProducerResource.java @@ -6188,7 +6188,7 @@ index d4cc05f68..600c3e642 100644 + 3.0.0-SNAPSHOT 11 3.8.1 - 3.0.0-M7 + 3.1.2 diff --git a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/CallbackStateTimeoutsClient.java b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/CallbackStateTimeoutsClient.java index 9b5f2cf6f..5ed665c99 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/src/main/java/org/kie/kogito/examples/CallbackStateTimeoutsClient.java diff --git a/.ci/environments/quarkus-3/patches/0003_wiremock_update.patch b/.ci/environments/quarkus-3/patches/0003_wiremock_update.patch index b04922bfe7..2e20d9c064 100644 --- a/.ci/environments/quarkus-3/patches/0003_wiremock_update.patch +++ b/.ci/environments/quarkus-3/patches/0003_wiremock_update.patch @@ -4,7 +4,7 @@ index 130b10318..b4cb6502e 100644 +++ b/serverless-workflow-examples/serverless-workflow-stock-profit/pom.xml @@ -25,7 +25,7 @@ 11 - 3.0.0-M7 + 3.1.2 ${version.surefire.plugin} - 2.33.2 + 3.0.0-beta-8 diff --git a/.ci/environments/quarkus-lts/patches/0001_align-protobuf-and-grpc.patch b/.ci/environments/quarkus-lts/patches/0001_align-protobuf-and-grpc.patch index 88e78df996..d57c2e8422 100644 --- a/.ci/environments/quarkus-lts/patches/0001_align-protobuf-and-grpc.patch +++ b/.ci/environments/quarkus-lts/patches/0001_align-protobuf-and-grpc.patch @@ -5,7 +5,7 @@ index c2ca6f930..a50429305 100644 @@ -15,8 +15,9 @@ 3.8.1 11 - 3.0.0-M7 + 3.1.2 - 3.22.0 - 1.51.1 + diff --git a/kogito-quarkus-examples/decisiontable-quarkus-example/pom.xml b/kogito-quarkus-examples/decisiontable-quarkus-example/pom.xml index 92e8228743..1075f9f21d 100644 --- a/kogito-quarkus-examples/decisiontable-quarkus-example/pom.xml +++ b/kogito-quarkus-examples/decisiontable-quarkus-example/pom.xml @@ -1,14 +1,15 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + decisiontable-quarkus-example + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Decision Table - Quarkus + 2.16.10.Final quarkus-bom @@ -19,7 +20,19 @@ 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT 8.45.0-SNAPSHOT + 3.1.2 + ${version.surefire.plugin} + 3.8.1 + + 0 + + fast-jar + 11 + 11 + UTF-8 + UTF-8 + @@ -90,20 +103,49 @@ - ${project.artifactId} - ${quarkus.platform.group-id} - quarkus-maven-plugin - ${quarkus-plugin.version} - - - - build - - - + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + ${project.build.directory}/${project.build.finalName}-runner + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + + diff --git a/kogito-quarkus-examples/decisiontable-quarkus-example/src/main/java/org/kie/kogito/queries/Applicant.java b/kogito-quarkus-examples/decisiontable-quarkus-example/src/main/java/org/acme/queries/Applicant.java similarity index 97% rename from kogito-quarkus-examples/decisiontable-quarkus-example/src/main/java/org/kie/kogito/queries/Applicant.java rename to kogito-quarkus-examples/decisiontable-quarkus-example/src/main/java/org/acme/queries/Applicant.java index 175d3a98d5..c63d1274c8 100644 --- a/kogito-quarkus-examples/decisiontable-quarkus-example/src/main/java/org/kie/kogito/queries/Applicant.java +++ b/kogito-quarkus-examples/decisiontable-quarkus-example/src/main/java/org/acme/queries/Applicant.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.queries; +package org.acme.queries; public class Applicant { diff --git a/kogito-quarkus-examples/ruleunit-quarkus-example/src/main/java/org/kie/kogito/queries/LoanApplication.java b/kogito-quarkus-examples/decisiontable-quarkus-example/src/main/java/org/acme/queries/LoanApplication.java similarity index 98% rename from kogito-quarkus-examples/ruleunit-quarkus-example/src/main/java/org/kie/kogito/queries/LoanApplication.java rename to kogito-quarkus-examples/decisiontable-quarkus-example/src/main/java/org/acme/queries/LoanApplication.java index 70eec1c4e3..a6a205d958 100644 --- a/kogito-quarkus-examples/ruleunit-quarkus-example/src/main/java/org/kie/kogito/queries/LoanApplication.java +++ b/kogito-quarkus-examples/decisiontable-quarkus-example/src/main/java/org/acme/queries/LoanApplication.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.queries; +package org.acme.queries; public class LoanApplication { diff --git a/kogito-springboot-examples/ruleunit-springboot-example/src/main/java/org/kie/kogito/queries/LoanUnit.java b/kogito-quarkus-examples/decisiontable-quarkus-example/src/main/java/org/acme/queries/LoanUnit.java similarity index 97% rename from kogito-springboot-examples/ruleunit-springboot-example/src/main/java/org/kie/kogito/queries/LoanUnit.java rename to kogito-quarkus-examples/decisiontable-quarkus-example/src/main/java/org/acme/queries/LoanUnit.java index 3d35a77609..063377fe07 100644 --- a/kogito-springboot-examples/ruleunit-springboot-example/src/main/java/org/kie/kogito/queries/LoanUnit.java +++ b/kogito-quarkus-examples/decisiontable-quarkus-example/src/main/java/org/acme/queries/LoanUnit.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.queries; +package org.acme.queries; import org.drools.ruleunits.api.DataSource; import org.drools.ruleunits.api.DataStore; diff --git a/kogito-springboot-examples/decisiontable-springboot-example/src/main/resources/org/kie/kogito/queries/LoanUnit.drl.xls b/kogito-quarkus-examples/decisiontable-quarkus-example/src/main/resources/org/acme/queries/LoanUnit.drl.xls similarity index 57% rename from kogito-springboot-examples/decisiontable-springboot-example/src/main/resources/org/kie/kogito/queries/LoanUnit.drl.xls rename to kogito-quarkus-examples/decisiontable-quarkus-example/src/main/resources/org/acme/queries/LoanUnit.drl.xls index cfa4b8db5f..e51800ae98 100644 Binary files a/kogito-springboot-examples/decisiontable-springboot-example/src/main/resources/org/kie/kogito/queries/LoanUnit.drl.xls and b/kogito-quarkus-examples/decisiontable-quarkus-example/src/main/resources/org/acme/queries/LoanUnit.drl.xls differ diff --git a/kogito-quarkus-examples/decisiontable-quarkus-example/src/test/java/org/kie/kogito/decisiontable/quarkus/NativeRestQueryIT.java b/kogito-quarkus-examples/decisiontable-quarkus-example/src/test/java/org/acme/decisiontable/quarkus/NativeRestQueryIT.java similarity index 94% rename from kogito-quarkus-examples/decisiontable-quarkus-example/src/test/java/org/kie/kogito/decisiontable/quarkus/NativeRestQueryIT.java rename to kogito-quarkus-examples/decisiontable-quarkus-example/src/test/java/org/acme/decisiontable/quarkus/NativeRestQueryIT.java index eb6ce553f6..a87bcd6bab 100644 --- a/kogito-quarkus-examples/decisiontable-quarkus-example/src/test/java/org/kie/kogito/decisiontable/quarkus/NativeRestQueryIT.java +++ b/kogito-quarkus-examples/decisiontable-quarkus-example/src/test/java/org/acme/decisiontable/quarkus/NativeRestQueryIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.decisiontable.quarkus; +package org.acme.decisiontable.quarkus; import io.quarkus.test.junit.NativeImageTest; diff --git a/kogito-quarkus-examples/decisiontable-quarkus-example/src/test/java/org/kie/kogito/decisiontable/quarkus/RestQueryTest.java b/kogito-quarkus-examples/decisiontable-quarkus-example/src/test/java/org/acme/decisiontable/quarkus/RestQueryTest.java similarity index 98% rename from kogito-quarkus-examples/decisiontable-quarkus-example/src/test/java/org/kie/kogito/decisiontable/quarkus/RestQueryTest.java rename to kogito-quarkus-examples/decisiontable-quarkus-example/src/test/java/org/acme/decisiontable/quarkus/RestQueryTest.java index 2b88b46469..aea194b909 100644 --- a/kogito-quarkus-examples/decisiontable-quarkus-example/src/test/java/org/kie/kogito/decisiontable/quarkus/RestQueryTest.java +++ b/kogito-quarkus-examples/decisiontable-quarkus-example/src/test/java/org/acme/decisiontable/quarkus/RestQueryTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.decisiontable.quarkus; +package org.acme.decisiontable.quarkus; import org.junit.jupiter.api.Test; diff --git a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/docker-compose.yml b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/docker-compose.yml index 9743cfbd89..6113a6b60e 100644 --- a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/docker-compose.yml +++ b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/docker-compose.yml @@ -1,8 +1,8 @@ -version: '2' +version: '2.0' services: hello: - image: org.kie.kogito.examples/dmn-drools-quarkus-metrics:1.0 + image: org.acme.examples/dmn-drools-quarkus-metrics:1.0 ports: - 8080:8080 diff --git a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/pom.xml b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/pom.xml index 5edc5ee797..76352af0e6 100755 --- a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/pom.xml +++ b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/pom.xml @@ -1,14 +1,15 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + dmn-drools-quarkus-metrics + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: DMN Metrics Quarkus + 2.16.10.Final quarkus-bom @@ -18,7 +19,21 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + 1.17.3 + 3.1.2 + ${version.surefire.plugin} + + 0 + + fast-jar + 3.1.0 + 3.1.0 + 11 + 11 + UTF-8 + UTF-8 + @@ -37,6 +52,7 @@ + org.kie.kogito @@ -83,6 +99,7 @@ org.kie.kogito kogito-test-utils + ${version.org.kie.kogito} test @@ -96,6 +113,7 @@ quarkus-smallrye-health + ${project.artifactId} @@ -122,6 +140,7 @@ maven-clean-plugin + ${version.clean.plugin} @@ -137,6 +156,7 @@ maven-resources-plugin + ${version.resources.plugin} copy-filtered-resources @@ -194,6 +214,46 @@ + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/kie/kogito/app/CustomDMNRuntimeEventListener.java b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/acme/app/CustomDMNRuntimeEventListener.java similarity index 95% rename from kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/kie/kogito/app/CustomDMNRuntimeEventListener.java rename to kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/acme/app/CustomDMNRuntimeEventListener.java index 7744eb66d2..776af4cc77 100644 --- a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/kie/kogito/app/CustomDMNRuntimeEventListener.java +++ b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/acme/app/CustomDMNRuntimeEventListener.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.app; +package org.acme.app; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; @@ -87,7 +87,7 @@ public void afterEvaluateAll(AfterEvaluateAllEvent event) { private void registerEvent(DMNEvent event) { logger.debug(event.getClass().getSimpleName()); - prometheusMeterRegistry.counter("org.kie.kogito.examples.customdmnruntimeeventlistener", "event", + prometheusMeterRegistry.counter("org.acme.examples.customdmnruntimeeventlistener", "event", event.getClass().getSimpleName().toLowerCase()).increment(); } diff --git a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/kie/kogito/app/RuleEventListenerConfig.java b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/acme/app/RuleEventListenerConfig.java similarity index 92% rename from kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/kie/kogito/app/RuleEventListenerConfig.java rename to kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/acme/app/RuleEventListenerConfig.java index de6b18ed73..746ae2cadf 100644 --- a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/kie/kogito/app/RuleEventListenerConfig.java +++ b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/acme/app/RuleEventListenerConfig.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.app; +package org.acme.app; import javax.enterprise.context.ApplicationScoped; import javax.inject.Inject; +import org.acme.examples.CustomRuleEventListener; import org.kie.kogito.drools.core.config.DefaultRuleEventListenerConfig; -import org.kie.kogito.examples.CustomRuleEventListener; import io.micrometer.prometheus.PrometheusMeterRegistry; diff --git a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/kie/kogito/examples/CustomRuleEventListener.java b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/acme/examples/CustomRuleEventListener.java similarity index 96% rename from kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/kie/kogito/examples/CustomRuleEventListener.java rename to kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/acme/examples/CustomRuleEventListener.java index 39eac40227..9d9e1062c1 100644 --- a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/kie/kogito/examples/CustomRuleEventListener.java +++ b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/acme/examples/CustomRuleEventListener.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; import org.drools.core.event.DefaultAgendaEventListener; import org.jboss.logging.Logger; @@ -101,7 +101,7 @@ public void afterRuleFlowGroupDeactivated(RuleFlowGroupDeactivatedEvent event) { private void registerEvent(KieRuntimeEvent event) { logger.debug(event.getClass().getSimpleName()); - prometheusMeterRegistry.counter("org.kie.kogito.examples.customruleeventlistener", "event", + prometheusMeterRegistry.counter("org.acme.examples.customruleeventlistener", "event", event.getClass().getSimpleName().toLowerCase()).increment(); } } diff --git a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/kie/kogito/examples/Hello.java b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/acme/examples/Hello.java similarity index 96% rename from kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/kie/kogito/examples/Hello.java rename to kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/acme/examples/Hello.java index 15e84e9e72..bd8ee03281 100644 --- a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/kie/kogito/examples/Hello.java +++ b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/java/org/acme/examples/Hello.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; import org.drools.ruleunits.api.DataSource; import org.drools.ruleunits.api.DataStore; diff --git a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/resources/application.properties b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/resources/application.properties index 05db035d52..3cf704bf53 100644 --- a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/resources/application.properties +++ b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/resources/application.properties @@ -3,7 +3,7 @@ # Container image quarkus.container-image.build=true -quarkus.container-image.group=org.kie.kogito.examples +quarkus.container-image.group=org.acme.examples quarkus.container-image.name=dmn-drools-quarkus-metrics quarkus.container-image.tag=1.0 kogito.grafana.disabled.operational.dashboards=Traffic Violation diff --git a/kogito-quarkus-examples/rules-quarkus-helloworld/src/main/resources/org/kie/kogito/examples/Hello.drl b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/resources/org/acme/examples/Hello.drl similarity index 95% rename from kogito-quarkus-examples/rules-quarkus-helloworld/src/main/resources/org/kie/kogito/examples/Hello.drl rename to kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/resources/org/acme/examples/Hello.drl index 7aaacc6c99..ecdea0651a 100644 --- a/kogito-quarkus-examples/rules-quarkus-helloworld/src/main/resources/org/kie/kogito/examples/Hello.drl +++ b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/resources/org/acme/examples/Hello.drl @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; unit Hello; rule helloWorld diff --git a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/resources/org/kie/kogito/examples/LoanEligibility.dmn b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/resources/org/acme/examples/LoanEligibility.dmn similarity index 100% rename from kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/resources/org/kie/kogito/examples/LoanEligibility.dmn rename to kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/resources/org/acme/examples/LoanEligibility.dmn diff --git a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/resources/org/kie/kogito/examples/Traffic Violation.dmn b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/resources/org/acme/examples/Traffic Violation.dmn similarity index 100% rename from kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/resources/org/kie/kogito/examples/Traffic Violation.dmn rename to kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/main/resources/org/acme/examples/Traffic Violation.dmn diff --git a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/kie/kogito/examples/quarkus/DashboardsListIT.java b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/acme/examples/quarkus/DashboardsListIT.java similarity index 96% rename from kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/kie/kogito/examples/quarkus/DashboardsListIT.java rename to kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/acme/examples/quarkus/DashboardsListIT.java index 5921f82a24..738e0dd67b 100644 --- a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/kie/kogito/examples/quarkus/DashboardsListIT.java +++ b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/acme/examples/quarkus/DashboardsListIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.quarkus; +package org.acme.examples.quarkus; import java.util.List; diff --git a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/kie/kogito/examples/quarkus/DroolsMetricsIT.java b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/acme/examples/quarkus/DroolsMetricsIT.java similarity index 84% rename from kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/kie/kogito/examples/quarkus/DroolsMetricsIT.java rename to kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/acme/examples/quarkus/DroolsMetricsIT.java index 0af3380e8a..14b880b22e 100644 --- a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/kie/kogito/examples/quarkus/DroolsMetricsIT.java +++ b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/acme/examples/quarkus/DroolsMetricsIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.quarkus; +package org.acme.examples.quarkus; import org.junit.jupiter.api.Test; @@ -53,21 +53,21 @@ public void testDrlMetrics() { .get("/q/metrics") .then() .statusCode(200) - .body(containsString("org_kie_kogito_examples_customruleeventlistener_total{event=\"afteractivationfiredeventimpl" + + .body(containsString("org_acme_examples_customruleeventlistener_total{event=\"afteractivationfiredeventimpl" + "\"} 1.0")); given() .when() .get("/q/metrics") .then() .statusCode(200) - .body(containsString("org_kie_kogito_examples_customruleeventlistener_total{event=\"beforeactivationfiredeventimpl" + + .body(containsString("org_acme_examples_customruleeventlistener_total{event=\"beforeactivationfiredeventimpl" + "\"} 1.0")); given() .when() .get("/q/metrics") .then() .statusCode(200) - .body(containsString("org_kie_kogito_examples_customruleeventlistener_total{event=\"activationcreatedeventimpl" + + .body(containsString("org_acme_examples_customruleeventlistener_total{event=\"activationcreatedeventimpl" + "\"} 1.0")); } } diff --git a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/kie/kogito/examples/quarkus/GrafanaDockerComposeIT.java b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/acme/examples/quarkus/GrafanaDockerComposeIT.java similarity index 99% rename from kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/kie/kogito/examples/quarkus/GrafanaDockerComposeIT.java rename to kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/acme/examples/quarkus/GrafanaDockerComposeIT.java index 635b0008e0..2c098cac4a 100644 --- a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/kie/kogito/examples/quarkus/GrafanaDockerComposeIT.java +++ b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/acme/examples/quarkus/GrafanaDockerComposeIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.quarkus; +package org.acme.examples.quarkus; import java.io.File; import java.net.URISyntaxException; diff --git a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/kie/kogito/examples/quarkus/LoanEligibilityIT.java b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/acme/examples/quarkus/LoanEligibilityIT.java similarity index 91% rename from kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/kie/kogito/examples/quarkus/LoanEligibilityIT.java rename to kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/acme/examples/quarkus/LoanEligibilityIT.java index a9d2fca221..7d46d5dc7f 100644 --- a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/kie/kogito/examples/quarkus/LoanEligibilityIT.java +++ b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/acme/examples/quarkus/LoanEligibilityIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.quarkus; +package org.acme.examples.quarkus; import org.junit.jupiter.api.Test; @@ -102,15 +102,15 @@ public void testEvaluateLoanEligibility() { String.format("api_http_response_code_total{artifactId=\"%s\",endpoint=\"LoanEligibility\",identifier=\"200\",version=\"%s\"} 2.0", PROJECT_ARTIFACT_ID, PROJECT_VERSION))) .body(containsString( String.format("api_execution_elapsed_seconds_count{artifactId=\"%s\",endpoint=\"LoanEligibility\",version=\"%s\"} 2.0", PROJECT_ARTIFACT_ID, PROJECT_VERSION))) - .body(containsString("org_kie_kogito_examples_customdmnruntimeeventlistener_total{event" + + .body(containsString("org_acme_examples_customdmnruntimeeventlistener_total{event" + "=\"beforeevaluatedecisiontableeventimpl\"}")) - .body(containsString("org_kie_kogito_examples_customdmnruntimeeventlistener_total{event" + + .body(containsString("org_acme_examples_customdmnruntimeeventlistener_total{event" + "=\"afterevaluatedecisiontableeventimpl\"}")) - .body(containsString("org_kie_kogito_examples_customdmnruntimeeventlistener_total{event" + + .body(containsString("org_acme_examples_customdmnruntimeeventlistener_total{event" + "=\"beforeevaluatealleventimpl\"}")) - .body(containsString("org_kie_kogito_examples_customdmnruntimeeventlistener_total{event" + + .body(containsString("org_acme_examples_customdmnruntimeeventlistener_total{event" + "=\"afterevaluatealleventimpl\"}")) - .body(containsString("org_kie_kogito_examples_customdmnruntimeeventlistener_total{event" + + .body(containsString("org_acme_examples_customdmnruntimeeventlistener_total{event" + "=\"afterevaluatedecisioneventimpl\"}")); } diff --git a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/kie/kogito/examples/quarkus/ProjectMetadataProvider.java b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/acme/examples/quarkus/ProjectMetadataProvider.java similarity index 97% rename from kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/kie/kogito/examples/quarkus/ProjectMetadataProvider.java rename to kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/acme/examples/quarkus/ProjectMetadataProvider.java index 8218ebe9e4..be03e09832 100644 --- a/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/kie/kogito/examples/quarkus/ProjectMetadataProvider.java +++ b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/src/test/java/org/acme/examples/quarkus/ProjectMetadataProvider.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.quarkus; +package org.acme.examples.quarkus; import java.io.IOException; import java.util.Properties; diff --git a/kogito-quarkus-examples/dmn-event-driven-quarkus/pom.xml b/kogito-quarkus-examples/dmn-event-driven-quarkus/pom.xml index f494fc03e0..b28095d7d7 100644 --- a/kogito-quarkus-examples/dmn-event-driven-quarkus/pom.xml +++ b/kogito-quarkus-examples/dmn-event-driven-quarkus/pom.xml @@ -4,13 +4,12 @@ 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - dmn-event-driven-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: DMN Event-Driven :: Quarkus + 2.16.10.Final quarkus-bom @@ -20,7 +19,19 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + 1.5.0 + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -39,6 +50,7 @@ + org.kie.kogito @@ -97,6 +109,7 @@ org.skyscreamer jsonassert + ${version.org.skyscreamer} test @@ -116,6 +129,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + ${project.build.directory}/${project.build.finalName}-runner + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/dmn-event-driven-quarkus/src/main/resources/application.properties b/kogito-quarkus-examples/dmn-event-driven-quarkus/src/main/resources/application.properties index 8873403099..9565ef47a4 100644 --- a/kogito-quarkus-examples/dmn-event-driven-quarkus/src/main/resources/application.properties +++ b/kogito-quarkus-examples/dmn-event-driven-quarkus/src/main/resources/application.properties @@ -1,13 +1,10 @@ # Packaging # quarkus.package.type=fast-jar - quarkus.swagger-ui.always-include=true - mp.messaging.incoming.kogito_incoming_stream.group.id=dmn-event-driven-example mp.messaging.incoming.kogito_incoming_stream.connector=smallrye-kafka mp.messaging.incoming.kogito_incoming_stream.topic=dmn-event-driven-requests mp.messaging.incoming.kogito_incoming_stream.value.deserializer=org.apache.kafka.common.serialization.StringDeserializer - mp.messaging.outgoing.kogito_outgoing_stream.group.id=dmn-event-driven-example mp.messaging.outgoing.kogito_outgoing_stream.connector=smallrye-kafka mp.messaging.outgoing.kogito_outgoing_stream.topic=dmn-event-driven-responses diff --git a/kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/java/org/kie/kogito/examples/DmnEventDrivenIT.java b/kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/java/org/acme/examples/DmnEventDrivenIT.java similarity index 99% rename from kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/java/org/kie/kogito/examples/DmnEventDrivenIT.java rename to kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/java/org/acme/examples/DmnEventDrivenIT.java index 0b244241da..7a3866b227 100644 --- a/kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/java/org/kie/kogito/examples/DmnEventDrivenIT.java +++ b/kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/java/org/acme/examples/DmnEventDrivenIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; import java.io.IOException; import java.net.URL; diff --git a/kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/java/org/kie/kogito/examples/NativeDmnEventDrivenIT.java b/kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/java/org/acme/examples/NativeDmnEventDrivenIT.java similarity index 96% rename from kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/java/org/kie/kogito/examples/NativeDmnEventDrivenIT.java rename to kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/java/org/acme/examples/NativeDmnEventDrivenIT.java index 663d5b38a9..8df5c79eb1 100644 --- a/kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/java/org/kie/kogito/examples/NativeDmnEventDrivenIT.java +++ b/kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/java/org/acme/examples/NativeDmnEventDrivenIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; import org.kie.kogito.testcontainers.quarkus.KafkaQuarkusTestResource; diff --git a/kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/resources/events/evaluate_all/full_result/all/input.json b/kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/resources/events/evaluate_all/full_result/all/input.json index 9094c1609a..7841fc0530 100644 --- a/kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/resources/events/evaluate_all/full_result/all/input.json +++ b/kogito-quarkus-examples/dmn-event-driven-quarkus/src/test/resources/events/evaluate_all/full_result/all/input.json @@ -1,21 +1,21 @@ { - "specversion" : "1.0", - "id" : "a89b61a2-5644-487a-8a86-144855c5dce8", - "source" : "SomeEventSource", - "type" : "DecisionRequest", - "subject" : "TheSubject", - "kogitodmnmodelname" : "Traffic Violation", - "kogitodmnmodelnamespace" : "https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF", + "specversion": "1.0", + "id": "a89b61a2-5644-487a-8a86-144855c5dce8", + "source": "SomeEventSource", + "type": "DecisionRequest", + "subject": "TheSubject", + "kogitodmnmodelname": "Traffic Violation", + "kogitodmnmodelnamespace": "https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF", "kogitodmnfullresult": true, - "data" : { - "Driver" : { - "Age" : 25, - "Points" : 13 + "data": { + "Driver": { + "Age": 25, + "Points": 13 }, - "Violation" : { - "Type" : "speed", - "Actual Speed" : 115, - "Speed Limit" : 100 + "Violation": { + "Type": "speed", + "Actual Speed": 115, + "Speed Limit": 100 } } } diff --git a/kogito-quarkus-examples/dmn-incubation-api-quarkus/pom.xml b/kogito-quarkus-examples/dmn-incubation-api-quarkus/pom.xml index c5abbd378e..fa174527fe 100644 --- a/kogito-quarkus-examples/dmn-incubation-api-quarkus/pom.xml +++ b/kogito-quarkus-examples/dmn-incubation-api-quarkus/pom.xml @@ -1,14 +1,15 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + dmn-incubation-api-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: DMN Incubation API With Quarkus + 2.16.10.Final quarkus-bom @@ -18,7 +19,14 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -37,6 +45,7 @@ + io.quarkus @@ -85,6 +94,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/dmn-knative-quickstart-quarkus/pom.xml b/kogito-quarkus-examples/dmn-knative-quickstart-quarkus/pom.xml index 52abe49c3e..74a087c56d 100644 --- a/kogito-quarkus-examples/dmn-knative-quickstart-quarkus/pom.xml +++ b/kogito-quarkus-examples/dmn-knative-quickstart-quarkus/pom.xml @@ -1,19 +1,17 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - dmn-knative-quickstart-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: DMN with Knative Eventing and Quarkus Kogito with DMN Knative Eventing - Quarkus - 2.33.2 2.16.10.Final quarkus-bom io.quarkus @@ -22,7 +20,19 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + 2.33.2 + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -89,6 +99,7 @@ org.kie.kogito kogito-test-utils + ${version.org.kie.kogito} test @@ -98,6 +109,7 @@ com.github.tomakehurst wiremock-jre8 + ${version.com.github.tomakehurst.wiremock} test @@ -117,7 +129,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/dmn-knative-quickstart-quarkus/src/test/java/org/kie/kogito/examples/CloudEventListenerTest.java b/kogito-quarkus-examples/dmn-knative-quickstart-quarkus/src/test/java/org/acme/examples/CloudEventListenerTest.java similarity index 99% rename from kogito-quarkus-examples/dmn-knative-quickstart-quarkus/src/test/java/org/kie/kogito/examples/CloudEventListenerTest.java rename to kogito-quarkus-examples/dmn-knative-quickstart-quarkus/src/test/java/org/acme/examples/CloudEventListenerTest.java index d4156050fe..ba55f5df6c 100644 --- a/kogito-quarkus-examples/dmn-knative-quickstart-quarkus/src/test/java/org/kie/kogito/examples/CloudEventListenerTest.java +++ b/kogito-quarkus-examples/dmn-knative-quickstart-quarkus/src/test/java/org/acme/examples/CloudEventListenerTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; import java.util.Map; diff --git a/kogito-quarkus-examples/dmn-knative-quickstart-quarkus/src/test/java/org/kie/kogito/examples/TopicsInformationTest.java b/kogito-quarkus-examples/dmn-knative-quickstart-quarkus/src/test/java/org/acme/examples/TopicsInformationTest.java similarity index 98% rename from kogito-quarkus-examples/dmn-knative-quickstart-quarkus/src/test/java/org/kie/kogito/examples/TopicsInformationTest.java rename to kogito-quarkus-examples/dmn-knative-quickstart-quarkus/src/test/java/org/acme/examples/TopicsInformationTest.java index f7ea93becb..8009b62fdb 100644 --- a/kogito-quarkus-examples/dmn-knative-quickstart-quarkus/src/test/java/org/kie/kogito/examples/TopicsInformationTest.java +++ b/kogito-quarkus-examples/dmn-knative-quickstart-quarkus/src/test/java/org/acme/examples/TopicsInformationTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; import java.util.Arrays; import java.util.Collections; diff --git a/kogito-quarkus-examples/dmn-listener-dtable/README.md b/kogito-quarkus-examples/dmn-listener-dtable/README.md index 0178849ac0..e30dc0af25 100644 --- a/kogito-quarkus-examples/dmn-listener-dtable/README.md +++ b/kogito-quarkus-examples/dmn-listener-dtable/README.md @@ -1,3 +1,4 @@ # Decision Table Listener, with Kogito and Quarkus -An extension of the example `dmn-quarkus-listener`, focusing on semantic asynchronous evaluation of `AfterEvaluateDecisionTableEvent`(s) using Quarkus capabilities. +An extension of the example `dmn-quarkus-listener`, focusing on semantic asynchronous evaluation +of `AfterEvaluateDecisionTableEvent`(s) using Quarkus capabilities. diff --git a/kogito-quarkus-examples/dmn-listener-dtable/pom.xml b/kogito-quarkus-examples/dmn-listener-dtable/pom.xml index 8b3abdb384..b60a5bca58 100644 --- a/kogito-quarkus-examples/dmn-listener-dtable/pom.xml +++ b/kogito-quarkus-examples/dmn-listener-dtable/pom.xml @@ -1,14 +1,15 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + dmn-listener-dtable + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: DMN Decision Table listener - Quarkus + 2.16.10.Final quarkus-bom @@ -18,7 +19,19 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + 3.22.0 + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -37,6 +50,7 @@ + org.kie.kogito @@ -75,6 +89,7 @@ org.assertj assertj-core + ${version.org.assertj} test @@ -102,6 +117,47 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/dmn-listener-dtable/src/main/java/org/kie/kogito/dmn/quarkus/example/dtlistener/ExampleDMNRuntimeEventListener.java b/kogito-quarkus-examples/dmn-listener-dtable/src/main/java/org/acme/dmn/quarkus/example/dtlistener/ExampleDMNRuntimeEventListener.java similarity index 96% rename from kogito-quarkus-examples/dmn-listener-dtable/src/main/java/org/kie/kogito/dmn/quarkus/example/dtlistener/ExampleDMNRuntimeEventListener.java rename to kogito-quarkus-examples/dmn-listener-dtable/src/main/java/org/acme/dmn/quarkus/example/dtlistener/ExampleDMNRuntimeEventListener.java index 5c9c238d31..b9b23e7584 100644 --- a/kogito-quarkus-examples/dmn-listener-dtable/src/main/java/org/kie/kogito/dmn/quarkus/example/dtlistener/ExampleDMNRuntimeEventListener.java +++ b/kogito-quarkus-examples/dmn-listener-dtable/src/main/java/org/acme/dmn/quarkus/example/dtlistener/ExampleDMNRuntimeEventListener.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.quarkus.example.dtlistener; +package org.acme.dmn.quarkus.example.dtlistener; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; diff --git a/kogito-quarkus-examples/dmn-listener-dtable/src/main/java/org/kie/kogito/dmn/quarkus/example/dtlistener/PeriodicJobBean.java b/kogito-quarkus-examples/dmn-listener-dtable/src/main/java/org/acme/dmn/quarkus/example/dtlistener/PeriodicJobBean.java similarity index 98% rename from kogito-quarkus-examples/dmn-listener-dtable/src/main/java/org/kie/kogito/dmn/quarkus/example/dtlistener/PeriodicJobBean.java rename to kogito-quarkus-examples/dmn-listener-dtable/src/main/java/org/acme/dmn/quarkus/example/dtlistener/PeriodicJobBean.java index 2069192122..9e7d7fca7c 100644 --- a/kogito-quarkus-examples/dmn-listener-dtable/src/main/java/org/kie/kogito/dmn/quarkus/example/dtlistener/PeriodicJobBean.java +++ b/kogito-quarkus-examples/dmn-listener-dtable/src/main/java/org/acme/dmn/quarkus/example/dtlistener/PeriodicJobBean.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.quarkus.example.dtlistener; +package org.acme.dmn.quarkus.example.dtlistener; import java.util.concurrent.TimeUnit; diff --git a/kogito-quarkus-examples/dmn-listener-dtable/src/main/resources/application.properties b/kogito-quarkus-examples/dmn-listener-dtable/src/main/resources/application.properties index 35b7e32bea..30f8116375 100644 --- a/kogito-quarkus-examples/dmn-listener-dtable/src/main/resources/application.properties +++ b/kogito-quarkus-examples/dmn-listener-dtable/src/main/resources/application.properties @@ -1,4 +1,3 @@ # Packaging # quarkus.package.type=fast-jar - quarkus.swagger-ui.always-include=true \ No newline at end of file diff --git a/kogito-quarkus-examples/dmn-listener-dtable/src/test/java/org/kie/kogito/dmn/quarkus/example/dtlistener/DecisionTableTest.java b/kogito-quarkus-examples/dmn-listener-dtable/src/test/java/org/acme/dmn/quarkus/example/dtlistener/DecisionTableTest.java similarity index 97% rename from kogito-quarkus-examples/dmn-listener-dtable/src/test/java/org/kie/kogito/dmn/quarkus/example/dtlistener/DecisionTableTest.java rename to kogito-quarkus-examples/dmn-listener-dtable/src/test/java/org/acme/dmn/quarkus/example/dtlistener/DecisionTableTest.java index 58d847b1e7..6f0d2b9d96 100644 --- a/kogito-quarkus-examples/dmn-listener-dtable/src/test/java/org/kie/kogito/dmn/quarkus/example/dtlistener/DecisionTableTest.java +++ b/kogito-quarkus-examples/dmn-listener-dtable/src/test/java/org/acme/dmn/quarkus/example/dtlistener/DecisionTableTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.quarkus.example.dtlistener; +package org.acme.dmn.quarkus.example.dtlistener; import java.util.concurrent.TimeUnit; diff --git a/kogito-quarkus-examples/dmn-listener-quarkus/README.md b/kogito-quarkus-examples/dmn-listener-quarkus/README.md index 7b901b328a..457b6282a8 100644 --- a/kogito-quarkus-examples/dmn-listener-quarkus/README.md +++ b/kogito-quarkus-examples/dmn-listener-quarkus/README.md @@ -4,7 +4,8 @@ A simple DMN service to evaluate a traffic violation, with the addition of some DMN listeners. -Demonstrates Kogito capability to automatically inject custom listeners in the DMN runtime without the need of writing a single line of Java code for the wiring itself. +Demonstrates Kogito capability to automatically inject custom listeners in the DMN runtime without the need of writing a +single line of Java code for the wiring itself. Listener injection is _optional_. If you don't need it, just ignore it. @@ -13,14 +14,19 @@ Listener injection is _optional_. If you don't need it, just ignore it. ### Prerequisites You will need: - - Java 11+ installed - - Environment variable JAVA_HOME set accordingly - - Maven 3.8.6+ installed + +- Java 11+ installed +- Environment variable JAVA_HOME set accordingly +- Maven 3.8.6+ installed When using native image compilation, you will also need: - - [GraalVM 19.3.1](https://github.com/oracle/graal/releases/tag/vm-19.3.1) installed - - Environment variable GRAALVM_HOME set accordingly - - Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be installed too. You also need 'native-image' installed in GraalVM (using 'gu install native-image'). Please refer to [GraalVM installation documentation](https://www.graalvm.org/docs/reference-manual/aot-compilation/#prerequisites) for more details. + +- [GraalVM 19.3.1](https://github.com/oracle/graal/releases/tag/vm-19.3.1) installed +- Environment variable GRAALVM_HOME set accordingly +- Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be + installed too. You also need 'native-image' installed in GraalVM (using 'gu install native-image'). Please refer + to [GraalVM installation documentation](https://www.graalvm.org/docs/reference-manual/aot-compilation/#prerequisites) + for more details. ### Compile and Run in Local Dev Mode @@ -43,6 +49,7 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ``` @@ -58,21 +65,32 @@ To run the generated native executable, generated in `target/`, execute Note: This does not yet work on Windows, GraalVM and Quarkus should be rolling out support for Windows soon. ## OpenAPI (Swagger) documentation + [Specification at swagger.io](https://swagger.io/docs/specification/about/) -You can take a look at the [OpenAPI definition](http://localhost:8080/openapi?format=json) - automatically generated and included in this service - to determine all available operations exposed by this service. For easy readability you can visualize the OpenAPI definition file using a UI tool like for example available [Swagger UI](https://editor.swagger.io). +You can take a look at the [OpenAPI definition](http://localhost:8080/openapi?format=json) - automatically generated and +included in this service - to determine all available operations exposed by this service. For easy readability you can +visualize the OpenAPI definition file using a UI tool like for example +available [Swagger UI](https://editor.swagger.io). In addition, various clients to interact with this service can be easily generated using this OpenAPI definition. -When running in either Quarkus Development or Native mode, we also leverage the [Quarkus OpenAPI extension](https://quarkus.io/guides/openapi-swaggerui#use-swagger-ui-for-development) that exposes [Swagger UI](http://localhost:8080/swagger-ui/) that you can use to look at available REST endpoints and send test requests. +When running in either Quarkus Development or Native mode, we also leverage +the [Quarkus OpenAPI extension](https://quarkus.io/guides/openapi-swaggerui#use-swagger-ui-for-development) that +exposes [Swagger UI](http://localhost:8080/swagger-ui/) that you can use to look at available REST endpoints and send +test requests. ## Listener injection -Kogito allows you to inject custom instances of `DMNRuntimeEventListener` if you need to attach custom logic to every DMN model evaluation. +Kogito allows you to inject custom instances of `DMNRuntimeEventListener` if you need to attach custom logic to every +DMN model evaluation. There are two ways to do this: -* Create one or more standard listener classes and annotate them with `ApplicationScoped` (the quickest way to inject a single listener). Demonstrated in `ExampleDMNRuntimeEventListener` class. -* Create one or more instances of `DecisionEventListenerConfig` (returning a list of listeners each) and annotate them with `ApplicationScoped`. Demonstrated in `ExampleDecisionEventListenerConfig` class. + +* Create one or more standard listener classes and annotate them with `ApplicationScoped` (the quickest way to inject a + single listener). Demonstrated in `ExampleDMNRuntimeEventListener` class. +* Create one or more instances of `DecisionEventListenerConfig` (returning a list of listeners each) and annotate them + with `ApplicationScoped`. Demonstrated in `ExampleDecisionEventListenerConfig` class. All the listeners instantiated with both methods will be injected during the application startup phase. @@ -102,6 +120,7 @@ Curl command (using the JSON object above): ```sh curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"Driver":{"Points":2},"Violation":{"Type":"speed","Actual Speed":120,"Speed Limit":100}}' http://localhost:8080/Traffic%20Violation ``` + or on Windows: ```sh @@ -132,4 +151,5 @@ Example response: ## Deploying with Kogito Operator -In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). +In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with +the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). diff --git a/kogito-quarkus-examples/dmn-listener-quarkus/pom.xml b/kogito-quarkus-examples/dmn-listener-quarkus/pom.xml index df719ac5b3..cf84772328 100644 --- a/kogito-quarkus-examples/dmn-listener-quarkus/pom.xml +++ b/kogito-quarkus-examples/dmn-listener-quarkus/pom.xml @@ -1,14 +1,15 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + dmn-listener-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: DMN with listeners - Quarkus + 2.16.10.Final quarkus-bom @@ -18,7 +19,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -37,6 +49,7 @@ + org.kie.kogito @@ -88,6 +101,49 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + ${project.build.directory}/${project.build.finalName}-runner + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/kie/kogito/dmn/quarkus/example/listener/ExampleDMNRuntimeEventListener.java b/kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/acme/dmn/quarkus/example/listener/ExampleDMNRuntimeEventListener.java similarity index 96% rename from kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/kie/kogito/dmn/quarkus/example/listener/ExampleDMNRuntimeEventListener.java rename to kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/acme/dmn/quarkus/example/listener/ExampleDMNRuntimeEventListener.java index 5be5815cd1..25cef7025e 100644 --- a/kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/kie/kogito/dmn/quarkus/example/listener/ExampleDMNRuntimeEventListener.java +++ b/kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/acme/dmn/quarkus/example/listener/ExampleDMNRuntimeEventListener.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.quarkus.example.listener; +package org.acme.dmn.quarkus.example.listener; import javax.enterprise.context.ApplicationScoped; diff --git a/kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/kie/kogito/dmn/quarkus/example/listener/ExampleDecisionEventListenerConfig.java b/kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/acme/dmn/quarkus/example/listener/ExampleDecisionEventListenerConfig.java similarity index 97% rename from kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/kie/kogito/dmn/quarkus/example/listener/ExampleDecisionEventListenerConfig.java rename to kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/acme/dmn/quarkus/example/listener/ExampleDecisionEventListenerConfig.java index 02e7e6b876..4b35f29be0 100644 --- a/kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/kie/kogito/dmn/quarkus/example/listener/ExampleDecisionEventListenerConfig.java +++ b/kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/acme/dmn/quarkus/example/listener/ExampleDecisionEventListenerConfig.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.quarkus.example.listener; +package org.acme.dmn.quarkus.example.listener; import javax.enterprise.context.ApplicationScoped; diff --git a/kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/kie/kogito/dmn/quarkus/example/listener/LoggingDMNRuntimeEventListener.java b/kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/acme/dmn/quarkus/example/listener/LoggingDMNRuntimeEventListener.java similarity index 98% rename from kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/kie/kogito/dmn/quarkus/example/listener/LoggingDMNRuntimeEventListener.java rename to kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/acme/dmn/quarkus/example/listener/LoggingDMNRuntimeEventListener.java index f2dc00d429..50b039ea13 100644 --- a/kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/kie/kogito/dmn/quarkus/example/listener/LoggingDMNRuntimeEventListener.java +++ b/kogito-quarkus-examples/dmn-listener-quarkus/src/main/java/org/acme/dmn/quarkus/example/listener/LoggingDMNRuntimeEventListener.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.quarkus.example.listener; +package org.acme.dmn.quarkus.example.listener; import org.kie.dmn.api.core.event.AfterEvaluateAllEvent; import org.kie.dmn.api.core.event.AfterEvaluateContextEntryEvent; diff --git a/kogito-quarkus-examples/dmn-listener-quarkus/src/main/resources/application.properties b/kogito-quarkus-examples/dmn-listener-quarkus/src/main/resources/application.properties index 35b7e32bea..30f8116375 100644 --- a/kogito-quarkus-examples/dmn-listener-quarkus/src/main/resources/application.properties +++ b/kogito-quarkus-examples/dmn-listener-quarkus/src/main/resources/application.properties @@ -1,4 +1,3 @@ # Packaging # quarkus.package.type=fast-jar - quarkus.swagger-ui.always-include=true \ No newline at end of file diff --git a/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/example/listener/NativeTrafficViolationIT.java b/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/acme/dmn/quarkus/example/listener/NativeTrafficViolationIT.java similarity index 93% rename from kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/example/listener/NativeTrafficViolationIT.java rename to kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/acme/dmn/quarkus/example/listener/NativeTrafficViolationIT.java index a4223fe04b..595f171177 100644 --- a/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/example/listener/NativeTrafficViolationIT.java +++ b/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/acme/dmn/quarkus/example/listener/NativeTrafficViolationIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.quarkus.example.listener; +package org.acme.dmn.quarkus.example.listener; import io.quarkus.test.junit.NativeImageTest; diff --git a/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/example/listener/TrafficViolationListenerTest.java b/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/acme/dmn/quarkus/example/listener/TrafficViolationListenerTest.java similarity index 91% rename from kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/example/listener/TrafficViolationListenerTest.java rename to kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/acme/dmn/quarkus/example/listener/TrafficViolationListenerTest.java index 207d9e43e7..33775607be 100644 --- a/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/example/listener/TrafficViolationListenerTest.java +++ b/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/acme/dmn/quarkus/example/listener/TrafficViolationListenerTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.quarkus.example.listener; +package org.acme.dmn.quarkus.example.listener; import java.util.List; import java.util.Map; @@ -21,19 +21,19 @@ import javax.inject.Inject; +import org.acme.dmn.quarkus.example.mock.MockDMNRuntimeEventListener; import org.junit.jupiter.api.Test; import org.kie.dmn.api.core.event.DMNRuntimeEventListener; import org.kie.kogito.decision.DecisionConfig; import org.kie.kogito.decision.DecisionEventListenerConfig; -import org.kie.kogito.dmn.quarkus.example.mock.MockDMNRuntimeEventListener; import io.quarkus.test.junit.QuarkusTest; import io.restassured.http.ContentType; import static io.restassured.RestAssured.given; +import static org.acme.dmn.quarkus.example.listener.TrafficViolationTest.TRAFFIC_VIOLATION_TEST_BODY; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.kie.kogito.dmn.quarkus.example.listener.TrafficViolationTest.TRAFFIC_VIOLATION_TEST_BODY; @QuarkusTest public class TrafficViolationListenerTest { diff --git a/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/example/listener/TrafficViolationTest.java b/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/acme/dmn/quarkus/example/listener/TrafficViolationTest.java similarity index 96% rename from kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/example/listener/TrafficViolationTest.java rename to kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/acme/dmn/quarkus/example/listener/TrafficViolationTest.java index fa3361ef6a..43faf86bd0 100644 --- a/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/example/listener/TrafficViolationTest.java +++ b/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/acme/dmn/quarkus/example/listener/TrafficViolationTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.quarkus.example.listener; +package org.acme.dmn.quarkus.example.listener; import org.junit.jupiter.api.Test; diff --git a/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/example/mock/MockDMNRuntimeEventListener.java b/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/acme/dmn/quarkus/example/mock/MockDMNRuntimeEventListener.java similarity index 97% rename from kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/example/mock/MockDMNRuntimeEventListener.java rename to kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/acme/dmn/quarkus/example/mock/MockDMNRuntimeEventListener.java index 427bad341c..c65ae7b222 100644 --- a/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/example/mock/MockDMNRuntimeEventListener.java +++ b/kogito-quarkus-examples/dmn-listener-quarkus/src/test/java/org/acme/dmn/quarkus/example/mock/MockDMNRuntimeEventListener.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.quarkus.example.mock; +package org.acme.dmn.quarkus.example.mock; import java.util.HashMap; import java.util.Map; diff --git a/kogito-quarkus-examples/dmn-pmml-quarkus-example/pom.xml b/kogito-quarkus-examples/dmn-pmml-quarkus-example/pom.xml index 2b502a0451..40a765570d 100644 --- a/kogito-quarkus-examples/dmn-pmml-quarkus-example/pom.xml +++ b/kogito-quarkus-examples/dmn-pmml-quarkus-example/pom.xml @@ -1,13 +1,13 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + dmn-pmml-quarkus-example + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: DMN :: PMML - QUARKUS 2.16.10.Final @@ -18,6 +18,16 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 @@ -114,6 +124,49 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + ${project.build.directory}/${project.build.finalName}-runner + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/CommonTestUtils.java b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/CommonTestUtils.java similarity index 98% rename from kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/CommonTestUtils.java rename to kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/CommonTestUtils.java index aa0a543fe3..e033c3d1e7 100644 --- a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/CommonTestUtils.java +++ b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/CommonTestUtils.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.pmml.quarkus.example; +package org.acme.dmn.pmml.quarkus.example; import java.util.Map; diff --git a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/DMNMiningModelTest.java b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/DMNMiningModelTest.java similarity index 97% rename from kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/DMNMiningModelTest.java rename to kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/DMNMiningModelTest.java index 6c3f656ff4..f3d2137a53 100644 --- a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/DMNMiningModelTest.java +++ b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/DMNMiningModelTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.pmml.quarkus.example; +package org.acme.dmn.pmml.quarkus.example; import org.junit.jupiter.api.Test; diff --git a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/DMNRegressionTest.java b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/DMNRegressionTest.java similarity index 97% rename from kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/DMNRegressionTest.java rename to kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/DMNRegressionTest.java index aa5630f267..d93c85e799 100644 --- a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/DMNRegressionTest.java +++ b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/DMNRegressionTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.pmml.quarkus.example; +package org.acme.dmn.pmml.quarkus.example; import org.junit.jupiter.api.Test; diff --git a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/DMNScoreCardTest.java b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/DMNScoreCardTest.java similarity index 97% rename from kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/DMNScoreCardTest.java rename to kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/DMNScoreCardTest.java index 1cc71bfd06..862fb75366 100644 --- a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/DMNScoreCardTest.java +++ b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/DMNScoreCardTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.pmml.quarkus.example; +package org.acme.dmn.pmml.quarkus.example; import org.junit.jupiter.api.Test; diff --git a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/DMNTreeTest.java b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/DMNTreeTest.java similarity index 97% rename from kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/DMNTreeTest.java rename to kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/DMNTreeTest.java index 45d3761a0a..bca32d9b60 100644 --- a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/DMNTreeTest.java +++ b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/DMNTreeTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.pmml.quarkus.example; +package org.acme.dmn.pmml.quarkus.example; import org.junit.jupiter.api.Test; diff --git a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/DecisionTreeTest.java b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/DecisionTreeTest.java similarity index 88% rename from kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/DecisionTreeTest.java rename to kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/DecisionTreeTest.java index 0482d2e654..509d485ecd 100644 --- a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/DecisionTreeTest.java +++ b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/DecisionTreeTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.pmml.quarkus.example; +package org.acme.dmn.pmml.quarkus.example; import java.util.HashMap; import java.util.Map; @@ -23,8 +23,8 @@ import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; -import static org.kie.kogito.dmn.pmml.quarkus.example.CommonTestUtils.testDescriptive; -import static org.kie.kogito.dmn.pmml.quarkus.example.CommonTestUtils.testResult; +import static org.acme.dmn.pmml.quarkus.example.CommonTestUtils.testDescriptive; +import static org.acme.dmn.pmml.quarkus.example.CommonTestUtils.testResult; @QuarkusTest class DecisionTreeTest { diff --git a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/LinRegTest.java b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/LinRegTest.java similarity index 87% rename from kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/LinRegTest.java rename to kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/LinRegTest.java index cae090da03..9add7b2676 100644 --- a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/LinRegTest.java +++ b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/LinRegTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.pmml.quarkus.example; +package org.acme.dmn.pmml.quarkus.example; import java.util.Collections; import java.util.Map; @@ -23,8 +23,8 @@ import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; -import static org.kie.kogito.dmn.pmml.quarkus.example.CommonTestUtils.testDescriptive; -import static org.kie.kogito.dmn.pmml.quarkus.example.CommonTestUtils.testResult; +import static org.acme.dmn.pmml.quarkus.example.CommonTestUtils.testDescriptive; +import static org.acme.dmn.pmml.quarkus.example.CommonTestUtils.testResult; @QuarkusTest public class LinRegTest { diff --git a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/MiningModelTest.java b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/MiningModelTest.java similarity index 87% rename from kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/MiningModelTest.java rename to kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/MiningModelTest.java index 0ae7f7a31f..1a90f016be 100644 --- a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/MiningModelTest.java +++ b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/MiningModelTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.pmml.quarkus.example; +package org.acme.dmn.pmml.quarkus.example; import java.util.Collections; import java.util.Map; @@ -23,8 +23,8 @@ import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; -import static org.kie.kogito.dmn.pmml.quarkus.example.CommonTestUtils.testDescriptive; -import static org.kie.kogito.dmn.pmml.quarkus.example.CommonTestUtils.testResult; +import static org.acme.dmn.pmml.quarkus.example.CommonTestUtils.testDescriptive; +import static org.acme.dmn.pmml.quarkus.example.CommonTestUtils.testResult; @QuarkusTest public class MiningModelTest { diff --git a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/NativeDMNRegressionIT.java b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/NativeDMNRegressionIT.java similarity index 94% rename from kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/NativeDMNRegressionIT.java rename to kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/NativeDMNRegressionIT.java index 1c752f6d62..ae9c8d5bb5 100644 --- a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/NativeDMNRegressionIT.java +++ b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/NativeDMNRegressionIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.pmml.quarkus.example; +package org.acme.dmn.pmml.quarkus.example; import io.quarkus.test.junit.NativeImageTest; diff --git a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/NativeDMNTreeIT.java b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/NativeDMNTreeIT.java similarity index 94% rename from kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/NativeDMNTreeIT.java rename to kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/NativeDMNTreeIT.java index 174768ce4c..2f725fb7e8 100644 --- a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/NativeDMNTreeIT.java +++ b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/NativeDMNTreeIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.pmml.quarkus.example; +package org.acme.dmn.pmml.quarkus.example; import io.quarkus.test.junit.NativeImageTest; diff --git a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/NativeDecisionTreeIT.java b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/NativeDecisionTreeIT.java similarity index 94% rename from kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/NativeDecisionTreeIT.java rename to kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/NativeDecisionTreeIT.java index c227f3ff26..9bfa69daf3 100644 --- a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/NativeDecisionTreeIT.java +++ b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/NativeDecisionTreeIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.pmml.quarkus.example; +package org.acme.dmn.pmml.quarkus.example; import io.quarkus.test.junit.NativeImageTest; diff --git a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/NativeLinRegIT.java b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/NativeLinRegIT.java similarity index 94% rename from kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/NativeLinRegIT.java rename to kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/NativeLinRegIT.java index 1718164ec6..fc2b31e770 100644 --- a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/NativeLinRegIT.java +++ b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/NativeLinRegIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.pmml.quarkus.example; +package org.acme.dmn.pmml.quarkus.example; import io.quarkus.test.junit.NativeImageTest; diff --git a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/ScoreCardTest.java b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/ScoreCardTest.java similarity index 88% rename from kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/ScoreCardTest.java rename to kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/ScoreCardTest.java index 6e0b31b918..fd83909e8a 100644 --- a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/ScoreCardTest.java +++ b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/acme/dmn/pmml/quarkus/example/ScoreCardTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.pmml.quarkus.example; +package org.acme.dmn.pmml.quarkus.example; import java.util.Collections; import java.util.Map; @@ -23,8 +23,8 @@ import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; -import static org.kie.kogito.dmn.pmml.quarkus.example.CommonTestUtils.testDescriptive; -import static org.kie.kogito.dmn.pmml.quarkus.example.CommonTestUtils.testResult; +import static org.acme.dmn.pmml.quarkus.example.CommonTestUtils.testDescriptive; +import static org.acme.dmn.pmml.quarkus.example.CommonTestUtils.testResult; @QuarkusTest public class ScoreCardTest { diff --git a/kogito-quarkus-examples/dmn-quarkus-example/README.md b/kogito-quarkus-examples/dmn-quarkus-example/README.md index ee5d4bdfb3..f2cb5a8c00 100644 --- a/kogito-quarkus-examples/dmn-quarkus-example/README.md +++ b/kogito-quarkus-examples/dmn-quarkus-example/README.md @@ -11,14 +11,19 @@ Demonstrates DMN on Kogito capabilities, including REST interface code generatio ### Prerequisites You will need: - - Java 11+ installed - - Environment variable JAVA_HOME set accordingly - - Maven 3.8.6+ installed + +- Java 11+ installed +- Environment variable JAVA_HOME set accordingly +- Maven 3.8.6+ installed When using native image compilation, you will also need: - - [GraalVM 19.3.1](https://github.com/oracle/graal/releases/tag/vm-19.3.1) installed - - Environment variable GRAALVM_HOME set accordingly - - Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be installed too. You also need 'native-image' installed in GraalVM (using 'gu install native-image'). Please refer to [GraalVM installation documentation](https://www.graalvm.org/docs/reference-manual/aot-compilation/#prerequisites) for more details. + +- [GraalVM 19.3.1](https://github.com/oracle/graal/releases/tag/vm-19.3.1) installed +- Environment variable GRAALVM_HOME set accordingly +- Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be + installed too. You also need 'native-image' installed in GraalVM (using 'gu install native-image'). Please refer + to [GraalVM installation documentation](https://www.graalvm.org/docs/reference-manual/aot-compilation/#prerequisites) + for more details. ### Compile and Run in Local Dev Mode @@ -41,6 +46,7 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ``` @@ -56,24 +62,34 @@ To run the generated native executable, generated in `target/`, execute Note: This does not yet work on Windows, GraalVM and Quarkus should be rolling out support for Windows soon. ## OpenAPI (Swagger) documentation + [Specification at swagger.io](https://swagger.io/docs/specification/about/) -You can take a look at the [OpenAPI definition](http://localhost:8080/openapi?format=json) - automatically generated and included in this service - to determine all available operations exposed by this service. For easy readability you can visualize the OpenAPI definition file using a UI tool like for example available [Swagger UI](https://editor.swagger.io). +You can take a look at the [OpenAPI definition](http://localhost:8080/openapi?format=json) - automatically generated and +included in this service - to determine all available operations exposed by this service. For easy readability you can +visualize the OpenAPI definition file using a UI tool like for example +available [Swagger UI](https://editor.swagger.io). In addition, various clients to interact with this service can be easily generated using this OpenAPI definition. -When running in either Quarkus Development or Native mode, we also leverage the [Quarkus OpenAPI extension](https://quarkus.io/guides/openapi-swaggerui#use-swagger-ui-for-development) that exposes [Swagger UI](http://localhost:8080/swagger-ui/) that you can use to look at available REST endpoints and send test requests. +When running in either Quarkus Development or Native mode, we also leverage +the [Quarkus OpenAPI extension](https://quarkus.io/guides/openapi-swaggerui#use-swagger-ui-for-development) that +exposes [Swagger UI](http://localhost:8080/swagger-ui/) that you can use to look at available REST endpoints and send +test requests. ## Test DMN Model using Maven -Validate the functionality of DMN models before deploying them into a production environment by defining test scenarios in Test Scenario Editor. +Validate the functionality of DMN models before deploying them into a production environment by defining test scenarios +in Test Scenario Editor. -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: +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 mvn clean test ``` -See results in surefire test report `target/surefire-reports` + +See results in surefire test report `target/surefire-reports` ## Example Usage @@ -87,12 +103,14 @@ Given inputs: ```json { - "Driver":{"Points":2}, - "Violation":{ - "Type":"speed", - "Actual Speed":120, - "Speed Limit":100 - } + "Driver": { + "Points": 2 + }, + "Violation": { + "Type": "speed", + "Actual Speed": 120, + "Speed Limit": 100 + } } ``` @@ -101,6 +119,7 @@ Curl command (using the JSON object above): ```sh curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"Driver":{"Points":2},"Violation":{"Type":"speed","Actual Speed":120,"Speed Limit":100}}' http://localhost:8080/Traffic%20Violation ``` + or on Windows: ```sh @@ -113,22 +132,23 @@ Example response: ```json { - "Violation":{ - "Type":"speed", - "Speed Limit":100, - "Actual Speed":120 + "Violation": { + "Type": "speed", + "Speed Limit": 100, + "Actual Speed": 120 }, - "Driver":{ - "Points":2 + "Driver": { + "Points": 2 }, - "Fine":{ - "Points":3, - "Amount":500 + "Fine": { + "Points": 3, + "Amount": 500 }, - "Should the driver be suspended?":"No" + "Should the driver be suspended?": "No" } ``` ## Deploying with Kogito Operator -In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). +In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with +the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). diff --git a/kogito-quarkus-examples/dmn-quarkus-example/pom.xml b/kogito-quarkus-examples/dmn-quarkus-example/pom.xml index 38ccc03702..0033b44c2f 100644 --- a/kogito-quarkus-examples/dmn-quarkus-example/pom.xml +++ b/kogito-quarkus-examples/dmn-quarkus-example/pom.xml @@ -1,13 +1,13 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + dmn-quarkus-example + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: DMN 2.16.10.Final @@ -18,7 +18,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -37,6 +48,7 @@ + org.kie.kogito @@ -93,6 +105,49 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + ${project.build.directory}/${project.build.finalName}-runner + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/dmn-quarkus-example/src/main/resources/application.properties b/kogito-quarkus-examples/dmn-quarkus-example/src/main/resources/application.properties index c94efbb4d2..432d9d39b2 100644 --- a/kogito-quarkus-examples/dmn-quarkus-example/src/main/resources/application.properties +++ b/kogito-quarkus-examples/dmn-quarkus-example/src/main/resources/application.properties @@ -1,3 +1,2 @@ # Packaging - quarkus.swagger-ui.always-include=true diff --git a/kogito-quarkus-examples/dmn-quarkus-example/src/test/java/org/kie/kogito/dmn/quarkus/example/NativeTrafficViolationIT.java b/kogito-quarkus-examples/dmn-quarkus-example/src/test/java/org/acme/dmn/quarkus/example/NativeTrafficViolationIT.java similarity index 94% rename from kogito-quarkus-examples/dmn-quarkus-example/src/test/java/org/kie/kogito/dmn/quarkus/example/NativeTrafficViolationIT.java rename to kogito-quarkus-examples/dmn-quarkus-example/src/test/java/org/acme/dmn/quarkus/example/NativeTrafficViolationIT.java index cbd459afc1..bc12ed7e95 100644 --- a/kogito-quarkus-examples/dmn-quarkus-example/src/test/java/org/kie/kogito/dmn/quarkus/example/NativeTrafficViolationIT.java +++ b/kogito-quarkus-examples/dmn-quarkus-example/src/test/java/org/acme/dmn/quarkus/example/NativeTrafficViolationIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.quarkus.example; +package org.acme.dmn.quarkus.example; import io.quarkus.test.junit.NativeImageTest; diff --git a/kogito-quarkus-examples/dmn-quarkus-example/src/test/java/org/kie/kogito/dmn/quarkus/example/TrafficViolationTest.java b/kogito-quarkus-examples/dmn-quarkus-example/src/test/java/org/acme/dmn/quarkus/example/TrafficViolationTest.java similarity index 97% rename from kogito-quarkus-examples/dmn-quarkus-example/src/test/java/org/kie/kogito/dmn/quarkus/example/TrafficViolationTest.java rename to kogito-quarkus-examples/dmn-quarkus-example/src/test/java/org/acme/dmn/quarkus/example/TrafficViolationTest.java index b72795ac34..39baf3b5db 100644 --- a/kogito-quarkus-examples/dmn-quarkus-example/src/test/java/org/kie/kogito/dmn/quarkus/example/TrafficViolationTest.java +++ b/kogito-quarkus-examples/dmn-quarkus-example/src/test/java/org/acme/dmn/quarkus/example/TrafficViolationTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.quarkus.example; +package org.acme.dmn.quarkus.example; import org.junit.jupiter.api.Test; diff --git a/kogito-quarkus-examples/dmn-tracing-quarkus/README.md b/kogito-quarkus-examples/dmn-tracing-quarkus/README.md index f401157604..6915e80356 100644 --- a/kogito-quarkus-examples/dmn-tracing-quarkus/README.md +++ b/kogito-quarkus-examples/dmn-tracing-quarkus/README.md @@ -2,27 +2,38 @@ ## Description -A simple DMN service to evaluate a loan approval and generate tracing events that might be consumed by the Trusty service. +A simple DMN service to evaluate a loan approval and generate tracing events that might be consumed by the Trusty +service. ## Installing and Running ### Prerequisites You will need: - - Java 11+ installed - - Environment variable JAVA_HOME set accordingly - - Maven 3.8.6+ installed + +- Java 11+ installed +- Environment variable JAVA_HOME set accordingly +- Maven 3.8.6+ installed When using native image compilation, you will also need: - - [GraalVM 19.3.1](https://github.com/oracle/graal/releases/tag/vm-19.3.1) installed - - Environment variable GRAALVM_HOME set accordingly - - Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be installed too. You also need 'native-image' installed in GraalVM (using 'gu install native-image'). Please refer to [GraalVM installation documentation](https://www.graalvm.org/docs/reference-manual/aot-compilation/#prerequisites) for more details. + +- [GraalVM 19.3.1](https://github.com/oracle/graal/releases/tag/vm-19.3.1) installed +- Environment variable GRAALVM_HOME set accordingly +- Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be + installed too. You also need 'native-image' installed in GraalVM (using 'gu install native-image'). Please refer + to [GraalVM installation documentation](https://www.graalvm.org/docs/reference-manual/aot-compilation/#prerequisites) + for more details. ### Configuration of the tracing addon -The default configuration pushes the decision tracing events to the kafka topic `kogito-tracing-decision` and the DMN models used by the kogito application to `kogito-tracing-model` under the group-id `kogito-runtimes`. -The configuration can be customized according to [https://quarkus.io/guides/kafka](https://quarkus.io/guides/kafka) and [https://kafka.apache.org/documentation/#producerconfigs](https://kafka.apache.org/documentation/#producerconfigs) using the prefix `mp.messaging.outgoing.kogito-tracing-decision.`. -For example, in order to change the topic name for the decision tracing events, add the following line to the `application.properties` file: +The default configuration pushes the decision tracing events to the kafka topic `kogito-tracing-decision` and the DMN +models used by the kogito application to `kogito-tracing-model` under the group-id `kogito-runtimes`. +The configuration can be customized according to [https://quarkus.io/guides/kafka](https://quarkus.io/guides/kafka) +and [https://kafka.apache.org/documentation/#producerconfigs](https://kafka.apache.org/documentation/#producerconfigs) +using the prefix `mp.messaging.outgoing.kogito-tracing-decision.`. +For example, in order to change the topic name for the decision tracing events, add the following line to +the `application.properties` file: + ``` mp.messaging.outgoing.kogito-tracing-decision.topic=my-kogito-tracing-decision ``` @@ -48,6 +59,7 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ``` @@ -63,13 +75,20 @@ To run the generated native executable, generated in `target/`, execute Note: This does not yet work on Windows, GraalVM and Quarkus should be rolling out support for Windows soon. ## OpenAPI (Swagger) documentation + [Specification at swagger.io](https://swagger.io/docs/specification/about/) -You can take a look at the [OpenAPI definition](http://localhost:8080/openapi?format=json) - automatically generated and included in this service - to determine all available operations exposed by this service. For easy readability you can visualize the OpenAPI definition file using a UI tool like for example available [Swagger UI](https://editor.swagger.io). +You can take a look at the [OpenAPI definition](http://localhost:8080/openapi?format=json) - automatically generated and +included in this service - to determine all available operations exposed by this service. For easy readability you can +visualize the OpenAPI definition file using a UI tool like for example +available [Swagger UI](https://editor.swagger.io). In addition, various clients to interact with this service can be easily generated using this OpenAPI definition. -When running in either Quarkus Development or Native mode, we also leverage the [Quarkus OpenAPI extension](https://quarkus.io/guides/openapi-swaggerui#use-swagger-ui-for-development) that exposes [Swagger UI](http://localhost:8080/swagger-ui/) that you can use to look at available REST endpoints and send test requests. +When running in either Quarkus Development or Native mode, we also leverage +the [Quarkus OpenAPI extension](https://quarkus.io/guides/openapi-swaggerui#use-swagger-ui-for-development) that +exposes [Swagger UI](http://localhost:8080/swagger-ui/) that you can use to look at available REST endpoints and send +test requests. ## Example Usage @@ -102,6 +121,7 @@ Curl command (using the JSON object above): ```sh curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"Bribe": 0,"Client": {"age": 0,"existing payments": 0,"salary": 0},"Loan": {"duration": 0,"installment": 0},"SupremeDirector": "yes"}' http://localhost:8080/LoanEligibility ``` + or on Windows: ```sh @@ -134,10 +154,15 @@ Example response: ## Integration example with Trusty Service -When the tracing addon is enabled, the tracing events are emitted and pushed to a Kafka broker. The [Trusty Service](https://github.com/kiegroup/kogito-apps/tree/main/trusty) can consume such events and store them on a storage. The Trusty Service exposes then some api to consume the information that has been collected. -A `docker-compose` example is provided in the current folder. In particular, when `docker-compose up` is run, a Kafka broker, an Infinispan container and the latest build of the trusty service configured to use Infinispan are deployed. -Once the services are up and running, after a decision has been evaluated, you can access the trusty service API to list the evaluations at `localhost:8081/executions` for example. +When the tracing addon is enabled, the tracing events are emitted and pushed to a Kafka broker. +The [Trusty Service](https://github.com/kiegroup/kogito-apps/tree/main/trusty) can consume such events and store them on +a storage. The Trusty Service exposes then some api to consume the information that has been collected. +A `docker-compose` example is provided in the current folder. In particular, when `docker-compose up` is run, a Kafka +broker, an Infinispan container and the latest build of the trusty service configured to use Infinispan are deployed. +Once the services are up and running, after a decision has been evaluated, you can access the trusty service API to list +the evaluations at `localhost:8081/executions` for example. ## Deploying with Kogito Operator -In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). +In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with +the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). diff --git a/kogito-quarkus-examples/dmn-tracing-quarkus/pom.xml b/kogito-quarkus-examples/dmn-tracing-quarkus/pom.xml index 07fc0c4cec..1cf36b9d4f 100644 --- a/kogito-quarkus-examples/dmn-tracing-quarkus/pom.xml +++ b/kogito-quarkus-examples/dmn-tracing-quarkus/pom.xml @@ -1,13 +1,13 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + dmn-tracing-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: DMN Tracing - Quarkus 2.16.10.Final @@ -18,7 +18,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -37,6 +48,7 @@ + org.kie.kogito @@ -107,6 +119,49 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + ${project.build.directory}/${project.build.finalName}-runner + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/dmn-tracing-quarkus/src/main/resources/application.properties b/kogito-quarkus-examples/dmn-tracing-quarkus/src/main/resources/application.properties index 35b7e32bea..30f8116375 100644 --- a/kogito-quarkus-examples/dmn-tracing-quarkus/src/main/resources/application.properties +++ b/kogito-quarkus-examples/dmn-tracing-quarkus/src/main/resources/application.properties @@ -1,4 +1,3 @@ # Packaging # quarkus.package.type=fast-jar - quarkus.swagger-ui.always-include=true \ No newline at end of file diff --git a/kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/tracing/LoanEligibilityIT.java b/kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/acme/dmn/quarkus/tracing/LoanEligibilityIT.java similarity index 95% rename from kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/tracing/LoanEligibilityIT.java rename to kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/acme/dmn/quarkus/tracing/LoanEligibilityIT.java index 22ade7e8f9..4b4ed75b4d 100644 --- a/kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/tracing/LoanEligibilityIT.java +++ b/kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/acme/dmn/quarkus/tracing/LoanEligibilityIT.java @@ -13,11 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.quarkus.tracing; +package org.acme.dmn.quarkus.tracing; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; +import org.acme.dmn.quarkus.tracing.matcher.StringMatchesUUIDPattern; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -38,7 +39,6 @@ import static org.hamcrest.Matchers.is; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.fail; -import static org.kie.kogito.dmn.quarkus.tracing.matcher.StringMatchesUUIDPattern.matchesThePatternOfAUUID; @QuarkusTest @QuarkusTestResource(KafkaQuarkusTestResource.class) @@ -100,7 +100,7 @@ public void testEvaluateLoanEligibility() throws InterruptedException { .post("/LoanEligibility") .then() .statusCode(200) - .header(KOGITO_EXECUTION_ID_HEADER, matchesThePatternOfAUUID()) + .header(KOGITO_EXECUTION_ID_HEADER, StringMatchesUUIDPattern.matchesThePatternOfAUUID()) .body("'Decide'", is(true)); countDownLatch.await(5, TimeUnit.SECONDS); diff --git a/kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/tracing/NativeLoanEligibilityIT.java b/kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/acme/dmn/quarkus/tracing/NativeLoanEligibilityIT.java similarity index 95% rename from kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/tracing/NativeLoanEligibilityIT.java rename to kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/acme/dmn/quarkus/tracing/NativeLoanEligibilityIT.java index 75cb111740..48b84a051d 100644 --- a/kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/tracing/NativeLoanEligibilityIT.java +++ b/kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/acme/dmn/quarkus/tracing/NativeLoanEligibilityIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.quarkus.tracing; +package org.acme.dmn.quarkus.tracing; import org.kie.kogito.testcontainers.quarkus.KafkaQuarkusTestResource; diff --git a/kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/tracing/matcher/StringMatchesUUIDPattern.java b/kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/acme/dmn/quarkus/tracing/matcher/StringMatchesUUIDPattern.java similarity index 96% rename from kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/tracing/matcher/StringMatchesUUIDPattern.java rename to kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/acme/dmn/quarkus/tracing/matcher/StringMatchesUUIDPattern.java index c1f9f3398e..19ef236de9 100644 --- a/kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/kie/kogito/dmn/quarkus/tracing/matcher/StringMatchesUUIDPattern.java +++ b/kogito-quarkus-examples/dmn-tracing-quarkus/src/test/java/org/acme/dmn/quarkus/tracing/matcher/StringMatchesUUIDPattern.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.quarkus.tracing.matcher; +package org.acme.dmn.quarkus.tracing.matcher; import org.hamcrest.Description; import org.hamcrest.Matcher; diff --git a/kogito-quarkus-examples/flexible-process-quarkus/pom.xml b/kogito-quarkus-examples/flexible-process-quarkus/pom.xml index f59b52e1f0..f85edbc57d 100644 --- a/kogito-quarkus-examples/flexible-process-quarkus/pom.xml +++ b/kogito-quarkus-examples/flexible-process-quarkus/pom.xml @@ -1,13 +1,13 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + flexible-process-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Flexible Process - Quarkus 2.16.10.Final @@ -18,7 +18,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -37,6 +48,7 @@ + org.kie.kogito @@ -87,6 +99,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/model/Comment.java b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/model/Comment.java similarity index 97% rename from kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/model/Comment.java rename to kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/model/Comment.java index c6e924361e..cfbae34857 100644 --- a/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/model/Comment.java +++ b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/model/Comment.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.flexible.example.model; +package org.acme.flexible.example.model; import java.time.ZonedDateTime; diff --git a/kogito-springboot-examples/flexible-process-springboot/src/main/java/org/kie/kogito/flexible/example/model/Product.java b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/model/Product.java similarity index 96% rename from kogito-springboot-examples/flexible-process-springboot/src/main/java/org/kie/kogito/flexible/example/model/Product.java rename to kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/model/Product.java index 9efe281bc8..a9a6e7f4e5 100644 --- a/kogito-springboot-examples/flexible-process-springboot/src/main/java/org/kie/kogito/flexible/example/model/Product.java +++ b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/model/Product.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.flexible.example.model; +package org.acme.flexible.example.model; public class Product { diff --git a/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/model/Questionnaire.java b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/model/Questionnaire.java similarity index 97% rename from kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/model/Questionnaire.java rename to kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/model/Questionnaire.java index 67d71a3b12..10d104120e 100644 --- a/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/model/Questionnaire.java +++ b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/model/Questionnaire.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.flexible.example.model; +package org.acme.flexible.example.model; import java.time.ZonedDateTime; diff --git a/kogito-springboot-examples/flexible-process-springboot/src/main/java/org/kie/kogito/flexible/example/model/State.java b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/model/State.java similarity index 93% rename from kogito-springboot-examples/flexible-process-springboot/src/main/java/org/kie/kogito/flexible/example/model/State.java rename to kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/model/State.java index 29b47e5ed5..f0d9c410fe 100644 --- a/kogito-springboot-examples/flexible-process-springboot/src/main/java/org/kie/kogito/flexible/example/model/State.java +++ b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/model/State.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.flexible.example.model; +package org.acme.flexible.example.model; public enum State { NEW, diff --git a/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/model/SupportCase.java b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/model/SupportCase.java similarity index 95% rename from kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/model/SupportCase.java rename to kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/model/SupportCase.java index 251a49e459..d42d930439 100644 --- a/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/model/SupportCase.java +++ b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/model/SupportCase.java @@ -13,21 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.flexible.example.model; +package org.acme.flexible.example.model; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -import static org.kie.kogito.flexible.example.model.State.NEW; - public class SupportCase { private Product product; private String description; private String engineer; private String customer; - private State state = NEW; + private State state = State.NEW; private List comments; private Questionnaire questionnaire; diff --git a/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/service/CommentService.java b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/service/CommentService.java similarity index 71% rename from kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/service/CommentService.java rename to kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/service/CommentService.java index 70061b61cb..b79dcb0c27 100644 --- a/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/service/CommentService.java +++ b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/service/CommentService.java @@ -13,26 +13,23 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.flexible.example.service; +package org.acme.flexible.example.service; import javax.enterprise.context.ApplicationScoped; -import org.kie.kogito.flexible.example.model.Comment; -import org.kie.kogito.flexible.example.model.State; -import org.kie.kogito.flexible.example.model.SupportCase; - -import static org.kie.kogito.flexible.example.model.State.WAITING_FOR_CUSTOMER; -import static org.kie.kogito.flexible.example.model.State.WAITING_FOR_OWNER; +import org.acme.flexible.example.model.Comment; +import org.acme.flexible.example.model.State; +import org.acme.flexible.example.model.SupportCase; @ApplicationScoped public class CommentService { public SupportCase addCustomerComment(SupportCase supportCase, String comment, String author) { - return addComment(supportCase, author, comment, WAITING_FOR_OWNER); + return addComment(supportCase, author, comment, State.WAITING_FOR_OWNER); } public SupportCase addSupportComment(SupportCase supportCase, String comment, String author) { - return addComment(supportCase, author, comment, WAITING_FOR_CUSTOMER); + return addComment(supportCase, author, comment, State.WAITING_FOR_CUSTOMER); } private SupportCase addComment(SupportCase supportCase, String author, String comment, State newState) { diff --git a/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/service/StateService.java b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/service/StateService.java similarity index 84% rename from kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/service/StateService.java rename to kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/service/StateService.java index 68d512c101..f2fb019f1c 100644 --- a/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/service/StateService.java +++ b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/service/StateService.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.flexible.example.service; +package org.acme.flexible.example.service; import javax.enterprise.context.ApplicationScoped; -import org.kie.kogito.flexible.example.model.Questionnaire; -import org.kie.kogito.flexible.example.model.State; -import org.kie.kogito.flexible.example.model.SupportCase; +import org.acme.flexible.example.model.Questionnaire; +import org.acme.flexible.example.model.State; +import org.acme.flexible.example.model.SupportCase; @ApplicationScoped public class StateService { diff --git a/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/service/TriageService.java b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/service/TriageService.java similarity index 93% rename from kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/service/TriageService.java rename to kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/service/TriageService.java index 2f98e73717..6c0de6bc8f 100644 --- a/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/kie/kogito/flexible/example/service/TriageService.java +++ b/kogito-quarkus-examples/flexible-process-quarkus/src/main/java/org/acme/flexible/example/service/TriageService.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.flexible.example.service; +package org.acme.flexible.example.service; import java.util.Random; import javax.enterprise.context.ApplicationScoped; -import org.kie.kogito.flexible.example.model.State; -import org.kie.kogito.flexible.example.model.SupportCase; +import org.acme.flexible.example.model.State; +import org.acme.flexible.example.model.SupportCase; @ApplicationScoped public class TriageService { diff --git a/kogito-quarkus-examples/flexible-process-quarkus/src/main/resources/service-desk.bpmn b/kogito-quarkus-examples/flexible-process-quarkus/src/main/resources/service-desk.bpmn index b172529784..1823b8534d 100644 --- a/kogito-quarkus-examples/flexible-process-quarkus/src/main/resources/service-desk.bpmn +++ b/kogito-quarkus-examples/flexible-process-quarkus/src/main/resources/service-desk.bpmn @@ -1,17 +1,17 @@ - + - + - + - - + + - + @@ -56,10 +56,10 @@ - + - + @@ -72,42 +72,42 @@ - - - + + + - - + + - + - - - + + + - + - + - + - + - + - + @@ -167,7 +167,7 @@ - + @@ -175,8 +175,8 @@ _C651F6F2-8C0D-4E9A-94B3-0BB337536F51 - - + + _5DCB19C5-63B3-4846-A8C7-9E383306E915_supportCaseInputX @@ -296,7 +296,7 @@ supportGroup - + @@ -305,9 +305,9 @@ _4D493B33-AE13-464F-B7F5-4A7A9A9044BA _5CF61231-028A-4E4A-AC50-01C1737FEC0A - + - + _D17F5E0D-779E-4AF4-9E33-6E37D8F54DA7_supportCaseInputX _D17F5E0D-779E-4AF4-9E33-6E37D8F54DA7_supportGroupInputX @@ -337,7 +337,7 @@ _6B10C12D-99D4-4758-B2D3-32D8E527A287 _28168759-AF8E-47D3-9FEA-8095507ABEB7 - + @@ -345,9 +345,9 @@ _DBE81078-2C21-4128-ADDE-CA5E170F0792 - + - + _26E99F98-8E2E-4321-98A7-BE7570FF0BD2_supportCaseInputX _26E99F98-8E2E-4321-98A7-BE7570FF0BD2_supportGroupInputX @@ -382,10 +382,10 @@ _DBE81078-2C21-4128-ADDE-CA5E170F0792 - + - + _BACB7C86-E7FA-4E2B-931A-CC02C812A698_TaskNameInputX _BACB7C86-E7FA-4E2B-931A-CC02C812A698_supportCaseInputX @@ -448,7 +448,7 @@ - + @@ -456,10 +456,10 @@ _56AFC157-45AE-44E0-A94D-52AE95EFC74B - + - + _BEAA2A42-CD36-4A08-BB42-4823EAA5C137_supportCaseInputX _BEAA2A42-CD36-4A08-BB42-4823EAA5C137_evaluationInputX @@ -667,7 +667,7 @@ author - + @@ -675,10 +675,10 @@ _D49DA468-8A7B-4688-A8DB-5B09D1AE22B1 - + - + _5B1A92B6-7044-4C8B-9011-62CD592F255F_supportCaseInputX _5B1A92B6-7044-4C8B-9011-62CD592F255F_commentInputX @@ -705,7 +705,7 @@ supportCase - + @@ -713,10 +713,10 @@ _021482FA-6264-4060-B11B-ABD91159122A - + - + _D514F716-3F06-468F-A487-892F6089C776_supportCaseInputX _D514F716-3F06-468F-A487-892F6089C776_commentInputX @@ -743,7 +743,7 @@ supportCase - + diff --git a/kogito-quarkus-examples/flexible-process-quarkus/src/test/java/org/kie/kogito/flexible/example/quarkus/ServiceDeskProcessTest.java b/kogito-quarkus-examples/flexible-process-quarkus/src/test/java/org/acme/flexible/example/quarkus/ServiceDeskProcessTest.java similarity index 96% rename from kogito-quarkus-examples/flexible-process-quarkus/src/test/java/org/kie/kogito/flexible/example/quarkus/ServiceDeskProcessTest.java rename to kogito-quarkus-examples/flexible-process-quarkus/src/test/java/org/acme/flexible/example/quarkus/ServiceDeskProcessTest.java index 085ece400b..5002eebc87 100644 --- a/kogito-quarkus-examples/flexible-process-quarkus/src/test/java/org/kie/kogito/flexible/example/quarkus/ServiceDeskProcessTest.java +++ b/kogito-quarkus-examples/flexible-process-quarkus/src/test/java/org/acme/flexible/example/quarkus/ServiceDeskProcessTest.java @@ -13,17 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.flexible.example.quarkus; +package org.acme.flexible.example.quarkus; import java.util.HashMap; import java.util.List; import java.util.Map; +import org.acme.flexible.example.model.Product; +import org.acme.flexible.example.model.State; +import org.acme.flexible.example.model.SupportCase; +import org.acme.flexible.example.service.TriageService; import org.junit.jupiter.api.Test; -import org.kie.kogito.flexible.example.model.Product; -import org.kie.kogito.flexible.example.model.State; -import org.kie.kogito.flexible.example.model.SupportCase; -import org.kie.kogito.flexible.example.service.TriageService; import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; diff --git a/kogito-quarkus-examples/kogito-travel-agency/README.md b/kogito-quarkus-examples/kogito-travel-agency/README.md index acebb5995d..bd9394cafb 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/README.md +++ b/kogito-quarkus-examples/kogito-travel-agency/README.md @@ -15,10 +15,11 @@ Each version is based on previous one so it allows people perform the implementa and to start any any place. [Base travel agency service](basic) - deals with all the basic steps to book flight and hotel. -Consists of single service that has both business logic and decision logic included. +Consists of single service that has both business logic and decision logic included. [Travel agency and visa services with persistence](extended) - deals with all the basic steps to book flight and hotel. -Consists of two services that have both business logic and decision logic included. Preserves data between service restarts and requires Infinispan server to be available. +Consists of two services that have both business logic and decision logic included. Preserves data between service +restarts and requires Infinispan server to be available. ## Contribution @@ -31,4 +32,5 @@ Everyone is encouraged to contribute to this tutorial by ## Deploying with Kogito Operator -In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). +In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with +the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). diff --git a/kogito-quarkus-examples/kogito-travel-agency/basic/README.md b/kogito-quarkus-examples/kogito-travel-agency/basic/README.md index 47fdcc54af..9f3edd0ecb 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/basic/README.md +++ b/kogito-quarkus-examples/kogito-travel-agency/basic/README.md @@ -2,29 +2,31 @@ ## Description -During this workshop we will create a software system for a startup travel agency called Kogito Travel Agency. The first iteration of the system will consist of a set of services that are able to deal with travel requests and the booking of hotels and flights. +During this workshop we will create a software system for a startup travel agency called Kogito Travel Agency. The first +iteration of the system will consist of a set of services that are able to deal with travel requests and the booking of +hotels and flights. ## Activities to perform * Create project using Quarkus Maven plugin with following extensions - * Kogito - * OpenApi + * Kogito + * OpenApi * Import project into Eclipse IDE - requires BPMN modeller plugin installed * Create data model - * Traveller - * Hotel - * Flight - * Address - * Trip -* Create service classes - * HotelBookingService - * FlightBookingService + * Traveller + * Hotel + * Flight + * Address + * Trip +* Create service classes + * HotelBookingService + * FlightBookingService * Create decision logic - * Visa check + * Visa check * Create business logic - * Public business process to deal with complete travel request - * Private business process to deal with hotel booking - * Private business process to deal with flight booking + * Public business process to deal with complete travel request + * Private business process to deal with hotel booking + * Private business process to deal with flight booking * Create a test case that makes use of processes and decisions * Create or import UI components * Add metrics support for processes and decisions @@ -58,7 +60,8 @@ Location that is associated with either traveller or hotel ## Decision logic -The decision logic will be implemented as a decision table. The logic will be responsible for verifying whether a given traveller requires a visa to enter a given country or not. The decision logic reason over the following data/facts +The decision logic will be implemented as a decision table. The logic will be responsible for verifying whether a given +traveller requires a visa to enter a given country or not. The decision logic reason over the following data/facts * Destination that the traveller wants to go - country * Nationality of the traveller @@ -86,7 +89,8 @@ Private process that will be responsible for booking a flight. ## Services -There will be services implemented to carry on the hotel and flight booking. Implementation will be a CDI beans that will have hard coded logic to return a booked flight or hotel. +There will be services implemented to carry on the hotel and flight booking. Implementation will be a CDI beans that +will have hard coded logic to return a booked flight or hotel. * org.acme.travels.service.HotelBookingService * org.acme.travels.service.FlightBookingService @@ -107,7 +111,8 @@ When using native image compilation, you will also need: * GraalVM 20 installed * Environment variable GRAALVM_HOME set accordingly -* Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be installed too, please refer to GraalVM installation documentation for more details. +* Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be + installed too, please refer to GraalVM installation documentation for more details. #### Compile and Run in Local Dev Mode @@ -115,7 +120,8 @@ When using native image compilation, you will also need: mvn clean package quarkus:dev ``` -NOTE: With dev mode of Quarkus you can take advantage of hot reload for business assets like processes, rules and decision +NOTE: With dev mode of Quarkus you can take advantage of hot reload for business assets like processes, rules and +decision tables and java code. No need to redeploy or restart your running application. #### Compile and Run using Local Native Image diff --git a/kogito-quarkus-examples/kogito-travel-agency/basic/mvnw b/kogito-quarkus-examples/kogito-travel-agency/basic/mvnw deleted file mode 100755 index d2f0ea3808..0000000000 --- a/kogito-quarkus-examples/kogito-travel-agency/basic/mvnw +++ /dev/null @@ -1,310 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" - else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl -o "$wrapperJarPath" "$jarUrl" -f - else - curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f - fi - - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/kogito-quarkus-examples/kogito-travel-agency/basic/mvnw.cmd b/kogito-quarkus-examples/kogito-travel-agency/basic/mvnw.cmd deleted file mode 100644 index b26ab24f03..0000000000 --- a/kogito-quarkus-examples/kogito-travel-agency/basic/mvnw.cmd +++ /dev/null @@ -1,182 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - -FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/kogito-quarkus-examples/kogito-travel-agency/basic/pom.xml b/kogito-quarkus-examples/kogito-travel-agency/basic/pom.xml index ed8b1ecb54..fd82ed85d8 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/basic/pom.xml +++ b/kogito-quarkus-examples/kogito-travel-agency/basic/pom.xml @@ -1,13 +1,13 @@ - 4.0.0 - - org.kie.kogito.examples - kogito-travel-agency-example - 2.0.0-SNAPSHOT - + kogito-travel-agency-example-basic + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Travel Agency :: Basic UTF-8 @@ -21,7 +21,18 @@ 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT 8.45.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -47,6 +58,7 @@ + org.kie.kogito @@ -64,6 +76,10 @@ io.quarkus quarkus-resteasy-jackson + + io.quarkus + quarkus-smallrye-health + org.kie.kogito kogito-addons-quarkus-monitoring-prometheus @@ -98,6 +114,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/kogito-travel-agency/basic/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/kogito-travel-agency/basic/src/main/resources/META-INF/resources/index.html index e03c03053f..9ad7cf36d9 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/basic/src/main/resources/META-INF/resources/index.html +++ b/kogito-quarkus-examples/kogito-travel-agency/basic/src/main/resources/META-INF/resources/index.html @@ -5,8 +5,8 @@ Kogito Travel Agency - - + + @@ -53,14 +53,14 @@

Travels

'Accept': 'application/json' } }); - $( function() { - $( "#tripBegin" ).datepicker({ + $(function () { + $("#tripBegin").datepicker({ dateFormat: "yy-mm-dd" }); - $( "#tripEnd" ).datepicker({ + $("#tripEnd").datepicker({ dateFormat: "yy-mm-dd" }); - } ); + }); load(); initModal(); }); @@ -97,56 +97,56 @@

Travels

$.getJSON("/travels", function (data) { $.each(data, function (key, val) { $("" + val.traveller.lastName + ", " + val.traveller.firstName + "" + - "" + val.trip.country + ", " + val.trip.city + "" + - "" + new Date(val.trip.begin).toLocaleDateString() + " - " + new Date(val.trip.end).toLocaleDateString() + "" + - "" + (val.trip.visaRequired ? 'Yes' : 'No') + "" + - "" + (val.hotel != null ? val.hotel.name : '') + "" + - "" + (val.flight != null ? val.flight.flightNumber : '') + "" + - "" + - " " + - " " + - "" + - "" + - "").appendTo("#content"); + "" + val.trip.country + ", " + val.trip.city + "" + + "" + new Date(val.trip.begin).toLocaleDateString() + " - " + new Date(val.trip.end).toLocaleDateString() + "" + + "" + (val.trip.visaRequired ? 'Yes' : 'No') + "" + + "" + (val.hotel != null ? val.hotel.name : '') + "" + + "" + (val.flight != null ? val.flight.flightNumber : '') + "" + + "" + + " " + + " " + + "" + + "" + + "").appendTo("#content"); }); initCallbacks(); }); } function initCallbacks() { - $(".product-delete").unbind().click(function() { - var id = $(this).data("id"); - remove(id); + $(".product-delete").unbind().click(function () { + var id = $(this).data("id"); + remove(id); }); } @@ -177,9 +177,25 @@

Travels

productAction.click(function () { - var address = {street: $("#street").val(), city: $("#city").val(), zipCode: $("#zipCode").val(), country: $("#country").val()}; - var traveller = {firstName: $("#firstName").val(), lastName: $("#lastName").val(), email: $("#email").val(), nationality: $("#nationality").val(), address: address}; - var trip = {country: $("#destinationCountry").val(), city: $("#destinationCity").val(), begin: $("#tripBegin").val() + 'T00:00:00.000+02:00', end: $("#tripEnd").val() + 'T00:00:00.000+02:00'}; + var address = { + street: $("#street").val(), + city: $("#city").val(), + zipCode: $("#zipCode").val(), + country: $("#country").val() + }; + var traveller = { + firstName: $("#firstName").val(), + lastName: $("#lastName").val(), + email: $("#email").val(), + nationality: $("#nationality").val(), + address: address + }; + var trip = { + country: $("#destinationCountry").val(), + city: $("#destinationCity").val(), + begin: $("#tripBegin").val() + 'T00:00:00.000+02:00', + end: $("#tripEnd").val() + 'T00:00:00.000+02:00' + }; var travelRequest = JSON.stringify({traveller: traveller, trip: trip}); create(travelRequest); @@ -198,7 +214,7 @@

Travels

modal.find('#lastName').val(button.data("lastname")); modal.find('#email').val(button.data("email")); modal.find('#nationality').val(button.data("nationality")); - if(button.data("visa-application") !== null && button.data("visa-application") !== '') { + if (button.data("visa-application") !== null && button.data("visa-application") !== '') { $('#visa-application-group').show(); modal.find('#visaApplication').attr('href', button.data("visa-application")); } else { @@ -228,26 +244,26 @@

Travels

modal.find('.modal-title').text("Tasks for " + button.data("lastname") + ", " + button.data("firstname")); $("#taskscontent").children().remove(); - $.getJSON("/travels/"+ travelId + "/tasks", function (data) { + $.getJSON("/travels/" + travelId + "/tasks", function (data) { $.each(data, function (index, task) { let taskId = task.id; let taskName = task.name; let element = "" + taskName + ""; if (taskName === 'VisaApplication') { element += "
" + - ""; + ""; } else { element += ""; + " Complete" + + ""; } - element += ""; + element += ""; $(element).appendTo("#taskscontent"); }); + }) }) - }) }
+ class="form-control" + id="visa_firstName" + name="visa_firstName" readonly>
+ class="form-control" + id="visa_lastName" + name="visa_lastName" readonly>
+ class="form-control" id="visa_email" + name="visa_email" readonly>
+ type="text" class="form-control" id="visa_nationality" + name="visa_nationality" readonly>
@@ -700,20 +751,28 @@

Trip

+ class="form-control" + id="visa_destinationCountry" + name="visa_destinationCountry" + readonly>
+ class="form-control" + id="visa_destinationCity" + name="visa_destinationCity" + readonly>
+ class="form-control" + id="visa_tripBegin" + name="visa_tripBegin" readonly>
+ type="text" class="form-control" id="visa_tripEnd" + name="visa_tripEnd" readonly>
@@ -724,17 +783,24 @@

Visa details

+ class="form-control" + id="visa_passportNumber" + name="visa_passportNumber" + readonly>
+ class="form-control" + id="visa_duration" + name="visa_duration" readonly>
diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/travels/src/test/resources/application.properties b/kogito-quarkus-examples/kogito-travel-agency/extended/travels/src/test/resources/application.properties index a3684a9aa3..5df8de4868 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/travels/src/test/resources/application.properties +++ b/kogito-quarkus-examples/kogito-travel-agency/extended/travels/src/test/resources/application.properties @@ -2,34 +2,27 @@ quarkus.http.test-port=0 quarkus.http.cors=true quarkus.swagger-ui.always-include=true - kogito.service.url=http://localhost:8080 kogito.dataindex.http.url=http://localhost:8180 kogito.dataindex.ws.url=ws://localhost:8180 - #Kafka kafka.bootstrap.servers=localhost:9092 - #mp.messaging.incoming.kogito_incoming_stream.bootstrap.servers=localhost:9092 mp.messaging.incoming.kogito_incoming_stream.connector=smallrye-kafka mp.messaging.incoming.kogito_incoming_stream.topic=visasresponses mp.messaging.incoming.kogito_incoming_stream.value.deserializer=org.apache.kafka.common.serialization.StringDeserializer - #mp.messaging.outgoing.kogito_outgoing_stream.bootstrap.servers=localhost:9092 mp.messaging.outgoing.kogito_outgoing_stream.connector=smallrye-kafka mp.messaging.outgoing.kogito_outgoing_stream.topic=visaapplications mp.messaging.outgoing.kogito_outgoing_stream.value.serializer=org.apache.kafka.common.serialization.StringSerializer - #mp.messaging.outgoing.kogito-processinstances-events.bootstrap.servers=localhost:9092 mp.messaging.outgoing.kogito-processinstances-events.connector=smallrye-kafka mp.messaging.outgoing.kogito-processinstances-events.topic=kogito-processinstances-events mp.messaging.outgoing.kogito-processinstances-events.value.serializer=org.apache.kafka.common.serialization.StringSerializer - #mp.messaging.outgoing.kogito-usertaskinstances-events.bootstrap.servers=localhost:9092 mp.messaging.outgoing.kogito-usertaskinstances-events.connector=smallrye-kafka mp.messaging.outgoing.kogito-usertaskinstances-events.topic=kogito-usertaskinstances-events mp.messaging.outgoing.kogito-usertaskinstances-events.value.serializer=org.apache.kafka.common.serialization.StringSerializer - #mp.messaging.outgoing.kogito-variables-events.bootstrap.servers=localhost:9092 mp.messaging.outgoing.kogito-variables-events.connector=smallrye-kafka mp.messaging.outgoing.kogito-variables-events.topic=kogito-variables-events diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/README.md b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/README.md index 7f5cdb9195..52c7720feb 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/README.md +++ b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/README.md @@ -3,7 +3,7 @@ ## Description This is another service of the Kogito Travel Agency application. It's responsible for processing visa applications -that are sent during travel requests. +that are sent during travel requests. In its current state it simply accepts incoming visa applications from Kafka topic and process them @@ -16,15 +16,15 @@ will add additional handling to the approved or rejected visa applications _(by ## Activities to perform * Create project using Quarkus Maven plugin with following extensions - * Kogito - * OpenApi + * Kogito + * OpenApi * Import project into Eclipse IDE - requires BPMN modeller plugin installed -* Create data model - * VisaApplication +* Create data model + * VisaApplication * Create decision logic - * Visa approvals + * Visa approvals * Create business logic - * Public business process to deal with visa applications + * Public business process to deal with visa applications * Configure messaging and events * Create or import UI components * Add custom metrics based on the approved and rejected visa applications @@ -38,11 +38,10 @@ Kogito Travel Agency booking system will be based on following data model A basic visa application information required to process - ## Decision logic -The decision logic will be implemented as a set of rules in DRL format. These rules will be responsible for automatic visa application approval - +The decision logic will be implemented as a set of rules in DRL format. These rules will be responsible for automatic +visa application approval ## Business logic @@ -52,7 +51,6 @@ Public process that will be responsible for processing visa application

- # Try out the complete service ## Installing and Running @@ -60,18 +58,22 @@ Public process that will be responsible for processing visa application ### Prerequisites You will need: - - Java 11+ installed - - Environment variable JAVA_HOME set accordingly - - Maven 3.8.6+ installed + +- Java 11+ installed +- Environment variable JAVA_HOME set accordingly +- Maven 3.8.6+ installed When using native image compilation, you will also need: - - GraalVM 19.3.1+ installed - - Environment variable GRAALVM_HOME set accordingly - - Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be installed too, please refer to GraalVM installation documentation for more details. + +- GraalVM 19.3.1+ installed +- Environment variable GRAALVM_HOME set accordingly +- Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be + installed too, please refer to GraalVM installation documentation for more details. ### Starting the Kogito and Infrastructure Services -This quickstart provides a docker compose template that starts all the required services. This setup ensures that all services are connected with a default configuration. +This quickstart provides a docker compose template that starts all the required services. This setup ensures that all +services are connected with a default configuration. You should start all the services before you execute any of the **Hiring** example, to do that please execute: @@ -98,7 +100,9 @@ Once all services bootstrap, the following ports will be assigned on your local - Keycloak server: 8480 - Management Console: 8280 -> **_NOTE:_** This step requires the project to be compiled, please consider running a ```mvn clean install``` command on the project root before running the ```startServices.sh``` script for the first time or any time you modify the project. +> **_NOTE:_** This step requires the project to be compiled, please consider running a ```mvn clean install``` command +> on the project root before running the ```startServices.sh``` script for the first time or any time you modify the +> project. Once started you can simply stop all services by executing the ```docker-compose stop```. @@ -106,16 +110,19 @@ All created containers can be removed by executing the ```docker-compose rm```. ### Using Keycloak as Authentication Server -In this Quickstart we'll be using [Keycloak](https://www.keycloak.org/) as *Authentication Server*. It will be started as a part of the project *Infrastructure Services*, you can check the configuration on the project [docker-compose.yml](docker-compose/docker-compose.yml) in [docker-compose](docker-compose) folder. +In this Quickstart we'll be using [Keycloak](https://www.keycloak.org/) as *Authentication Server*. It will be started +as a part of the project *Infrastructure Services*, you can check the configuration on the +project [docker-compose.yml](docker-compose/docker-compose.yml) in [docker-compose](docker-compose) folder. It will install the *Kogito Realm* that comes with a predefined set of users: -| Login | Password | Roles | +| Login | Password | Roles | | ------------- | ---------- | ------------------- | -| admin | admin | *admin*, *managers* | -| alice | alice | *user* | -| jdoe | jdoe | *managers* | +| admin | admin | *admin*, *managers* | +| alice | alice | *user* | +| jdoe | jdoe | *managers* | -Once Keycloak is started, you should be able to access your *Keycloak Server* at [localhost:8480/auth](http://localhost:8480/auth) with *admin* user. +Once Keycloak is started, you should be able to access your *Keycloak Server* +at [localhost:8480/auth](http://localhost:8480/auth) with *admin* user. ### Compile and Run in Local Dev Mode @@ -123,11 +130,14 @@ Once Keycloak is started, you should be able to access your *Keycloak Server* at mvn clean package quarkus:dev ``` -NOTE: With dev mode of Quarkus you can take advantage of hot reload for business assets like processes, rules and decision -tables and java code. No need to redeploy or restart your running application.During this workshop we will create a software system for a startup travel agency called Kogito Travel Agency. The first iteration of the system will consist of a set of services that are able to deal with travel requests and the booking of hotels and flights. - +NOTE: With dev mode of Quarkus you can take advantage of hot reload for business assets like processes, rules and +decision +tables and java code. No need to redeploy or restart your running application.During this workshop we will create a +software system for a startup travel agency called Kogito Travel Agency. The first iteration of the system will consist +of a set of services that are able to deal with travel requests and the booking of hotels and flights. ### Compile and Run using Local Native Image + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ``` @@ -140,20 +150,16 @@ To run the generated native executable, generated in `target/`, execute ./target/visas-{version}-runner ``` - ## Known issues - ## User interface Kogito Visas comes with basic UI that allows to - ### list currently opened visa applications

- ### approve/reject selected visa application

@@ -164,7 +170,6 @@ To start Kogito Travel Agency UI just point your browser to [http://localhost:80 Once the service is up and running, you can use the following examples to interact with the service. - ### GET /visaApplications Returns list of visa application requests currently active: @@ -226,5 +231,7 @@ EOF ### Querying the technical cache -When running **Kogito Data Index Service** on dev mode, the GraphiQL UI is available at [http://localhost:8180](http://localhost:8180/) and allow to -perform different queries on the model as is explained at [wiki/Data-Index-service](https://github.com/kiegroup/kogito-runtimes/wiki/Data-Index-Service) +When running **Kogito Data Index Service** on dev mode, the GraphiQL UI is available +at [http://localhost:8180](http://localhost:8180/) and allow to +perform different queries on the model as is explained +at [wiki/Data-Index-service](https://github.com/kiegroup/kogito-runtimes/wiki/Data-Index-Service) diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/mvnw b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/mvnw deleted file mode 100755 index d2f0ea3808..0000000000 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/mvnw +++ /dev/null @@ -1,310 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" - else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl -o "$wrapperJarPath" "$jarUrl" -f - else - curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f - fi - - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/mvnw.cmd b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/mvnw.cmd deleted file mode 100644 index b26ab24f03..0000000000 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/mvnw.cmd +++ /dev/null @@ -1,182 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - -FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/pom.xml b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/pom.xml index 8e8342f2a6..c3b31f89fb 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/pom.xml +++ b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/pom.xml @@ -1,13 +1,13 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-travel-agency-example-extended - 2.0.0-SNAPSHOT - + visas + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Travel Agency :: Visas 2.16.10.Final @@ -18,7 +18,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -37,6 +48,7 @@ + org.kie.kogito @@ -62,6 +74,10 @@ io.quarkus quarkus-resteasy-jackson + + io.quarkus + quarkus-smallrye-health + io.quarkus quarkus-junit5 @@ -120,6 +136,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/kie/kogito/app/ProcessEventListenerConfig.java b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/app/ProcessEventListenerConfig.java similarity index 98% rename from kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/kie/kogito/app/ProcessEventListenerConfig.java rename to kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/app/ProcessEventListenerConfig.java index e49595a347..bd0b973b30 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/kie/kogito/app/ProcessEventListenerConfig.java +++ b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/app/ProcessEventListenerConfig.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.app; +package org.acme.app; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/kie/kogito/app/VertxRouter.java b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/app/VertxRouter.java similarity index 98% rename from kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/kie/kogito/app/VertxRouter.java rename to kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/app/VertxRouter.java index 20705faa7f..868ac07a23 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/kie/kogito/app/VertxRouter.java +++ b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/app/VertxRouter.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.app; +package org.acme.app; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.event.Observes; diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/kie/kogito/app/VisaApplicationPrometheusProcessEventListener.java b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/app/VisaApplicationPrometheusProcessEventListener.java similarity index 88% rename from kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/kie/kogito/app/VisaApplicationPrometheusProcessEventListener.java rename to kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/app/VisaApplicationPrometheusProcessEventListener.java index 2cc9c2589f..7d1958d482 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/kie/kogito/app/VisaApplicationPrometheusProcessEventListener.java +++ b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/app/VisaApplicationPrometheusProcessEventListener.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.app; +package org.acme.app; import java.util.Arrays; @@ -36,8 +36,8 @@ public class VisaApplicationPrometheusProcessEventListener extends MetricsProces private static final String NUMBER_OF_VISA_REJECTED_COUNTER_NAME = "acme_travels_visas_rejected_total"; private static Counter getNumberOfVisaApplicationsApprovedCounter(String appId, String country, String duration, - String nationality, - CompositeMeterRegistry compositeMeterRegistry) { + String nationality, + CompositeMeterRegistry compositeMeterRegistry) { return Counter .builder(NUMBER_OF_VISA_APPROVED_COUNTER_NAME) .description("Approved visa applications") @@ -46,8 +46,8 @@ private static Counter getNumberOfVisaApplicationsApprovedCounter(String appId, } private static Counter getNumberOfVisaApplicationsRejected(String appId, String country, String duration, - String nationality, - CompositeMeterRegistry compositeMeterRegistry) { + String nationality, + CompositeMeterRegistry compositeMeterRegistry) { return Counter .builder(NUMBER_OF_VISA_REJECTED_COUNTER_NAME) .description("Rejected visa applications") @@ -59,7 +59,7 @@ private static Counter getNumberOfVisaApplicationsRejected(String appId, String private final PrometheusMeterRegistry prometheusMeterRegistry; public VisaApplicationPrometheusProcessEventListener(String identifier, KogitoGAV kogitoGAV, - PrometheusMeterRegistry prometheusMeterRegistry) { + PrometheusMeterRegistry prometheusMeterRegistry) { super(identifier, kogitoGAV, Metrics.globalRegistry); this.identifier = identifier; this.prometheusMeterRegistry = prometheusMeterRegistry; @@ -89,11 +89,11 @@ public void afterProcessCompleted(ProcessCompletedEvent event) { getNumberOfVisaApplicationsApprovedCounter(identifier, safeValue(application.getCountry()), String.valueOf(application.getDuration()), safeValue(application.getNationality()), Metrics.globalRegistry) - .increment(); + .increment(); } else { getNumberOfVisaApplicationsRejected(identifier, safeValue(application.getCountry()), String.valueOf(application.getDuration()), safeValue(application.getNationality()), Metrics.globalRegistry) - .increment(); + .increment(); } } } diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/travels/VisaApplication.java b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/travels/VisaApplication.java index 9209973a71..c594d598f5 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/travels/VisaApplication.java +++ b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/travels/VisaApplication.java @@ -30,7 +30,7 @@ public VisaApplication() { } public VisaApplication(String firstName, String lastName, String city, String country, int duration, - String passportNumber) { + String passportNumber) { this.firstName = firstName; this.lastName = lastName; this.city = city; diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/resources/META-INF/processSVG/visaApplications.svg b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/resources/META-INF/processSVG/visaApplications.svg index 082063bfc3..f6e4644645 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/resources/META-INF/processSVG/visaApplications.svg +++ b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/resources/META-INF/processSVG/visaApplications.svg @@ -1 +1,506 @@ -Visa rejectedManually approved?Manual visa approval Visa approvedVisa approved?Automatic visa approvals StartProcessInitialize variable No Yes No Yes \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visa rejected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Manually approved? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Manual visa + + approval + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visa approved + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visa approved? + + + + + + + + + + + + + + + + + + + + + + + Automatic visa + + approvals + + + + + + + + + + + + + + + + + + + + + + + + + + + + + StartProcess + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Initialize + + variable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No + + + + + + + + + + + + + + + + + + + + + + + Yes + + + + + + + + + + + + + + + + + + + + + + + No + + + + + + + + + + + + + Yes + + + + + + \ No newline at end of file diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/resources/application.properties b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/resources/application.properties index d3e554b334..eaf3857184 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/resources/application.properties +++ b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/resources/application.properties @@ -1,53 +1,39 @@ # Packaging # quarkus.package.type=fast-jar - quarkus.http.port=8090 quarkus.http.cors=true quarkus.http.cors.origins=/.*/ - kogito.service.url=http://localhost:8090 kogito.dataindex.http.url=http://localhost:8180 kogito.dataindex.ws.url=ws://localhost:8180 - quarkus.oidc.auth-server-url=http://localhost:8281/auth/realms/kogito quarkus.oidc.client-id=kogito-app quarkus.oidc.credentials.secret=secret - - quarkus.infinispan-client.hosts=localhost:11222 quarkus.infinispan-client.use-auth=false #quarkus.infinispan-client.hosts=kogito-infinispan:11222 - kafka.bootstrap.servers=localhost:9092 - ## main transport - #mp.messaging.incoming.kogito_incoming_stream.bootstrap.servers=localhost:9092 mp.messaging.incoming.kogito_incoming_stream.connector=smallrye-kafka mp.messaging.incoming.kogito_incoming_stream.topic=visaapplications mp.messaging.incoming.kogito_incoming_stream.value.deserializer=org.apache.kafka.common.serialization.StringDeserializer #mp.messaging.incoming.kogito_incoming_stream.auto.offset.reset=earliest - #mp.messaging.outgoing.kogito_outgoing_stream.bootstrap.servers=localhost:9092 mp.messaging.outgoing.kogito_outgoing_stream.connector=smallrye-kafka mp.messaging.outgoing.kogito_outgoing_stream.topic=visasresponses mp.messaging.outgoing.kogito_outgoing_stream.value.serializer=org.apache.kafka.common.serialization.StringSerializer - ## metadata - #mp.messaging.outgoing.kogito-processinstances-events.bootstrap.servers=localhost:9092 mp.messaging.outgoing.kogito-processinstances-events.connector=smallrye-kafka mp.messaging.outgoing.kogito-processinstances-events.topic=kogito-processinstances-events mp.messaging.outgoing.kogito-processinstances-events.value.serializer=org.apache.kafka.common.serialization.StringSerializer - #mp.messaging.outgoing.kogito-usertaskinstances-events.bootstrap.servers=localhost:9092 mp.messaging.outgoing.kogito-usertaskinstances-events.connector=smallrye-kafka mp.messaging.outgoing.kogito-usertaskinstances-events.topic=kogito-usertaskinstances-events mp.messaging.outgoing.kogito-usertaskinstances-events.value.serializer=org.apache.kafka.common.serialization.StringSerializer - #mp.messaging.outgoing.kogito-variables-events.bootstrap.servers=localhost:9092 mp.messaging.outgoing.kogito-variables-events.connector=smallrye-kafka mp.messaging.outgoing.kogito-variables-events.topic=kogito-variables-events mp.messaging.outgoing.kogito-variables-events.value.serializer=org.apache.kafka.common.serialization.StringSerializer - kogito.monitoring.process.useDefault=false diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/resources/templates/index.html b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/resources/templates/index.html index e9ec5f6cf6..ac6bab345d 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/resources/templates/index.html +++ b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/resources/templates/index.html @@ -79,48 +79,48 @@

Visa applications

if ("WebSocket" in window) { - // Let us open a web socket - var ws = new WebSocket('{config:property('kogito.dataindex.ws.url') or 'ws://localhost:8180'}/graphql'); - - ws.onopen = function() { - // Web Socket is connected, send data using send() - ws.send('{"id" : "1", "type" : "connection_init"}'); - }; - - ws.onmessage = function (evt) { - var received_msg = evt.data; - let jsonObject = JSON.parse(received_msg); - if(jsonObject.type === 'connection_ack'){ - ws.send('{"id" : "2", "type" : "start", "payload" : { "query" : "subscription { VisaApplicationsUpdated { id, visaApplication { lastName, firstName, country, city, nationality, duration, passportNumber }, visaResolution { approved }, metadata { processInstances { state } } } }"}}'); - } else if(jsonObject.type === 'data') { - var val = jsonObject.payload.data.VisaApplicationsUpdated; - - var existing = document.getElementById(val.id); - if (existing != null) { - existing.remove(); - } - - appendDataRow(null, val); - } - }; - - ws.onclose = function() { - - // websocket is closed. - }; + // Let us open a web socket + var ws = new WebSocket('{config:property('kogito.dataindex.ws.url') or 'ws://localhost:8180'}/graphql'); + + ws.onopen = function () { + // Web Socket is connected, send data using send() + ws.send('{"id" : "1", "type" : "connection_init"}'); + }; + + ws.onmessage = function (evt) { + var received_msg = evt.data; + let jsonObject = JSON.parse(received_msg); + if (jsonObject.type === 'connection_ack') { + ws.send('{"id" : "2", "type" : "start", "payload" : { "query" : "subscription { VisaApplicationsUpdated { id, visaApplication { lastName, firstName, country, city, nationality, duration, passportNumber }, visaResolution { approved }, metadata { processInstances { state } } } }"}}'); + } else if (jsonObject.type === 'data') { + var val = jsonObject.payload.data.VisaApplicationsUpdated; + + var existing = document.getElementById(val.id); + if (existing != null) { + existing.remove(); + } + + appendDataRow(null, val); + } + }; + + ws.onclose = function () { + + // websocket is closed. + }; } }); function load() { $("#content").children().remove(); var query = "{ \"query\": \"" + - "{ VisaApplications { " + - "id " + - "visaApplication { lastName, firstName, country, city, nationality, duration, passportNumber } " + - "visaResolution { approved } " + - "metadata { processInstances { state } } " + - "}}\"" + - "}"; + "{ VisaApplications { " + + "id " + + "visaApplication { lastName, firstName, country, city, nationality, duration, passportNumber } " + + "visaResolution { approved } " + + "metadata { processInstances { state } } " + + "}}\"" + + "}"; $.ajax({ type: 'POST', @@ -136,35 +136,35 @@

Visa applications

} function appendDataRow(key, val) { - var active = $.grep(val.metadata.processInstances, function (pi) { - return pi.state == "ACTIVE" - }).length > 0; - var html = - "" + val.visaApplication.lastName + ", " + val.visaApplication.firstName + "" + - "" + val.visaApplication.country + ", " + val.visaApplication.city + "" + - "" + val.visaApplication.duration + " days" + - "" + val.visaApplication.passportNumber + "" + - "" + val.visaApplication.nationality + "" + - "" + (val.visaResolution.approved ? 'Yes' : 'No') + "" + - ""; - if (active) { - html += - " "; - } - html += ""; - $(html).appendTo("#content"); + var active = $.grep(val.metadata.processInstances, function (pi) { + return pi.state == "ACTIVE" + }).length > 0; + var html = + "" + val.visaApplication.lastName + ", " + val.visaApplication.firstName + "" + + "" + val.visaApplication.country + ", " + val.visaApplication.city + "" + + "" + val.visaApplication.duration + " days" + + "" + val.visaApplication.passportNumber + "" + + "" + val.visaApplication.nationality + "" + + "" + (val.visaResolution.approved ? 'Yes' : 'No') + "" + + ""; + if (active) { + html += + " "; + } + html += ""; + $(html).appendTo("#content"); } function initCallbacks() { @@ -186,11 +186,15 @@

Visa applications

approved: Boolean(decision), reason: "Manual approval" }; - var visaApplicationRequest = JSON.stringify(\{application: vapplication, resolution: vResolution\}); + var visaApplicationRequest = JSON.stringify(\{application: vapplication, resolution: vResolution\ + } + + ) + ; - $.post("/visaApplications/" + $("#visa_p_id").val() + "/ApplicationApproval/" + $("#visa_t_id").val() + userFilter, visaApplicationRequest, function () { + $.post("/visaApplications/" + $("#visa_p_id").val() + "/ApplicationApproval/" + $("#visa_t_id").val() + userFilter, visaApplicationRequest, function () { - }, "json"); + }, "json"); } function initModal() { @@ -201,7 +205,7 @@

Visa applications

var id = button.data('id'); var modal = $(this); - $.getJSON("/visaApplications/" + id + "/tasks"+userFilter, function (data) { + $.getJSON("/visaApplications/" + id + "/tasks" + userFilter, function (data) { $.each(data, function (key, val) { if ("ApplicationApproval" == val.name) { modal.find('.modal-title').text("Visa application for " + button.data("lastname") + ", " + button.data("firstname")); @@ -243,15 +247,19 @@

Traveller

+ class="form-control" id="firstName" + name="firstName" readonly>
+ class="form-control" id="lastName" + name="lastName" readonly>
+ class="form-control" + id="nationality" name="nationality" + readonly>
@@ -261,11 +269,14 @@

Trip

+ class="form-control" id="country" + name="destinationCountry" + readonly>
+ class="form-control" id="city" + name="destinationCity" readonly>
@@ -277,7 +288,8 @@

Stay information

+ class="form-control" id="duration" + name="duration" readonly>
@@ -288,14 +300,21 @@

Documents

+ class="form-control" + id="passportNumber" + name="passportNumber" + readonly>
diff --git a/kogito-quarkus-examples/kogito-travel-agency/pom.xml b/kogito-quarkus-examples/kogito-travel-agency/pom.xml index 57f6d1b31d..e1e87e9cd9 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/pom.xml +++ b/kogito-quarkus-examples/kogito-travel-agency/pom.xml @@ -1,40 +1,18 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + kogito-travel-agency-example + org.acme.examples + 2.0.0-SNAPSHOT pom + Kogito Example :: Travel Agency + basic extended - - 2.16.10.Final - quarkus-bom - io.quarkus - 2.16.10.Final - - - - - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} - pom - import - - - - - - io.quarkus - quarkus-smallrye-health - - diff --git a/kogito-quarkus-examples/ocp-tryout/README.md b/kogito-quarkus-examples/ocp-tryout/README.md index 9bf8422d17..92d933f01b 100644 --- a/kogito-quarkus-examples/ocp-tryout/README.md +++ b/kogito-quarkus-examples/ocp-tryout/README.md @@ -3,115 +3,150 @@ The goal of this procedure is to simplify the deployment of a Kogito application on the Openshift platform. This deployment includes both the required infrastructure and the Kogito application. -The deployment is targeting examples based on the BPM model which may require additional resources like protobuf and svg files. +The deployment is targeting examples based on the BPM model which may require additional resources like protobuf and svg +files. Make sure you meet the [prerequisites](#prerequisites) and then start [here](#installation). ## Prerequisites + - [Developer sandbox ](https://developers.redhat.com/developer-sandbox/get-started) or other Openshift cluster - oc cli installed - helm 3 cli installed -- a Kogito application image - find [here](applicationImage.md) example how to create an application image and upload to an image repository +- a Kogito application image - find [here](applicationImage.md) example how to create an application image and upload to + an image repository ### Available Infrastructure + - Persistence: - - infinispan/server:14.0.4.Final via helm chart + - infinispan/server:14.0.4.Final via helm chart - Messaging: - - bitnami/kafka:2.8.1-debian-10-r31 via helm chart + - bitnami/kafka:2.8.1-debian-10-r31 via helm chart - Authorization/Authentication: - - jboss/keycloak:15.0.2 image preconfigured using realm import - ephemeral installation - + - jboss/keycloak:15.0.2 image preconfigured using realm import - ephemeral installation + ### Available Kogito services + Installation from pre-build images + - [Data Index](https://docs.jboss.org/kogito/release/1.15.0/html_single/#con-data-index-service_kogito-configuring) -- [Management console](https://docs.jboss.org/kogito/release/1.15.0/html_single/#con-management-console_kogito-developing-process-services) +- [Management console](https://docs.jboss.org/kogito/release/1.15.0/html_single/#con-management-console_kogito-developing-process-services) - [Jobs service](https://docs.jboss.org/kogito/release/latest/html_single/#con-jobs-service_kogito-configuring) - [Task console](https://docs.jboss.org/kogito/release/latest/html_single/#con-task-console_kogito-developing-process-services) -## Architecture +## Architecture + ![](./architecture.png) ## Installation + - login to OCP cluster: `oc login ...` - update `./installer.properties` **mandatory** properties are: - - `KOGITO_VERSION`: the version of Kogito your application is based upon - **default**: latest - - `OCP_PROJECT`: the project/namespace for the deployment which must exist + - `KOGITO_VERSION`: the version of Kogito your application is based upon - **default**: latest + - `OCP_PROJECT`: the project/namespace for the deployment which must exist - update folders - - **Note**: you can use the example files from `./testapp/example` - which allow you to run the Kogito Travel Agency extended example. Just copy the folders to under `./testapp` - The KOGITO_VERSION in `installer.properties` should be 1.16.0. - - **When not using the example files, do:** - - `./testapp/apps`: For each Kogito application to be installed define a `.yaml` file under the `apps` folder. - The file name will be used as the chart release name. Only use lowercase alphanumeric characters. - - The minimum configuration for each `.yaml` is: - ``` - # example - image: - repository: quay.io/kiegroup/examples-travels - tag: 1.16.0.final - applicationPort: 8080 - ``` - - `./testapp/protobuf`: For each Kogito application to be installed add its protobuf files under the `protobuf` folder. Protobuf files for the Kogito examples can be found under folder `target/classes/META-INF/resources/persistence/protobuf`. - - `./testapp/svg`: For each Kogito application to be installed add its svg files under the `svg` folder. svg files for the Kogito examples can be found under `target/classes/META-INF/processSVG`. + - **Note**: you can use the example files from `./testapp/example` + which allow you to run the Kogito Travel Agency extended example. Just copy the folders to under `./testapp` + The KOGITO_VERSION in `installer.properties` should be 1.16.0. + - **When not using the example files, do:** + - `./testapp/apps`: For each Kogito application to be installed define a `.yaml` file under the `apps` + folder. + The file name will be used as the chart release name. Only use lowercase alphanumeric characters. + + The minimum configuration for each `.yaml` is: + ``` + # example + image: + repository: quay.io/kiegroup/examples-travels + tag: 1.16.0.final + applicationPort: 8080 + ``` + - `./testapp/protobuf`: For each Kogito application to be installed add its protobuf files under the `protobuf` + folder. Protobuf files for the Kogito examples can be found under + folder `target/classes/META-INF/resources/persistence/protobuf`. + - `./testapp/svg`: For each Kogito application to be installed add its svg files under the `svg` folder. svg + files for the Kogito examples can be found under `target/classes/META-INF/processSVG`. - run `./installer.sh` Installation logs are written to the console and `./ocp-tryout/installLogs.txt` ## Removal of installation + - login to OCP cluster: `oc login ...` -- use the same `./installer.properties` you installed with to remove the installation completely or cherry-pick the parts to uninstall +- use the same `./installer.properties` you installed with to remove the installation completely or cherry-pick the + parts to uninstall - run `./uninstaller.sh` ## Component Interconnection/Initialization -Not just the Kogito application but also Kogito services need to interface with other Kogito services or infrastructures. -All configuration required to make those connections as well as initializations are defined in one config map called `kogito-configs`. +Not just the Kogito application but also Kogito services need to interface with other Kogito services or +infrastructures. +All configuration required to make those connections as well as initializations are defined in one config map +called `kogito-configs`. ### Keycloak Configurations + - `keycloak.admin.user` - the username used to connect to Keycloak administration console - `keycloak.admin.password` - the administration consoles' users' password -- `keycloak.realm.json` - Keycloak initialization file for the Kogito realm creating clients, users, etc. used in Kogito examples +- `keycloak.realm.json` - Keycloak initialization file for the Kogito realm creating clients, users, etc. used in Kogito + examples - `keycloak.db.vendor` - Keycloak persistence + ### Infinispan Configurations + - `quarkus.infinispan.client.hosts` - the infinispan url used by the Kogito application; can be internal service url - `quarkus.infinispan.client.username` - the user used by the Kogito application to access the infinispan service + ### Kafka Configurations + - `kafka.bootstrap.servers` - the kafka url used by the Kogito application; can be internal service url + ### Kogito Dataindex Configurations + - `kogito.dataindex.props` - command line properties for the data index - `kogito.dataindex.httpurl` - the dataindex url, protocol: http - `kogito.dataindex.httpurl.with.graphql` - the dataindex graphql url - `kogito.dataindex.wsurl` - the dataindex url, protocol: ws + ### Kogito Management Console Configurations + - `kogito.managementconsole.props` - command line properties for the management console + ### Kogito Task Console Configurations + - `kogito.taskconsole.props` - command line properties for the task console + ### Kogito Job Service Configurations + - `kogito.jobsservice.props` - command line properties for the job service ## Constraints -- Developer Sandbox does not allow to install additional operators - (https://www.youtube.com/watch?v=oDqw8aBGDD8 from 18.02.2021 - time: 9:09) + +- Developer Sandbox does not allow to install additional operators - (https://www.youtube.com/watch?v=oDqw8aBGDD8 from + 18.02.2021 - time: 9:09) => cannot use Kogito Operator install -- Developer Sandbox sets [resource quotas](https://github.com/codeready-toolchain/host-operator/blob/master/deploy/templates/nstemplatetiers/base/cluster.yaml) per user name +- Developer Sandbox + sets [resource quotas](https://github.com/codeready-toolchain/host-operator/blob/master/deploy/templates/nstemplatetiers/base/cluster.yaml) + per user name ### Memory and cpu requests and limits + if marked `-` then namespace defaults are applied -|deployment|request cpu|request mem|limit cpu|limit mem| -|---|---|---|---|---| -|**namespace default per deployment/statefulSet**|10m|64Mi|1|750Mi| -|keycloak|-|-|-|-| -|kogito-data-index-infinispan|-|-|-|500Mi| -|kogito-management-console|-|-|-|500Mi| -|kogito-task-console|-|-|-|500Mi| -|kogito-jobs-service|-|-|-|500Mi| -|kogito-travel-agency-travels-jvm|-|-|-|500Mi| -|kogito-travel-agency-visas-jvm|-|-|-|500Mi| -|infinispan|500m|512Mi|500m|512Mi| -|kafka|-|-|-|-| -|kafka-zookeeper|250m|256Mi|-|-| -|**sum**|-|-|-|6512Mi| -|**sandbox max. aggregate values per user name (both namespaces)**|1750m|7Gi|20000m|7Gi| +| deployment | request cpu | request mem | limit cpu | limit mem | +|-------------------------------------------------------------------|-------------|-------------|-----------|-----------| +| **namespace default per deployment/statefulSet** | 10m | 64Mi | 1 | 750Mi | +| keycloak | - | - | - | - | +| kogito-data-index-infinispan | - | - | - | 500Mi | +| kogito-management-console | - | - | - | 500Mi | +| kogito-task-console | - | - | - | 500Mi | +| kogito-jobs-service | - | - | - | 500Mi | +| kogito-travel-agency-travels-jvm | - | - | - | 500Mi | +| kogito-travel-agency-visas-jvm | - | - | - | 500Mi | +| infinispan | 500m | 512Mi | 500m | 512Mi | +| kafka | - | - | - | - | +| kafka-zookeeper | 250m | 256Mi | - | - | +| **sum** | - | - | - | 6512Mi | +| **sandbox max. aggregate values per user name (both namespaces)** | 1750m | 7Gi | 20000m | 7Gi | diff --git a/kogito-quarkus-examples/ocp-tryout/applicationImage.md b/kogito-quarkus-examples/ocp-tryout/applicationImage.md index 89e8e0c79c..58782bae68 100644 --- a/kogito-quarkus-examples/ocp-tryout/applicationImage.md +++ b/kogito-quarkus-examples/ocp-tryout/applicationImage.md @@ -1,7 +1,11 @@ ## Prepare Kogito application image -The Tryout process installs a container image, which must be accessible from an image repository. If such an image exists, this step can be skipped. -Below steps show the process of building and uploading an image using the example of the [extended Kogito Travel Agency](https://github.com/kiegroup/kogito-examples/tree/stable/kogito-quarkus-examples/kogito-travel-agency/extended/travels/) application: +The Tryout process installs a container image, which must be accessible from an image repository. If such an image +exists, this step can be skipped. +Below steps show the process of building and uploading an image using the example of +the [extended Kogito Travel Agency](https://github.com/kiegroup/kogito-examples/tree/stable/kogito-quarkus-examples/kogito-travel-agency/extended/travels/) +application: + - cd into `kogito-examples/kogito-quarkus-examples/kogito-travel-agency/extended/travels` - build the application: `mvn clean package` - build the image: `docker build -f src/main/docker/Dockerfile.jvm -t quarkus/kogito-travel-agency-travels-jvm .` diff --git a/kogito-quarkus-examples/ocp-tryout/installer.properties b/kogito-quarkus-examples/ocp-tryout/installer.properties index 378f1904e8..198565525f 100644 --- a/kogito-quarkus-examples/ocp-tryout/installer.properties +++ b/kogito-quarkus-examples/ocp-tryout/installer.properties @@ -2,7 +2,6 @@ KOGITO_VERSION=latest DRY_RUN=N # the project under which to install the tryout OCP_PROJECT= - # Services and Infrastructure to install - if to install all components, set INSTALL_ALL=Y, # otherwise leave INSTALL_ALL empty or set to N and set each component entry to Y for installation # or to N or leave empty, if does not need to be installed diff --git a/kogito-quarkus-examples/ocp-tryout/kogito-shared/README.md b/kogito-quarkus-examples/ocp-tryout/kogito-shared/README.md index 736c0c368b..5e308f8f88 100644 --- a/kogito-quarkus-examples/ocp-tryout/kogito-shared/README.md +++ b/kogito-quarkus-examples/ocp-tryout/kogito-shared/README.md @@ -6,24 +6,39 @@ any of the available infrastructure applications and services. There is one config map per infrastructure component. ### Config Map per infrastructure + #### Keycloak Config + - `keycloak.admin.user` - the username used to connect to Keycloak administration console - `keycloak.admin.password` - the administration consoles' users' password -- `keycloak.realm.json` - Keycloak initialization file for the Kogito realm creating clients, users, etc. used in Kogito examples +- `keycloak.realm.json` - Keycloak initialization file for the Kogito realm creating clients, users, etc. used in Kogito + examples - `keycloak.db.vendor` - Keycloak persistence + #### Infinispan Config + - `quarkus.infinispan.client.hosts` - the infinispan url used by the Kogito application; can be internal service url - `quarkus.infinispan.client.username` - the user used by the Kogito application to access the infinispan service + #### Kafka Config + - `kafka.bootstrap.servers` - the kafka url used by the Kogito application; can be internal service url + #### Kogito Dataindex Config + - `kogito.dataindex.props` - command line properties for the data index - `kogito.dataindex.httpurl` - the dataindex url, protocol: http - `kogito.dataindex.httpurl.with.graphql` - the dataindex graphql url - `kogito.dataindex.wsurl` - the dataindex url, protocol: ws + #### Kogito Management Console Config + - `kogito.managementconsole.props` - command line properties for the management console + #### Kogito Task Console Config + - `kogito.taskconsole.props` - command line properties for the task console + #### Kogito Job Service Config + - `kogito.jobsservice.props` - command line properties for the job service \ No newline at end of file diff --git a/kogito-quarkus-examples/ocp-tryout/kogito-shared/kogito-configs.yaml b/kogito-quarkus-examples/ocp-tryout/kogito-shared/kogito-configs.yaml index 3b3d63a3c1..1fb429a695 100644 --- a/kogito-quarkus-examples/ocp-tryout/kogito-shared/kogito-configs.yaml +++ b/kogito-quarkus-examples/ocp-tryout/kogito-shared/kogito-configs.yaml @@ -3,19 +3,19 @@ kind: ConfigMap metadata: name: kogito-configs data: - general.namespace: "${project_name}" - general.appsclusterhost: "${apps_cluster_host}" - keycloak.admin.user: 'admin' - keycloak.admin.password: 'admin' - keycloak.realm.json: '/tmp/kogito-realm.json' - keycloak.db.vendor: 'h2' - quarkus.infinispan.client.username: 'developer' - quarkus.infinispan.client.hosts: 'infinispan.${project_name}.svc.cluster.local:11222' - kafka.bootstrap.servers: 'kafka.${project_name}.svc.cluster.local:9092' - kogito.dataindex.props: '-Dkogito.protobuf.folder=/home/kogito/data/protobufs' - kogito.dataindex.httpurl: 'http://kogito-data-index-infinispan-${project_name}.${apps_cluster_host}' - kogito.dataindex.httpurl.with.graphql: 'http://kogito-data-index-infinispan-${project_name}.${apps_cluster_host}/graphql' - kogito.dataindex.wsurl: 'ws://kogito-data-index-infinispan-${project_name}.${apps_cluster_host}' - kogito.managementconsole.props: '-Dkogito.svg.folder.path=/home/kogito/data/svg -Dkogito.consoles.keycloak.config.url=http://keycloak-${project_name}.${apps_cluster_host}/auth/ -Dkogito.consoles.keycloak.config.health-check-url=http://keycloak-${project_name}.${apps_cluster_host}/auth/realms/kogito/.well-known/openid-configuration' - kogito.taskconsole.props: '-Dkogito.test.user-system.enabled=true -Dkogito.consoles.keycloak.config.url=http://keycloak-${project_name}.${apps_cluster_host}/auth/ -Dkogito.consoles.keycloak.config.health-check-url=http://keycloak-${project_name}.${apps_cluster_host}/auth/realms/kogito/.well-known/openid-configuration' - kogito.jobsservice.props: '-Dquarkus-profile=events-support -D%events-support.kafka.bootstrap.servers=kafka.${project_name}.svc.cluster.local:9092 -D%events-support.mp.messaging.outgoing.kogito-job-service-job-status-events.bootstrap.servers=kafka.${project_name}.svc.cluster.local:9092' \ No newline at end of file + general.namespace: "${project_name}" + general.appsclusterhost: "${apps_cluster_host}" + keycloak.admin.user: 'admin' + keycloak.admin.password: 'admin' + keycloak.realm.json: '/tmp/kogito-realm.json' + keycloak.db.vendor: 'h2' + quarkus.infinispan.client.username: 'developer' + quarkus.infinispan.client.hosts: 'infinispan.${project_name}.svc.cluster.local:11222' + kafka.bootstrap.servers: 'kafka.${project_name}.svc.cluster.local:9092' + kogito.dataindex.props: '-Dkogito.protobuf.folder=/home/kogito/data/protobufs' + kogito.dataindex.httpurl: 'http://kogito-data-index-infinispan-${project_name}.${apps_cluster_host}' + kogito.dataindex.httpurl.with.graphql: 'http://kogito-data-index-infinispan-${project_name}.${apps_cluster_host}/graphql' + kogito.dataindex.wsurl: 'ws://kogito-data-index-infinispan-${project_name}.${apps_cluster_host}' + kogito.managementconsole.props: '-Dkogito.svg.folder.path=/home/kogito/data/svg -Dkogito.consoles.keycloak.config.url=http://keycloak-${project_name}.${apps_cluster_host}/auth/ -Dkogito.consoles.keycloak.config.health-check-url=http://keycloak-${project_name}.${apps_cluster_host}/auth/realms/kogito/.well-known/openid-configuration' + kogito.taskconsole.props: '-Dkogito.test.user-system.enabled=true -Dkogito.consoles.keycloak.config.url=http://keycloak-${project_name}.${apps_cluster_host}/auth/ -Dkogito.consoles.keycloak.config.health-check-url=http://keycloak-${project_name}.${apps_cluster_host}/auth/realms/kogito/.well-known/openid-configuration' + kogito.jobsservice.props: '-Dquarkus-profile=events-support -D%events-support.kafka.bootstrap.servers=kafka.${project_name}.svc.cluster.local:9092 -D%events-support.mp.messaging.outgoing.kogito-job-service-job-status-events.bootstrap.servers=kafka.${project_name}.svc.cluster.local:9092' \ No newline at end of file diff --git a/kogito-quarkus-examples/ocp-tryout/testapp/example/protobuf/travels.proto b/kogito-quarkus-examples/ocp-tryout/testapp/example/protobuf/travels.proto index 115f72dc46..b7b35afc6e 100644 --- a/kogito-quarkus-examples/ocp-tryout/testapp/example/protobuf/travels.proto +++ b/kogito-quarkus-examples/ocp-tryout/testapp/example/protobuf/travels.proto @@ -1,118 +1,118 @@ -syntax = "proto2"; -package org.acme.travels.travels; +syntax = "proto2"; +package org.acme.travels.travels; import "kogito-index.proto"; import "kogito-types.proto"; option kogito_model = "Travels"; option kogito_id = "travels"; -/* @Indexed */ -message Address { - option java_package = "org.acme.travels"; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string city = 1; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string country = 2; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string street = 3; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string zipCode = 4; +/* @Indexed */ +message Address { + option java_package = "org.acme.travels"; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string city = 1; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string country = 2; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string street = 3; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string zipCode = 4; } -/* @Indexed */ -message Flight { - option java_package = "org.acme.travels"; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional kogito.Date arrival = 1; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional kogito.Date departure = 2; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string flightNumber = 3; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string gate = 4; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string seat = 5; +/* @Indexed */ +message Flight { + option java_package = "org.acme.travels"; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional kogito.Date arrival = 1; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional kogito.Date departure = 2; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string flightNumber = 3; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string gate = 4; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string seat = 5; } -/* @Indexed */ -message Hotel { - option java_package = "org.acme.travels"; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional Address address = 1; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string bookingNumber = 2; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string name = 3; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string phone = 4; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string room = 5; +/* @Indexed */ +message Hotel { + option java_package = "org.acme.travels"; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional Address address = 1; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string bookingNumber = 2; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string name = 3; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string phone = 4; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string room = 5; } -/* @Indexed */ -message Traveller { - option java_package = "org.acme.travels"; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional Address address = 1; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string email = 2; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string firstName = 3; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string lastName = 4; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string nationality = 5; +/* @Indexed */ +message Traveller { + option java_package = "org.acme.travels"; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional Address address = 1; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string email = 2; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string firstName = 3; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string lastName = 4; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string nationality = 5; } -/* @Indexed */ -message Travels { - option java_package = "org.acme.travels"; - /* @Field(index = Index.NO, store = Store.YES) @SortableField - @VariableInfo(tags="output") */ - optional Flight flight = 1; - /* @Field(index = Index.NO, store = Store.YES) @SortableField - @VariableInfo(tags="output") */ - optional Hotel hotel = 2; - /* @Field(index = Index.YES, store = Store.YES) @SortableField */ - optional string id = 3; - /* @Field(index = Index.NO, store = Store.YES) @SortableField - @VariableInfo(tags="") */ - optional Traveller traveller = 4; - /* @Field(index = Index.NO, store = Store.YES) @SortableField - @VariableInfo(tags="") */ - optional Trip trip = 5; - /* @Field(index = Index.NO, store = Store.YES) @SortableField - @VariableInfo(tags="output,tracked") */ - optional VisaApplication visaApplication = 6; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional org.kie.kogito.index.model.KogitoMetadata metadata = 7; +/* @Indexed */ +message Travels { + option java_package = "org.acme.travels"; + /* @Field(index = Index.NO, store = Store.YES) @SortableField + @VariableInfo(tags="output") */ + optional Flight flight = 1; + /* @Field(index = Index.NO, store = Store.YES) @SortableField + @VariableInfo(tags="output") */ + optional Hotel hotel = 2; + /* @Field(index = Index.YES, store = Store.YES) @SortableField */ + optional string id = 3; + /* @Field(index = Index.NO, store = Store.YES) @SortableField + @VariableInfo(tags="") */ + optional Traveller traveller = 4; + /* @Field(index = Index.NO, store = Store.YES) @SortableField + @VariableInfo(tags="") */ + optional Trip trip = 5; + /* @Field(index = Index.NO, store = Store.YES) @SortableField + @VariableInfo(tags="output,tracked") */ + optional VisaApplication visaApplication = 6; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional org.kie.kogito.index.model.KogitoMetadata metadata = 7; } -/* @Indexed */ -message Trip { - option java_package = "org.acme.travels"; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional kogito.Date begin = 1; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string city = 2; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string country = 3; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional kogito.Date end = 4; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional bool visaRequired = 5; +/* @Indexed */ +message Trip { + option java_package = "org.acme.travels"; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional kogito.Date begin = 1; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string city = 2; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string country = 3; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional kogito.Date end = 4; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional bool visaRequired = 5; } -/* @Indexed */ -message VisaApplication { - option java_package = "org.acme.travels"; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional bool approved = 1; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string city = 2; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string country = 3; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional int32 duration = 4; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string firstName = 5; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string lastName = 6; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string nationality = 7; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string passportNumber = 8; +/* @Indexed */ +message VisaApplication { + option java_package = "org.acme.travels"; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional bool approved = 1; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string city = 2; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string country = 3; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional int32 duration = 4; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string firstName = 5; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string lastName = 6; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string nationality = 7; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string passportNumber = 8; } diff --git a/kogito-quarkus-examples/ocp-tryout/testapp/example/protobuf/visaApplications.proto b/kogito-quarkus-examples/ocp-tryout/testapp/example/protobuf/visaApplications.proto index 32f92e35d4..f646bbab9a 100644 --- a/kogito-quarkus-examples/ocp-tryout/testapp/example/protobuf/visaApplications.proto +++ b/kogito-quarkus-examples/ocp-tryout/testapp/example/protobuf/visaApplications.proto @@ -1,38 +1,38 @@ -syntax = "proto2"; -package org.acme.travels.visaApplications; +syntax = "proto2"; +package org.acme.travels.visaApplications; import "kogito-index.proto"; import "kogito-types.proto"; option kogito_model = "VisaApplications"; option kogito_id = "visaApplications"; -/* @Indexed */ -message VisaApplication { - option java_package = "org.acme.travels"; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional bool approved = 1; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string city = 2; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string country = 3; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional int32 duration = 4; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string firstName = 5; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string lastName = 6; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string nationality = 7; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional string passportNumber = 8; +/* @Indexed */ +message VisaApplication { + option java_package = "org.acme.travels"; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional bool approved = 1; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string city = 2; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string country = 3; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional int32 duration = 4; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string firstName = 5; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string lastName = 6; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string nationality = 7; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional string passportNumber = 8; } -/* @Indexed */ -message VisaApplications { - option java_package = "org.acme.travels"; - /* @Field(index = Index.YES, store = Store.YES) @SortableField */ - optional string id = 1; - /* @Field(index = Index.NO, store = Store.YES) @SortableField - @VariableInfo(tags="") */ - optional VisaApplication visaApplication = 2; - /* @Field(index = Index.NO, store = Store.YES) @SortableField */ - optional org.kie.kogito.index.model.KogitoMetadata metadata = 3; +/* @Indexed */ +message VisaApplications { + option java_package = "org.acme.travels"; + /* @Field(index = Index.YES, store = Store.YES) @SortableField */ + optional string id = 1; + /* @Field(index = Index.NO, store = Store.YES) @SortableField + @VariableInfo(tags="") */ + optional VisaApplication visaApplication = 2; + /* @Field(index = Index.NO, store = Store.YES) @SortableField */ + optional org.kie.kogito.index.model.KogitoMetadata metadata = 3; } diff --git a/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/flightBooking.svg b/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/flightBooking.svg index adb9ad15e8..d13e04aa76 100644 --- a/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/flightBooking.svg +++ b/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/flightBooking.svg @@ -1 +1,139 @@ -Flight BookedBook flight StartProcess \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Flight Booked + + + + + + + + + + + + + + + + + + + + + + + + + + + + Book + + flight + + + + + + + + + + + + + + + + + + + + + StartProcess + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/hotelBooking.svg b/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/hotelBooking.svg index 358a115213..b9d64892c0 100644 --- a/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/hotelBooking.svg +++ b/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/hotelBooking.svg @@ -1 +1,139 @@ -Hotel BookedBook hotel StartProcess \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Hotel Booked + + + + + + + + + + + + + + + + + + + + + + + + + + + + Book + + hotel + + + + + + + + + + + + + + + + + + + + + StartProcess + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/travels.svg b/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/travels.svg index a9960d7212..e2320da059 100644 --- a/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/travels.svg +++ b/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/travels.svg @@ -1 +1,961 @@ -Book HotelStartProcessis visa requiredwait for visa decisionTravel ConfirmedVisa RejectedBook Flight Email rejection notice Confirm travel Apply for visa Visa checkvisasapprovedvisasrejectedBookSend visa applicationno need for visa visa required \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Book Hotel + + + + + + + + + + + + + + + + + + + + + StartProcess + + + + + + + + + + + + + + + + + + + + + + + + + + + + is visa required + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + wait for visa decision + + + + + + + + + + + + + + + + + + + + + Travel Confirmed + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visa Rejected + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Book Flight + + + + + + + + + + + + + + + + + + + + + + + + + + + + Email + + rejection + + notice + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Confirm + + travel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Apply + + for visa + + + + + + + + + + + + + + + + + + + + + + Visa + + check + + + + + + + + + + + + + + + + + + + + + + + + + + + + visasapproved + + + + + + + + + + + + + + + + + + + + + + + + + + + + visasrejected + + + + + + + + + + + + + + + + + + + + + + + + + + + + Book + + + + + + + + + + + + + + + + + + + + + + + + + + + + Send visa application + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + no need for visa + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + visa + + required + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/visaApplications.svg b/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/visaApplications.svg index dd89ded115..57772fce42 100644 --- a/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/visaApplications.svg +++ b/kogito-quarkus-examples/ocp-tryout/testapp/example/svg/visaApplications.svg @@ -1 +1,422 @@ -Visa rejectedManually approved?Manual visa approval Visa approvedVisa approved?Automatic visa approvals StartProcessNo Yes No Yes \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visa rejected + + + + + + + + + + + + + + + + + + + + + + + + + + + + Manually approved? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Manual visa + + approval + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visa approved + + + + + + + + + + + + + + + + + + + + + + + + + + + + Visa approved? + + + + + + + + + + + + + + + + + + + + + + Automatic visa + + approvals + + + + + + + + + + + + + + + + + + + + + + + + + + + + StartProcess + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No + + + + + + + + + + + + + + + + + + + + + + + Yes + + + + + + + + + + + + + + + + + + + + + + + No + + + + + + + + + + + + + Yes + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kogito-quarkus-examples/ocp-tryout/tryout-kogito-app/templates/tests/test-connection.yaml b/kogito-quarkus-examples/ocp-tryout/tryout-kogito-app/templates/tests/test-connection.yaml index 607251bef9..1692fa1911 100644 --- a/kogito-quarkus-examples/ocp-tryout/tryout-kogito-app/templates/tests/test-connection.yaml +++ b/kogito-quarkus-examples/ocp-tryout/tryout-kogito-app/templates/tests/test-connection.yaml @@ -10,6 +10,6 @@ spec: containers: - name: wget image: busybox - command: ['wget'] - args: ['{{ include "tryout-kogito-app.fullname" . }}:{{ .Values.service.port }}'] + command: [ 'wget' ] + args: [ '{{ include "tryout-kogito-app.fullname" . }}:{{ .Values.service.port }}' ] restartPolicy: Never diff --git a/kogito-quarkus-examples/ocp-tryout/tryout-kogito-app/values.yaml b/kogito-quarkus-examples/ocp-tryout/tryout-kogito-app/values.yaml index 68a12e585c..3d6fcf8c34 100644 --- a/kogito-quarkus-examples/ocp-tryout/tryout-kogito-app/values.yaml +++ b/kogito-quarkus-examples/ocp-tryout/tryout-kogito-app/values.yaml @@ -10,7 +10,7 @@ image: # Overrides the image tag whose default is the chart appVersion. tag: "" -imagePullSecrets: [] +imagePullSecrets: [ ] nameOverride: "" fullnameOverride: "" @@ -18,23 +18,23 @@ serviceAccount: # Specifies whether a service account should be created create: true # Annotations to add to the service account - annotations: {} + annotations: { } # The name of the service account to use. # If not set and create is true, a name is generated using the fullname template name: "" -podAnnotations: {} +podAnnotations: { } -podSecurityContext: {} - # fsGroup: 2000 +podSecurityContext: { } +# fsGroup: 2000 -securityContext: {} +securityContext: { } # capabilities: # drop: # - ALL # readOnlyRootFilesystem: true # runAsNonRoot: true - # runAsUser: 1000 +# runAsUser: 1000 service: type: ClusterIP @@ -44,15 +44,15 @@ service: ingress: enabled: false className: "" - annotations: {} + annotations: { } # kubernetes.io/ingress.class: nginx - # kubernetes.io/tls-acme: "true" + # kubernetes.io/tls-acme: "true" hosts: - host: chart-example.local paths: - path: / pathType: ImplementationSpecific - tls: [] + tls: [ ] # - secretName: chart-example-tls # hosts: # - chart-example.local @@ -76,15 +76,15 @@ autoscaling: targetCPUUtilizationPercentage: 80 # targetMemoryUtilizationPercentage: 80 -nodeSelector: {} +nodeSelector: { } -tolerations: [] +tolerations: [ ] -affinity: {} +affinity: { } route: enabled: true - annotations: {} + annotations: { } applicationPort: 8080 diff --git a/kogito-quarkus-examples/onboarding-example/hr/README.md b/kogito-quarkus-examples/onboarding-example/hr/README.md index 0717963e15..ed8904f575 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/README.md +++ b/kogito-quarkus-examples/onboarding-example/hr/README.md @@ -137,7 +137,8 @@ $ mvn clean install -Pminikube # For Kubernetes or Knative just change the given profile to the respective platform (lower case). ``` -> NOTE: If you're targeting a Kubernetes or OpenShift cluster, consider the resources created on `target/kubernetes` directory. +> NOTE: If you're targeting a Kubernetes or OpenShift cluster, consider the resources created on `target/kubernetes` +> directory. Please see the official [Quarkus Guide](https://quarkus.io/guides/deploying-to-kubernetes) for more information. diff --git a/kogito-quarkus-examples/onboarding-example/hr/pom.xml b/kogito-quarkus-examples/onboarding-example/hr/pom.xml index e3d2c3b14a..13bd575a4e 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/pom.xml +++ b/kogito-quarkus-examples/onboarding-example/hr/pom.xml @@ -1,15 +1,56 @@ - 4.0.0 - - org.kie.kogito.examples - onboarding-example - 2.0.0-SNAPSHOT - + hr + org.acme.examples + 2.0.0-SNAPSHOT Kogito Example :: Onboarding Example :: HR with Drools + HR related rules for onboarding + + + 2.16.10.Final + quarkus-bom + io.quarkus + 2.16.10.Final + org.kie.kogito + kogito-bom + 2.0.0-SNAPSHOT + 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + + + + + + ${quarkus.platform.group-id} + ${quarkus.platform.artifact-id} + ${quarkus.platform.version} + pom + import + + + ${kogito.bom.group-id} + ${kogito.bom.artifact-id} + ${kogito.bom.version} + pom + import + + + + org.kie.kogito @@ -59,6 +100,7 @@ quarkus-smallrye-health + ${project.artifactId} @@ -77,9 +119,46 @@ false + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + default + + true + + + + native + + + native + + + minikube @@ -101,5 +180,23 @@ knative + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/Address.java b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/Address.java similarity index 94% rename from kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/Address.java rename to kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/Address.java index 94a7ba8b44..db39c78887 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/Address.java +++ b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/Address.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.hr; +package org.acme.examples.hr; /** * This class was automatically generated by the data modeler tool. @@ -64,7 +64,7 @@ public void setCountry(java.lang.String country) { } public Address(java.lang.String street, java.lang.String city, - java.lang.String zipCode, java.lang.String country) { + java.lang.String zipCode, java.lang.String country) { this.street = street; this.city = city; this.zipCode = zipCode; diff --git a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/Department.java b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/Department.java similarity index 96% rename from kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/Department.java rename to kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/Department.java index 6a81ab81b8..8c6a220493 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/Department.java +++ b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/Department.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.hr; +package org.acme.examples.hr; import org.drools.ruleunits.api.DataSource; import org.drools.ruleunits.api.RuleUnitData; diff --git a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/DepartmentModel.java b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/DepartmentModel.java similarity index 83% rename from kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/DepartmentModel.java rename to kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/DepartmentModel.java index 01d41385c6..cac635d8c2 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/DepartmentModel.java +++ b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/DepartmentModel.java @@ -13,17 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.hr; +package org.acme.examples.hr; public class DepartmentModel { - private org.kie.kogito.examples.hr.Employee employee; + private Employee employee; - public org.kie.kogito.examples.hr.Employee getEmployee() { + public Employee getEmployee() { return employee; } - public void setEmployee(org.kie.kogito.examples.hr.Employee employee) { + public void setEmployee(Employee employee) { this.employee = employee; } diff --git a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/Employee.java b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/Employee.java similarity index 87% rename from kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/Employee.java rename to kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/Employee.java index 14c0638513..71a9408ae9 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/Employee.java +++ b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/Employee.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.hr; +package org.acme.examples.hr; public class Employee implements java.io.Serializable { @@ -24,7 +24,7 @@ public class Employee implements java.io.Serializable { private java.lang.String personalId; private java.util.Date birthDate; - private org.kie.kogito.examples.hr.Address address; + private Address address; public Employee() { } @@ -61,11 +61,11 @@ public void setBirthDate(java.util.Date birthDate) { this.birthDate = birthDate; } - public org.kie.kogito.examples.hr.Address getAddress() { + public Address getAddress() { return this.address; } - public void setAddress(org.kie.kogito.examples.hr.Address address) { + public void setAddress(Address address) { this.address = address; } @@ -90,8 +90,8 @@ public void setDepartment(java.lang.String department) { } public Employee(java.lang.String firstName, java.lang.String lastName, - java.lang.String personalId, java.util.Date birthDate, - org.kie.kogito.examples.hr.Address address) { + java.lang.String personalId, java.util.Date birthDate, + Address address) { this.firstName = firstName; this.lastName = lastName; this.personalId = personalId; diff --git a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/EmployeeRepository.java b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/EmployeeRepository.java similarity index 97% rename from kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/EmployeeRepository.java rename to kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/EmployeeRepository.java index 40c3c4ce67..1782cc3dc4 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/EmployeeRepository.java +++ b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/EmployeeRepository.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.hr; +package org.acme.examples.hr; import java.util.HashSet; import java.util.Set; diff --git a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/EmployeeValidation.java b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/EmployeeValidation.java similarity index 97% rename from kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/EmployeeValidation.java rename to kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/EmployeeValidation.java index 716517e158..1342194b9f 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/EmployeeValidation.java +++ b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/EmployeeValidation.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.hr; +package org.acme.examples.hr; import org.drools.ruleunits.api.DataSource; import org.drools.ruleunits.api.RuleUnitData; diff --git a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/EmployeeValidationModel.java b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/EmployeeValidationModel.java similarity index 85% rename from kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/EmployeeValidationModel.java rename to kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/EmployeeValidationModel.java index d0fc58b177..718e2b6ea7 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/EmployeeValidationModel.java +++ b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/EmployeeValidationModel.java @@ -13,17 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.hr; +package org.acme.examples.hr; public class EmployeeValidationModel { - private org.kie.kogito.examples.hr.Employee employee; + private Employee employee; - public org.kie.kogito.examples.hr.Employee getEmployee() { + public Employee getEmployee() { return employee; } - public void setEmployee(org.kie.kogito.examples.hr.Employee employee) { + public void setEmployee(Employee employee) { this.employee = employee; } diff --git a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/IdModel.java b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/IdModel.java similarity index 83% rename from kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/IdModel.java rename to kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/IdModel.java index cb356501d5..f4335b6a7d 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/IdModel.java +++ b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/IdModel.java @@ -13,17 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.hr; +package org.acme.examples.hr; public class IdModel { - private org.kie.kogito.examples.hr.Employee employee; + private Employee employee; - public org.kie.kogito.examples.hr.Employee getEmployee() { + public Employee getEmployee() { return employee; } - public void setEmployee(org.kie.kogito.examples.hr.Employee employee) { + public void setEmployee(Employee employee) { this.employee = employee; } diff --git a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/IdResource.java b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/IdResource.java similarity index 96% rename from kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/IdResource.java rename to kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/IdResource.java index b34a44c828..0e602288ff 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/kie/kogito/examples/hr/IdResource.java +++ b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/IdResource.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.hr; +package org.acme.examples.hr; import javax.ws.rs.Consumes; import javax.ws.rs.POST; diff --git a/kogito-quarkus-examples/onboarding-example/hr/src/main/resources/application.properties b/kogito-quarkus-examples/onboarding-example/hr/src/main/resources/application.properties index 29a61e6272..6d934c4c45 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/main/resources/application.properties +++ b/kogito-quarkus-examples/onboarding-example/hr/src/main/resources/application.properties @@ -3,7 +3,6 @@ # Packaging # quarkus.package.type=fast-jar quarkus.http.port=8081 - # Kubernetes related properties %minikube.quarkus.kubernetes.deployment-target=minikube %kubernetes.quarkus.kubernetes.deployment-target=kubernetes @@ -13,7 +12,6 @@ quarkus.container-image.tag=latest quarkus.kubernetes.labels.department/first=process quarkus.kubernetes.labels.id=process quarkus.kubernetes.labels.employee-validation/first=process - %knative.quarkus.kubernetes.deployment-target=kubernetes %knative.quarkus.knative.labels.department/first=process %knative.quarkus.knative.labels.id=process diff --git a/kogito-quarkus-examples/onboarding-example/hr/src/main/resources/org/kie/kogito/examples/hr/department.drl b/kogito-quarkus-examples/onboarding-example/hr/src/main/resources/org/acme/examples/hr/department.drl similarity index 97% rename from kogito-quarkus-examples/onboarding-example/hr/src/main/resources/org/kie/kogito/examples/hr/department.drl rename to kogito-quarkus-examples/onboarding-example/hr/src/main/resources/org/acme/examples/hr/department.drl index 486b1b9d24..6370350dd8 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/main/resources/org/kie/kogito/examples/hr/department.drl +++ b/kogito-quarkus-examples/onboarding-example/hr/src/main/resources/org/acme/examples/hr/department.drl @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.hr +package org.acme.examples.hr unit Department; query department diff --git a/kogito-quarkus-examples/onboarding-example/hr/src/main/resources/org/kie/kogito/examples/hr/employeeValidation.drl b/kogito-quarkus-examples/onboarding-example/hr/src/main/resources/org/acme/examples/hr/employeeValidation.drl similarity index 97% rename from kogito-quarkus-examples/onboarding-example/hr/src/main/resources/org/kie/kogito/examples/hr/employeeValidation.drl rename to kogito-quarkus-examples/onboarding-example/hr/src/main/resources/org/acme/examples/hr/employeeValidation.drl index 3c13c020be..82d5e60fec 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/main/resources/org/kie/kogito/examples/hr/employeeValidation.drl +++ b/kogito-quarkus-examples/onboarding-example/hr/src/main/resources/org/acme/examples/hr/employeeValidation.drl @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.hr; +package org.acme.examples.hr; unit EmployeeValidation; query employeeValidation diff --git a/kogito-quarkus-examples/onboarding-example/hr/src/test/java/org/kie/kogito/examples/hr/DepartmentTest.java b/kogito-quarkus-examples/onboarding-example/hr/src/test/java/org/acme/examples/hr/DepartmentTest.java similarity index 97% rename from kogito-quarkus-examples/onboarding-example/hr/src/test/java/org/kie/kogito/examples/hr/DepartmentTest.java rename to kogito-quarkus-examples/onboarding-example/hr/src/test/java/org/acme/examples/hr/DepartmentTest.java index 573df95423..4feb74ea8e 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/test/java/org/kie/kogito/examples/hr/DepartmentTest.java +++ b/kogito-quarkus-examples/onboarding-example/hr/src/test/java/org/acme/examples/hr/DepartmentTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.hr; +package org.acme.examples.hr; import org.junit.jupiter.api.Test; diff --git a/kogito-quarkus-examples/onboarding-example/hr/src/test/java/org/kie/kogito/examples/hr/EmployeeValidationTest.java b/kogito-quarkus-examples/onboarding-example/hr/src/test/java/org/acme/examples/hr/EmployeeValidationTest.java similarity index 97% rename from kogito-quarkus-examples/onboarding-example/hr/src/test/java/org/kie/kogito/examples/hr/EmployeeValidationTest.java rename to kogito-quarkus-examples/onboarding-example/hr/src/test/java/org/acme/examples/hr/EmployeeValidationTest.java index ad779ba07b..ca25f39f2b 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/test/java/org/kie/kogito/examples/hr/EmployeeValidationTest.java +++ b/kogito-quarkus-examples/onboarding-example/hr/src/test/java/org/acme/examples/hr/EmployeeValidationTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.hr; +package org.acme.examples.hr; import org.junit.jupiter.api.Test; diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/README.md b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/README.md index 6d91a79e2b..aefbee3c55 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/README.md +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/README.md @@ -106,7 +106,8 @@ $ mvn clean install -Pminikube # For Kubernetes or Knative just change the given profile to the respective platform (lower case). ``` -> NOTE: If you're targeting a Kubernetes or OpenShift cluster, consider the resources created on `target/kubernetes` directory. +> NOTE: If you're targeting a Kubernetes or OpenShift cluster, consider the resources created on `target/kubernetes` +> directory. Please see the official [Quarkus Guide](https://quarkus.io/guides/deploying-to-kubernetes) for more information. diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/pom.xml b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/pom.xml index 18712bc1c0..d295fabe5f 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/pom.xml +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/pom.xml @@ -1,16 +1,56 @@ - 4.0.0 - - org.kie.kogito.examples - onboarding-example - 2.0.0-SNAPSHOT - + onboarding-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Onboarding Example :: Onboarding with Business Process Quarkus Onboarding function and service orchestration - + + + 2.16.10.Final + quarkus-bom + io.quarkus + 2.16.10.Final + org.kie.kogito + kogito-bom + 2.0.0-SNAPSHOT + 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + + + + + + ${quarkus.platform.group-id} + ${quarkus.platform.artifact-id} + ${quarkus.platform.version} + pom + import + + + ${kogito.bom.group-id} + ${kogito.bom.artifact-id} + ${kogito.bom.version} + pom + import + + + + org.kie.kogito @@ -77,6 +117,7 @@ quarkus-smallrye-health + ${project.artifactId} @@ -96,9 +137,46 @@ -Dlocal=true + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + default + + true + + + + native + + + native + + + persistence @@ -137,5 +215,22 @@ knative + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/BaseWorkItemHandlerConfig.java b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/BaseWorkItemHandlerConfig.java similarity index 97% rename from kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/BaseWorkItemHandlerConfig.java rename to kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/BaseWorkItemHandlerConfig.java index cf8e63d123..58950f438c 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/BaseWorkItemHandlerConfig.java +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/BaseWorkItemHandlerConfig.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; import java.util.ArrayList; import java.util.Arrays; @@ -25,12 +25,12 @@ import javax.annotation.PostConstruct; import javax.inject.Inject; +import org.acme.examples.onboarding.DecisionTaskWorkItemHandler; import org.eclipse.microprofile.config.inject.ConfigProperty; import org.kie.kogito.addons.k8s.Endpoint; import org.kie.kogito.addons.k8s.EndpointQueryKey; import org.kie.kogito.addons.k8s.LocalEndpointDiscovery; import org.kie.kogito.addons.quarkus.k8s.workitems.QuarkusDiscoveredEndpointCaller; -import org.kie.kogito.examples.onboarding.DecisionTaskWorkItemHandler; import org.kie.kogito.internal.process.runtime.KogitoWorkItemHandler; import org.kie.kogito.process.impl.DefaultWorkItemHandlerConfig; diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/WorkItemHandlerConfig.java b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/WorkItemHandlerConfig.java similarity index 95% rename from kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/WorkItemHandlerConfig.java rename to kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/WorkItemHandlerConfig.java index a56957ec57..94380745a5 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/WorkItemHandlerConfig.java +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/WorkItemHandlerConfig.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; import javax.enterprise.context.ApplicationScoped; diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/onboarding/Address.java b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Address.java similarity index 94% rename from kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/onboarding/Address.java rename to kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Address.java index e96eef01e6..dd4ba442ca 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/onboarding/Address.java +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Address.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.onboarding; +package org.acme.examples.onboarding; /** * This class was automatically generated by the data modeler tool. @@ -64,7 +64,7 @@ public void setCountry(java.lang.String country) { } public Address(java.lang.String street, java.lang.String city, - java.lang.String zipCode, java.lang.String country) { + java.lang.String zipCode, java.lang.String country) { this.street = street; this.city = city; this.zipCode = zipCode; diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/onboarding/DecisionTaskWorkItemHandler.java b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/DecisionTaskWorkItemHandler.java similarity index 97% rename from kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/onboarding/DecisionTaskWorkItemHandler.java rename to kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/DecisionTaskWorkItemHandler.java index 5caf31508f..b827fc80fb 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/onboarding/DecisionTaskWorkItemHandler.java +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/DecisionTaskWorkItemHandler.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.onboarding; +package org.acme.examples.onboarding; import java.util.Map; diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/onboarding/Employee.java b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Employee.java similarity index 84% rename from kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/onboarding/Employee.java rename to kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Employee.java index 8aaab4b07a..de960d4514 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/onboarding/Employee.java +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Employee.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.onboarding; +package org.acme.examples.onboarding; /** * This class was automatically generated by the data modeler tool. @@ -28,7 +28,7 @@ public class Employee implements java.io.Serializable { private java.lang.String personalId; private java.util.Date birthDate; - private org.kie.kogito.examples.onboarding.Address address; + private Address address; public Employee() { } @@ -65,17 +65,17 @@ public void setBirthDate(java.util.Date birthDate) { this.birthDate = birthDate; } - public org.kie.kogito.examples.onboarding.Address getAddress() { + public Address getAddress() { return this.address; } - public void setAddress(org.kie.kogito.examples.onboarding.Address address) { + public void setAddress(Address address) { this.address = address; } public Employee(java.lang.String firstName, java.lang.String lastName, - java.lang.String personalId, java.util.Date birthDate, - org.kie.kogito.examples.onboarding.Address address) { + java.lang.String personalId, java.util.Date birthDate, + Address address) { this.firstName = firstName; this.lastName = lastName; this.personalId = personalId; diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/onboarding/Payroll.java b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Payroll.java similarity index 95% rename from kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/onboarding/Payroll.java rename to kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Payroll.java index 9ed04c3f25..ebbb4b58e8 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/kie/kogito/examples/onboarding/Payroll.java +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Payroll.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.onboarding; +package org.acme.examples.onboarding; import com.fasterxml.jackson.annotation.JsonFormat; @@ -59,7 +59,7 @@ public void setPaymentDate(java.util.Date paymentDate) { } public Payroll(java.lang.Integer vacationDays, java.lang.Double taxRate, - java.util.Date paymentDate) { + java.util.Date paymentDate) { this.vacationDays = vacationDays; this.taxRate = taxRate; this.paymentDate = paymentDate; diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/application.properties b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/application.properties index a33273764b..f18ba6fa2d 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/application.properties +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/application.properties @@ -5,7 +5,6 @@ quarkus.http.port=8080 quarkus.infinispan-client.hosts=localhost:11222 quarkus.infinispan-client.use-auth=false - # Kubernetes related properties %minikube.quarkus.kubernetes.deployment-target=minikube %kubernetes.quarkus.kubernetes.deployment-target=kubernetes @@ -13,6 +12,5 @@ quarkus.container-image.group=kogito quarkus.container-image.name=onboarding-service quarkus.container-image.tag=latest quarkus.kubernetes.labels.onboarding=process - %knative.quarkus.kubernetes.deployment-target=kubernetes %knative.quarkus.knative.labels.onboarding=process \ No newline at end of file diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/kie/kogito/examples/onboarding/DecisionTasks.wid b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/acme/examples/onboarding/DecisionTasks.wid similarity index 100% rename from kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/kie/kogito/examples/onboarding/DecisionTasks.wid rename to kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/acme/examples/onboarding/DecisionTasks.wid diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/kie/kogito/examples/onboarding/onboarding.bpmn b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/acme/examples/onboarding/onboarding.bpmn similarity index 95% rename from kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/kie/kogito/examples/onboarding/onboarding.bpmn rename to kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/acme/examples/onboarding/onboarding.bpmn index c82b0acf00..a472a9b3ce 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/kie/kogito/examples/onboarding/onboarding.bpmn +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/acme/examples/onboarding/onboarding.bpmn @@ -1,7 +1,7 @@ - - + + @@ -13,15 +13,15 @@ - - + + - + - + @@ -32,15 +32,15 @@ - + - + - + @@ -125,9 +125,9 @@ _44ABA3C5-9A26-4843-B03B-99C2C0251707 - + - + @@ -209,7 +209,7 @@ _D5E3808E-4D68-4B8F-939D-17C7643E58FD _D32B4A20-53D1-46F3-95F6-276A2392931F - + @@ -248,7 +248,7 @@ - + @@ -314,8 +314,8 @@ _DF6979D3-AFD3-4BC8-A866-8B9214F7F0FB _BB67B9E9-611B-4B17-A6F9-3CD4DCA4B249 - - + + _9D7A4927-BFCB-4F17-A4D4-E3D03B3FBE49_employeeInputX @@ -353,7 +353,7 @@ - + diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/kie/kogito/examples/onboarding/setupHR.bpmn b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/acme/examples/onboarding/setupHR.bpmn similarity index 96% rename from kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/kie/kogito/examples/onboarding/setupHR.bpmn rename to kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/acme/examples/onboarding/setupHR.bpmn index 6197ea0873..e5ecbd9828 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/kie/kogito/examples/onboarding/setupHR.bpmn +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/acme/examples/onboarding/setupHR.bpmn @@ -1,15 +1,15 @@ - + - + - + @@ -50,7 +50,7 @@ - + diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/kie/kogito/examples/onboarding/setupPayroll.bpmn b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/acme/examples/onboarding/setupPayroll.bpmn similarity index 96% rename from kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/kie/kogito/examples/onboarding/setupPayroll.bpmn rename to kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/acme/examples/onboarding/setupPayroll.bpmn index 1b8d288b15..09f2350df7 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/kie/kogito/examples/onboarding/setupPayroll.bpmn +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/resources/org/acme/examples/onboarding/setupPayroll.bpmn @@ -1,27 +1,27 @@ - - + + - + - + - + - + @@ -96,7 +96,7 @@ - + @@ -172,7 +172,7 @@ - + @@ -243,7 +243,7 @@ - + @@ -302,7 +302,7 @@ _7B55F281-D560-4130-88C9-177C960E8682 SequenceFlow_3 - org.kie.kogito.examples.onboarding.Payroll empPayroll = new org.kie.kogito.examples.onboarding.Payroll(vacationDays, taxRate, paymentDate); + org.acme.examples.onboarding.Payroll empPayroll = new org.acme.examples.onboarding.Payroll(vacationDays, taxRate, paymentDate); kcontext.setVariable("payroll", empPayroll); diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/test/java/org/kie/kogito/examples/WorkItemHandlerConfig.java b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/test/java/org/acme/examples/WorkItemHandlerConfig.java similarity index 91% rename from kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/test/java/org/kie/kogito/examples/WorkItemHandlerConfig.java rename to kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/test/java/org/acme/examples/WorkItemHandlerConfig.java index e773e73879..8f3ebe2026 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/test/java/org/kie/kogito/examples/WorkItemHandlerConfig.java +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/test/java/org/acme/examples/WorkItemHandlerConfig.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; -import org.kie.kogito.examples.test.RecordedOutputWorkItemHandler; +import org.acme.examples.test.RecordedOutputWorkItemHandler; import org.kie.kogito.internal.process.runtime.KogitoWorkItemHandler; public class WorkItemHandlerConfig extends BaseWorkItemHandlerConfig { diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/test/java/org/kie/kogito/examples/onboarding/OnboardingEndpointIT.java b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/test/java/org/acme/examples/onboarding/OnboardingEndpointIT.java similarity index 98% rename from kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/test/java/org/kie/kogito/examples/onboarding/OnboardingEndpointIT.java rename to kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/test/java/org/acme/examples/onboarding/OnboardingEndpointIT.java index 31e5150554..e933b09dfc 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/test/java/org/kie/kogito/examples/onboarding/OnboardingEndpointIT.java +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/test/java/org/acme/examples/onboarding/OnboardingEndpointIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.onboarding; +package org.acme.examples.onboarding; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; @@ -25,8 +25,8 @@ import javax.inject.Inject; +import org.acme.examples.test.RecordedOutputWorkItemHandler; import org.junit.jupiter.api.Test; -import org.kie.kogito.examples.test.RecordedOutputWorkItemHandler; import org.kie.kogito.internal.process.runtime.KogitoWorkItem; import org.kie.kogito.internal.process.runtime.KogitoWorkItemHandler; import org.kie.kogito.process.ProcessConfig; diff --git a/kogito-springboot-examples/onboarding-springboot/src/test/java/org/kie/kogito/examples/test/RecordedOutputWorkItemHandler.java b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/test/java/org/acme/examples/test/RecordedOutputWorkItemHandler.java similarity index 97% rename from kogito-springboot-examples/onboarding-springboot/src/test/java/org/kie/kogito/examples/test/RecordedOutputWorkItemHandler.java rename to kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/test/java/org/acme/examples/test/RecordedOutputWorkItemHandler.java index 98c20ea8b5..ddbaef6549 100644 --- a/kogito-springboot-examples/onboarding-springboot/src/test/java/org/kie/kogito/examples/test/RecordedOutputWorkItemHandler.java +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/test/java/org/acme/examples/test/RecordedOutputWorkItemHandler.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.test; +package org.acme.examples.test; import java.util.HashMap; import java.util.Map; diff --git a/kogito-quarkus-examples/onboarding-example/payroll/README.md b/kogito-quarkus-examples/onboarding-example/payroll/README.md index cbacbce33f..530cf94099 100644 --- a/kogito-quarkus-examples/onboarding-example/payroll/README.md +++ b/kogito-quarkus-examples/onboarding-example/payroll/README.md @@ -97,7 +97,8 @@ $ mvn clean install -Pminikube # For Kubernetes or Knative just change the given profile to the respective platform (lower case). ``` -> NOTE: If you're targeting a Kubernetes or OpenShift cluster, consider the resources created on `target/kubernetes` directory. +> NOTE: If you're targeting a Kubernetes or OpenShift cluster, consider the resources created on `target/kubernetes` +> directory. Please see the official [Quarkus Guide](https://quarkus.io/guides/deploying-to-kubernetes) for more information. diff --git a/kogito-quarkus-examples/onboarding-example/payroll/pom.xml b/kogito-quarkus-examples/onboarding-example/payroll/pom.xml index dc3a6cfa0e..85ab0a9f83 100644 --- a/kogito-quarkus-examples/onboarding-example/payroll/pom.xml +++ b/kogito-quarkus-examples/onboarding-example/payroll/pom.xml @@ -1,21 +1,37 @@ - 4.0.0 - - org.kie.kogito.examples - onboarding-example - 2.0.0-SNAPSHOT - + payroll + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Onboarding Example :: Payroll with DMN Payroll related decisions for onboarding + 2.16.10.Final quarkus-bom io.quarkus 2.16.10.Final + org.kie.kogito + kogito-bom + 2.0.0-SNAPSHOT + 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -25,6 +41,13 @@ pom import + + ${kogito.bom.group-id} + ${kogito.bom.artifact-id} + ${kogito.bom.version} + pom + import + @@ -81,6 +104,7 @@ quarkus-smallrye-health + ${project.artifactId} @@ -99,9 +123,47 @@ false + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + default + + true + + + + native + + + native + + + minikube @@ -123,5 +185,22 @@ knative + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + diff --git a/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/kie/kogito/examples/payroll/Address.java b/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Address.java similarity index 94% rename from kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/kie/kogito/examples/payroll/Address.java rename to kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Address.java index 557708a351..e591cbc3e2 100644 --- a/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/kie/kogito/examples/payroll/Address.java +++ b/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Address.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.payroll; +package org.acme.examples.payroll; /** * This class was automatically generated by the data modeler tool. @@ -64,7 +64,7 @@ public void setCountry(java.lang.String country) { } public Address(java.lang.String street, java.lang.String city, - java.lang.String zipCode, java.lang.String country) { + java.lang.String zipCode, java.lang.String country) { this.street = street; this.city = city; this.zipCode = zipCode; diff --git a/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/kie/kogito/examples/payroll/Employee.java b/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Employee.java similarity index 84% rename from kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/kie/kogito/examples/payroll/Employee.java rename to kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Employee.java index ea74fae3c7..fdb1d2995b 100644 --- a/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/kie/kogito/examples/payroll/Employee.java +++ b/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Employee.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.payroll; +package org.acme.examples.payroll; /** * This class was automatically generated by the data modeler tool. @@ -28,7 +28,7 @@ public class Employee implements java.io.Serializable { private java.lang.String personalId; private java.util.Date birthDate; - private org.kie.kogito.examples.payroll.Address address; + private Address address; public Employee() { } @@ -65,17 +65,17 @@ public void setBirthDate(java.util.Date birthDate) { this.birthDate = birthDate; } - public org.kie.kogito.examples.payroll.Address getAddress() { + public Address getAddress() { return this.address; } - public void setAddress(org.kie.kogito.examples.payroll.Address address) { + public void setAddress(Address address) { this.address = address; } public Employee(java.lang.String firstName, java.lang.String lastName, - java.lang.String personalId, java.util.Date birthDate, - org.kie.kogito.examples.payroll.Address address) { + java.lang.String personalId, java.util.Date birthDate, + Address address) { this.firstName = firstName; this.lastName = lastName; this.personalId = personalId; diff --git a/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/kie/kogito/examples/payroll/Payroll.java b/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Payroll.java similarity index 86% rename from kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/kie/kogito/examples/payroll/Payroll.java rename to kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Payroll.java index c5a3844acf..f84802909b 100644 --- a/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/kie/kogito/examples/payroll/Payroll.java +++ b/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Payroll.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.payroll; +package org.acme.examples.payroll; /** * This class was automatically generated by the data modeler tool. @@ -27,13 +27,13 @@ public class Payroll implements java.io.Serializable { private java.math.BigDecimal taxRate; private String paymentDate; - private org.kie.kogito.examples.payroll.Employee employee; + private Employee employee; - public org.kie.kogito.examples.payroll.Employee getEmployee() { + public Employee getEmployee() { return employee; } - public void setEmployee(org.kie.kogito.examples.payroll.Employee employee) { + public void setEmployee(Employee employee) { this.employee = employee; } @@ -65,7 +65,7 @@ public void setPaymentDate(String paymentDate) { } public Payroll(java.math.BigDecimal vacationDays, java.math.BigDecimal taxRate, - String paymentDate) { + String paymentDate) { this.vacationDays = vacationDays; this.taxRate = taxRate; this.paymentDate = paymentDate; diff --git a/kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/application.properties b/kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/application.properties index ccf4fb79f4..084a5e7d8a 100644 --- a/kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/application.properties +++ b/kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/application.properties @@ -3,7 +3,6 @@ # Packaging # quarkus.package.type=fast-jar quarkus.http.port=8082 - # Kubernetes related properties %minikube.quarkus.kubernetes.deployment-target=minikube %kubernetes.quarkus.kubernetes.deployment-target=kubernetes @@ -14,7 +13,6 @@ quarkus.container-image.tag=latest quarkus.kubernetes.labels.taxes/rate=process quarkus.kubernetes.labels.vacations/days=process quarkus.kubernetes.labels.payments/date=process - %knative.quarkus.kubernetes.deployment-target=kubernetes %knative.quarkus.knative.labels.taxes/rate=process %knative.quarkus.knative.labels.vacations/days=process diff --git a/kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/org/kie/kogito/examples/payroll/paymentDate.dmn b/kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/org/acme/examples/payroll/paymentDate.dmn similarity index 100% rename from kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/org/kie/kogito/examples/payroll/paymentDate.dmn rename to kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/org/acme/examples/payroll/paymentDate.dmn diff --git a/kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/org/kie/kogito/examples/payroll/taxRate.dmn b/kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/org/acme/examples/payroll/taxRate.dmn similarity index 100% rename from kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/org/kie/kogito/examples/payroll/taxRate.dmn rename to kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/org/acme/examples/payroll/taxRate.dmn diff --git a/kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/org/kie/kogito/examples/payroll/vacationDays.dmn b/kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/org/acme/examples/payroll/vacationDays.dmn similarity index 100% rename from kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/org/kie/kogito/examples/payroll/vacationDays.dmn rename to kogito-quarkus-examples/onboarding-example/payroll/src/main/resources/org/acme/examples/payroll/vacationDays.dmn diff --git a/kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/kie/kogito/examples/payroll/PaymentDateTest.java b/kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/acme/examples/payroll/PaymentDateTest.java similarity index 97% rename from kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/kie/kogito/examples/payroll/PaymentDateTest.java rename to kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/acme/examples/payroll/PaymentDateTest.java index 5fe388f31f..0ea42bda98 100644 --- a/kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/kie/kogito/examples/payroll/PaymentDateTest.java +++ b/kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/acme/examples/payroll/PaymentDateTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.payroll; +package org.acme.examples.payroll; import org.junit.jupiter.api.Test; diff --git a/kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/kie/kogito/examples/payroll/TaxRateTest.java b/kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/acme/examples/payroll/TaxRateTest.java similarity index 97% rename from kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/kie/kogito/examples/payroll/TaxRateTest.java rename to kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/acme/examples/payroll/TaxRateTest.java index 78184da510..4b45c58895 100644 --- a/kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/kie/kogito/examples/payroll/TaxRateTest.java +++ b/kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/acme/examples/payroll/TaxRateTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.payroll; +package org.acme.examples.payroll; import org.junit.jupiter.api.Test; diff --git a/kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/kie/kogito/examples/payroll/VacationDaysTest.java b/kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/acme/examples/payroll/VacationDaysTest.java similarity index 97% rename from kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/kie/kogito/examples/payroll/VacationDaysTest.java rename to kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/acme/examples/payroll/VacationDaysTest.java index 48f2b2d5d5..af7c0bf7ee 100644 --- a/kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/kie/kogito/examples/payroll/VacationDaysTest.java +++ b/kogito-quarkus-examples/onboarding-example/payroll/src/test/java/org/acme/examples/payroll/VacationDaysTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.payroll; +package org.acme.examples.payroll; import org.junit.jupiter.api.Test; diff --git a/kogito-quarkus-examples/onboarding-example/pom.xml b/kogito-quarkus-examples/onboarding-example/pom.xml index 0c349c8b1e..71c19a75a9 100644 --- a/kogito-quarkus-examples/onboarding-example/pom.xml +++ b/kogito-quarkus-examples/onboarding-example/pom.xml @@ -1,74 +1,21 @@ - 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + onboarding-example + org.acme.examples + 2.0.0-SNAPSHOT pom + Kogito Example :: Onboarding Example onboarding example service (onboarding, hr, payroll) + hr payroll onboarding-quarkus - - 2.16.10.Final - quarkus-bom - io.quarkus - 2.16.10.Final - org.kie.kogito - kogito-bom - 2.0.0-SNAPSHOT - 2.0.0-SNAPSHOT - - - - - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} - pom - import - - - ${kogito.bom.group-id} - ${kogito.bom.artifact-id} - ${kogito.bom.version} - pom - import - - - - - - - - ${quarkus.platform.group-id} - quarkus-maven-plugin - ${quarkus-plugin.version} - - - - - - - default - - true - - - - native - - - native - - - - + diff --git a/kogito-quarkus-examples/pmml-event-driven-quarkus/pom.xml b/kogito-quarkus-examples/pmml-event-driven-quarkus/pom.xml index 04ad43e099..2d2efc77c6 100644 --- a/kogito-quarkus-examples/pmml-event-driven-quarkus/pom.xml +++ b/kogito-quarkus-examples/pmml-event-driven-quarkus/pom.xml @@ -1,14 +1,15 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + pmml-event-driven-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: PMML Event-Driven - Quarkus + 2.16.10.Final quarkus-bom @@ -18,6 +19,17 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + 1.5.0 + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 @@ -87,6 +99,7 @@ org.skyscreamer jsonassert + ${version.org.skyscreamer} test @@ -111,10 +124,52 @@ maven-failsafe-plugin - ${build.directory}/test-run + ${project.build.directory}/test-run + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/pmml-event-driven-quarkus/src/test/java/org/kie/kogito/examples/PmmlEventDrivenIT.java b/kogito-quarkus-examples/pmml-event-driven-quarkus/src/test/java/org/acme/examples/PmmlEventDrivenIT.java similarity index 99% rename from kogito-quarkus-examples/pmml-event-driven-quarkus/src/test/java/org/kie/kogito/examples/PmmlEventDrivenIT.java rename to kogito-quarkus-examples/pmml-event-driven-quarkus/src/test/java/org/acme/examples/PmmlEventDrivenIT.java index 3908d37d47..b88dd33215 100644 --- a/kogito-quarkus-examples/pmml-event-driven-quarkus/src/test/java/org/kie/kogito/examples/PmmlEventDrivenIT.java +++ b/kogito-quarkus-examples/pmml-event-driven-quarkus/src/test/java/org/acme/examples/PmmlEventDrivenIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; import java.io.IOException; import java.net.URL; diff --git a/kogito-quarkus-examples/pmml-incubation-api-quarkus/pom.xml b/kogito-quarkus-examples/pmml-incubation-api-quarkus/pom.xml index 4a930255b5..1a94cf09ec 100644 --- a/kogito-quarkus-examples/pmml-incubation-api-quarkus/pom.xml +++ b/kogito-quarkus-examples/pmml-incubation-api-quarkus/pom.xml @@ -1,14 +1,15 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + pmml-incubation-api-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: PMML Incubation API With Quarkus + 2.16.10.Final quarkus-bom @@ -18,7 +19,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -37,6 +49,7 @@ + io.quarkus @@ -95,6 +108,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/pmml-quarkus-example/README.md b/kogito-quarkus-examples/pmml-quarkus-example/README.md index a458891eab..7b1f445edb 100644 --- a/kogito-quarkus-examples/pmml-quarkus-example/README.md +++ b/kogito-quarkus-examples/pmml-quarkus-example/README.md @@ -11,15 +11,19 @@ Demonstrates PMML on Kogito capabilities, including REST interface code generati ### Prerequisites You will need: - - Java 11+ installed - - Environment variable JAVA_HOME set accordingly - - Maven 3.8.6+ installed - + +- Java 11+ installed +- Environment variable JAVA_HOME set accordingly +- Maven 3.8.6+ installed + When using native image compilation, you will also need: - - [GraalVM 19.3.1](https://github.com/oracle/graal/releases/tag/vm-19.3.1) installed - - Environment variable GRAALVM_HOME set accordingly - - Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be installed too. You also need 'native-image' installed in GraalVM (using 'gu install native-image'). Please refer to [GraalVM installation documentation](https://www.graalvm.org/docs/reference-manual/aot-compilation/#prerequisites) for more details. - + +- [GraalVM 19.3.1](https://github.com/oracle/graal/releases/tag/vm-19.3.1) installed +- Environment variable GRAALVM_HOME set accordingly +- Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be + installed too. You also need 'native-image' installed in GraalVM (using 'gu install native-image'). Please refer + to [GraalVM installation documentation](https://www.graalvm.org/docs/reference-manual/aot-compilation/#prerequisites) + for more details. ### Compile and Run in Local Dev Mode @@ -42,6 +46,7 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ``` @@ -57,15 +62,20 @@ To run the generated native executable, generated in `target/`, execute Note: This does not yet work on Windows, GraalVM and Quarkus should be rolling out support for Windows soon. ## OpenAPI (Swagger) documentation + [Specification at swagger.io](https://swagger.io/docs/specification/about/) -You can take a look at the [OpenAPI definition](http://localhost:8080/openapi?format=json) - automatically generated and included in this service - to determine all available operations exposed by this service. For easy readability you can visualize the OpenAPI definition file using a UI tool like for example available [Swagger UI](https://editor.swagger.io). +You can take a look at the [OpenAPI definition](http://localhost:8080/openapi?format=json) - automatically generated and +included in this service - to determine all available operations exposed by this service. For easy readability you can +visualize the OpenAPI definition file using a UI tool like for example +available [Swagger UI](https://editor.swagger.io). In addition, various clients to interact with this service can be easily generated using this OpenAPI definition. -When running in either Quarkus Development or Native mode, we also leverage the [Quarkus OpenAPI extension](https://quarkus.io/guides/openapi-swaggerui#use-swagger-ui-for-development) that exposes [Swagger UI](http://localhost:8080/swagger-ui/) that you can use to look at available REST endpoints and send test requests. - - +When running in either Quarkus Development or Native mode, we also leverage +the [Quarkus OpenAPI extension](https://quarkus.io/guides/openapi-swaggerui#use-swagger-ui-for-development) that +exposes [Swagger UI](http://localhost:8080/swagger-ui/) that you can use to look at available REST endpoints and send +test requests. ## Example Usage @@ -88,6 +98,7 @@ Curl command (using the JSON object above): ```sh curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"fld1":3.0, "fld2":2.0, "fld3":"y"}' http://localhost:8080/Testregression/LinReg ``` + or on Windows: ```sh @@ -118,6 +129,7 @@ Curl command (using the JSON object above): ```sh curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"temperature":30.0, "humidity":10.0}' http://localhost:8080/Testtree/SampleMine ``` + or on Windows: ```sh @@ -148,6 +160,7 @@ Curl command (using the JSON object above): ```sh curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"input1":5.0, "input2":-10.0}' http://localhost:8080/Testscorecard/SimpleScorecard ``` + or on Windows: ```sh @@ -182,6 +195,7 @@ Curl command (using the JSON object above): ```sh curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"residenceState":"AP", "validLicense":true, "occupation":"ASTRONAUT", "categoricalY":"classA", "categoricalX":"red", "variable":6.6, "age":25.0}' http://localhost:8080/Testminingmodel/PredicatesMining ``` + or on Windows: ```sh @@ -198,4 +212,5 @@ Example response: ## Deploying with Kogito Operator -In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). +In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with +the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). diff --git a/kogito-quarkus-examples/pmml-quarkus-example/pom.xml b/kogito-quarkus-examples/pmml-quarkus-example/pom.xml index 40fb97a021..54b7aa44ef 100644 --- a/kogito-quarkus-examples/pmml-quarkus-example/pom.xml +++ b/kogito-quarkus-examples/pmml-quarkus-example/pom.xml @@ -1,14 +1,15 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + pmml-quarkus-example + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: PMML - Quarkus + 2.16.10.Final quarkus-bom @@ -18,7 +19,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -37,6 +49,7 @@ + org.kie.kogito @@ -104,6 +117,49 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + ${project.build.directory}/${project.build.finalName}-runner + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/pmml-quarkus-example/src/main/resources/application.properties b/kogito-quarkus-examples/pmml-quarkus-example/src/main/resources/application.properties index 80bf3f8b49..98e06779a2 100644 --- a/kogito-quarkus-examples/pmml-quarkus-example/src/main/resources/application.properties +++ b/kogito-quarkus-examples/pmml-quarkus-example/src/main/resources/application.properties @@ -1,6 +1,4 @@ # Packaging # quarkus.package.type=fast-jar - quarkus.swagger-ui.always-include=true - quarkus.log.level=INFO diff --git a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/CommonTestUtils.java b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/CommonTestUtils.java similarity index 85% rename from kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/CommonTestUtils.java rename to kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/CommonTestUtils.java index fa360a5034..318c728419 100644 --- a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/java/org/kie/kogito/dmn/pmml/quarkus/example/CommonTestUtils.java +++ b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/CommonTestUtils.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.dmn.pmml.quarkus.example; +package org.acme.pmml.quarkus.example; import java.util.Map; @@ -31,9 +31,9 @@ public class CommonTestUtils { public static void testResult(final String inputData, - final String path, - final String targetField, - final Object expectedResult) { + final String path, + final String targetField, + final Object expectedResult) { given() .contentType(ContentType.JSON) .body(inputData) @@ -45,7 +45,7 @@ public static void testResult(final String inputData, } public static void testResultWrongData(final String inputData, - final String path) { + final String path) { given() .contentType(ContentType.JSON) .body(inputData) @@ -57,9 +57,9 @@ public static void testResultWrongData(final String inputData, } public static void testDescriptive(final String inputData, - final String basePath, - final String targetField, - final Map expectedResultMap) { + final String basePath, + final String targetField, + final Map expectedResultMap) { String path = basePath + "/descriptive"; Object resultVariables = given() .contentType(ContentType.JSON) @@ -87,7 +87,7 @@ public static void testDescriptive(final String inputData, } public static void testDescriptiveWrongData(final String inputData, - final String basePath) { + final String basePath) { String path = basePath + "/descriptive"; given() .contentType(ContentType.JSON) diff --git a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/LinRegTest.java b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/LinRegTest.java similarity index 88% rename from kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/LinRegTest.java rename to kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/LinRegTest.java index 60ec72e2ec..4fbc8ea899 100644 --- a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/LinRegTest.java +++ b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/LinRegTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.pmml.quarkus.example; +package org.acme.pmml.quarkus.example; import java.util.Collections; import java.util.Map; @@ -23,8 +23,8 @@ import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; -import static org.kie.kogito.pmml.quarkus.example.CommonTestUtils.testDescriptive; -import static org.kie.kogito.pmml.quarkus.example.CommonTestUtils.testResult; +import static org.acme.pmml.quarkus.example.CommonTestUtils.testDescriptive; +import static org.acme.pmml.quarkus.example.CommonTestUtils.testResult; @QuarkusTest class LinRegTest { diff --git a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/MiningModelTest.java b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/MiningModelTest.java similarity index 91% rename from kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/MiningModelTest.java rename to kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/MiningModelTest.java index 3cb39b0a8b..fa3e038c13 100644 --- a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/MiningModelTest.java +++ b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/MiningModelTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.pmml.quarkus.example; +package org.acme.pmml.quarkus.example; import java.util.Collections; import java.util.Map; @@ -23,8 +23,8 @@ import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; -import static org.kie.kogito.pmml.quarkus.example.CommonTestUtils.testDescriptive; -import static org.kie.kogito.pmml.quarkus.example.CommonTestUtils.testResult; +import static org.acme.pmml.quarkus.example.CommonTestUtils.testDescriptive; +import static org.acme.pmml.quarkus.example.CommonTestUtils.testResult; @QuarkusTest class MiningModelTest { diff --git a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/NativeLinRegTestIT.java b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/NativeLinRegTestIT.java similarity index 94% rename from kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/NativeLinRegTestIT.java rename to kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/NativeLinRegTestIT.java index d173b1e4d8..ce3afbf19d 100644 --- a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/NativeLinRegTestIT.java +++ b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/NativeLinRegTestIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.pmml.quarkus.example; +package org.acme.pmml.quarkus.example; import io.quarkus.test.junit.NativeImageTest; diff --git a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/NativeMiningModelTestIT.java b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/NativeMiningModelTestIT.java similarity index 94% rename from kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/NativeMiningModelTestIT.java rename to kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/NativeMiningModelTestIT.java index f29e5a049f..e5251ae665 100644 --- a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/NativeMiningModelTestIT.java +++ b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/NativeMiningModelTestIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.pmml.quarkus.example; +package org.acme.pmml.quarkus.example; import io.quarkus.test.junit.NativeImageTest; diff --git a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/NativeSampleMineTestIT.java b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/NativeSampleMineTestIT.java similarity index 94% rename from kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/NativeSampleMineTestIT.java rename to kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/NativeSampleMineTestIT.java index 8b4160f802..1a35e651a5 100644 --- a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/NativeSampleMineTestIT.java +++ b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/NativeSampleMineTestIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.pmml.quarkus.example; +package org.acme.pmml.quarkus.example; import io.quarkus.test.junit.NativeImageTest; diff --git a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/NativeSimpleScorecardTestIT.java b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/NativeSimpleScorecardTestIT.java similarity index 94% rename from kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/NativeSimpleScorecardTestIT.java rename to kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/NativeSimpleScorecardTestIT.java index e2ebcb606f..1cea7d2136 100644 --- a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/NativeSimpleScorecardTestIT.java +++ b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/NativeSimpleScorecardTestIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.pmml.quarkus.example; +package org.acme.pmml.quarkus.example; import io.quarkus.test.junit.NativeImageTest; diff --git a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/SampleMineTest.java b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/SampleMineTest.java similarity index 88% rename from kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/SampleMineTest.java rename to kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/SampleMineTest.java index af88056c04..d813a51e92 100644 --- a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/SampleMineTest.java +++ b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/SampleMineTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.pmml.quarkus.example; +package org.acme.pmml.quarkus.example; import java.util.HashMap; import java.util.Map; @@ -23,8 +23,8 @@ import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; -import static org.kie.kogito.pmml.quarkus.example.CommonTestUtils.testDescriptive; -import static org.kie.kogito.pmml.quarkus.example.CommonTestUtils.testResult; +import static org.acme.pmml.quarkus.example.CommonTestUtils.testDescriptive; +import static org.acme.pmml.quarkus.example.CommonTestUtils.testResult; @QuarkusTest class SampleMineTest { diff --git a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/SimpleScorecardTest.java b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/SimpleScorecardTest.java similarity index 89% rename from kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/SimpleScorecardTest.java rename to kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/SimpleScorecardTest.java index 6df97d00cb..5b8b6f72ca 100644 --- a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/kie/kogito/pmml/quarkus/example/SimpleScorecardTest.java +++ b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/SimpleScorecardTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.pmml.quarkus.example; +package org.acme.pmml.quarkus.example; import java.util.HashMap; import java.util.Map; @@ -23,8 +23,8 @@ import io.quarkus.test.junit.QuarkusTest; import io.restassured.RestAssured; -import static org.kie.kogito.pmml.quarkus.example.CommonTestUtils.testDescriptive; -import static org.kie.kogito.pmml.quarkus.example.CommonTestUtils.testResult; +import static org.acme.pmml.quarkus.example.CommonTestUtils.testDescriptive; +import static org.acme.pmml.quarkus.example.CommonTestUtils.testResult; @QuarkusTest class SimpleScorecardTest { diff --git a/kogito-quarkus-examples/pom.xml b/kogito-quarkus-examples/pom.xml index 3fe564b87e..4ee194c4e1 100644 --- a/kogito-quarkus-examples/pom.xml +++ b/kogito-quarkus-examples/pom.xml @@ -4,13 +4,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - - org.kie.kogito.examples - kogito-examples - 2.0.0-SNAPSHOT - - kogito-quarkus-examples + org.acme.examples + 2.0.0-SNAPSHOT pom Kogito Example :: Quarkus @@ -19,6 +15,10 @@ 0 fast-jar + 3.1.2 + ${version.surefire.plugin} + UTF-8 + UTF-8 @@ -171,50 +171,50 @@ - - kogito-apps-downstream-native - - - kogito-apps-native - - - - **/Native*IT.java - - native - 8g - - 8080 - - + + + + + + + + + + + + + + + + - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${version.surefire.plugin} - - - org.jboss.logmanager.LogManager - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${version.surefire.plugin} - - - org.jboss.logmanager.LogManager - ${tests.quarkus.http.port} - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kogito-quarkus-examples/process-business-rules-quarkus/mvnw b/kogito-quarkus-examples/process-business-rules-quarkus/mvnw deleted file mode 100755 index d2f0ea3808..0000000000 --- a/kogito-quarkus-examples/process-business-rules-quarkus/mvnw +++ /dev/null @@ -1,310 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" - else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl -o "$wrapperJarPath" "$jarUrl" -f - else - curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f - fi - - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/kogito-quarkus-examples/process-business-rules-quarkus/mvnw.cmd b/kogito-quarkus-examples/process-business-rules-quarkus/mvnw.cmd deleted file mode 100644 index b26ab24f03..0000000000 --- a/kogito-quarkus-examples/process-business-rules-quarkus/mvnw.cmd +++ /dev/null @@ -1,182 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - -FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/kogito-quarkus-examples/process-business-rules-quarkus/pom.xml b/kogito-quarkus-examples/process-business-rules-quarkus/pom.xml index d20e8e4f84..2ed10d3cbe 100644 --- a/kogito-quarkus-examples/process-business-rules-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-business-rules-quarkus/pom.xml @@ -1,15 +1,16 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-business-rules-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process Business Rules Quarkus Kogito business rules invocation - Quarkus + 2.16.10.Final quarkus-bom @@ -19,7 +20,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -38,6 +50,7 @@ + io.quarkus @@ -86,6 +99,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/process-decisions-quarkus/README.md b/kogito-quarkus-examples/process-decisions-quarkus/README.md index f2cff4a768..edbf79a541 100644 --- a/kogito-quarkus-examples/process-decisions-quarkus/README.md +++ b/kogito-quarkus-examples/process-decisions-quarkus/README.md @@ -32,13 +32,13 @@ These are the properties defined for the process, the most important one in this * #### Proces Variables -The variables used in the process itself, but the focus in this example are the classes that are used to define the POJOs to interact the process with decisions, that are the [Violation](src/main/java/org/kie/kogito/traffic/Violation.java), [Driver](src/main/java/org/kie/kogito/traffic/Driver.java), [Fine](src/main/java/org/kie/kogito/traffic/Fine.java). +The variables used in the process itself, but the focus in this example are the classes that are used to define the POJOs to interact the process with decisions, that are the [Violation](src/main/java/org/acme/traffic/Violation.java), [Driver](src/main/java/org/acme/traffic/Driver.java), [Fine](src/main/java/org/acme/traffic/Fine.java). **Mapping data from Process to/from DMN** -It is important to mention DMN for instance can define the Data Type in its structure, but we can align all attributes names in a Java class that is used as process variables, in case the attribute names contain spaces or are not following java conventions we can use [Jackson](https://github.com/FasterXML/jackson) annotations to make the process variable POJOs aligned with DMN data types, for instance in the [Violation](src/main/java/org/kie/kogito/traffic/Violation.java) class, where it is mapped the `speedLimit` attribute as `Speed Limit` using `@JsonProperty` annotation, in this case, this attribute from the process variable with Violation can be seamlessly integrated Violation Data Type defined in DMN. +It is important to mention DMN for instance can define the Data Type in its structure, but we can align all attributes names in a Java class that is used as process variables, in case the attribute names contain spaces or are not following java conventions we can use [Jackson](https://github.com/FasterXML/jackson) annotations to make the process variable POJOs aligned with DMN data types, for instance in the [Violation](src/main/java/org/acme/traffic/Violation.java) class, where it is mapped the `speedLimit` attribute as `Speed Limit` using `@JsonProperty` annotation, in this case, this attribute from the process variable with Violation can be seamlessly integrated Violation Data Type defined in DMN. **Violation Data Type in DMN** @@ -49,7 +49,7 @@ It is important to mention DMN for instance can define the Data Type in its stru Fetch for driver information, in this implementation it is just mocking a result, that simply fill with an expired license date in case the `driverId` is an odd number and with a valid date in case of an even number. In a real use case, it could be performing an external call to a service or a database to get this information. -The service task implementation is done in the [DriverService](src/main/java/org/kie/kogito/traffic/DriverService.java) class. +The service task implementation is done in the [DriverService](src/main/java/org/acme/traffic/DriverService.java) class. In the data assignment the input is the `driverId` and output is the `driver` variable, filled with all driver information. @@ -59,7 +59,7 @@ Represents the task to do the call to the DRL service. -The properties to be set are mainly the `Rule Language`that should be set as `DRL` and the `Rule Flow Group` with `unit:` + `[the FQCN of the Rule Unit Data class]`, in this case [org.kie.kogito.traffic.LicenseValidationService](src/main/java/org/kie/kogito/traffic/LicenseValidationService.java). +The properties to be set are mainly the `Rule Language`that should be set as `DRL` and the `Rule Flow Group` with `unit:` + `[the FQCN of the Rule Unit Data class]`, in this case [org.acme.traffic.LicenseValidationService](src/main/java/org/acme/traffic/LicenseValidationService.java). @@ -95,7 +95,7 @@ Just an example task where it could be performed any action based on the conditi This decision consistis in rules which are evaluated to check if a driver's license is expired or not according to the expiration date and thus populating the result in the information in the driver variable. -The DRL file where this Rule Unit is declared is [LicenseValidationService.drl](src/main/resources/LicenseValidationService.drl) and the the Java class that contains the Rule Unit Data is [LicenseValidationService](src/main/java/org/kie/kogito/traffic/LicenseValidationService.java). +The DRL file where this Rule Unit is declared is [LicenseValidationService.drl](src/main/resources/LicenseValidationService.drl) and the the Java class that contains the Rule Unit Data is [LicenseValidationService](src/main/java/org/acme/traffic/LicenseValidationService.java). ### Traffic Violation - DMN diff --git a/kogito-quarkus-examples/process-decisions-quarkus/pom.xml b/kogito-quarkus-examples/process-decisions-quarkus/pom.xml index d13f21a705..989b016927 100644 --- a/kogito-quarkus-examples/process-decisions-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-decisions-quarkus/pom.xml @@ -1,15 +1,15 @@ - 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-decisions-quarkus + org.acme.examples + 2.0.0-SNAPSHOT Kogito Example :: Process :: Decisions :: Quarkus Process with DMN and DRL integration - Quarkus + 2.16.10.Final quarkus-bom @@ -19,7 +19,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -38,6 +49,7 @@ + io.quarkus @@ -83,6 +95,49 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + ${project.build.directory}/${project.build.finalName}-runner + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + \ No newline at end of file diff --git a/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/kie/kogito/traffic/Driver.java b/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/acme/traffic/Driver.java similarity index 98% rename from kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/kie/kogito/traffic/Driver.java rename to kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/acme/traffic/Driver.java index f77a47b749..26bd79ee24 100644 --- a/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/kie/kogito/traffic/Driver.java +++ b/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/acme/traffic/Driver.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.util.Date; diff --git a/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/kie/kogito/traffic/DriverService.java b/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/acme/traffic/DriverService.java similarity index 97% rename from kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/kie/kogito/traffic/DriverService.java rename to kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/acme/traffic/DriverService.java index 595aa50e4b..97a4cc9bd4 100644 --- a/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/kie/kogito/traffic/DriverService.java +++ b/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/acme/traffic/DriverService.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.time.ZonedDateTime; import java.util.Date; diff --git a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/kie/kogito/traffic/Fine.java b/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/acme/traffic/Fine.java similarity index 97% rename from kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/kie/kogito/traffic/Fine.java rename to kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/acme/traffic/Fine.java index 4b6873829e..d82495c3d1 100644 --- a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/kie/kogito/traffic/Fine.java +++ b/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/acme/traffic/Fine.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/LicenseValidationService.java b/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/acme/traffic/LicenseValidationService.java similarity index 97% rename from kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/LicenseValidationService.java rename to kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/acme/traffic/LicenseValidationService.java index 53fd44ed58..2423a7c362 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/LicenseValidationService.java +++ b/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/acme/traffic/LicenseValidationService.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.util.Date; diff --git a/kogito-springboot-examples/process-decisions-rest-springboot/src/main/java/org/kie/kogito/traffic/Violation.java b/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/acme/traffic/Violation.java similarity index 98% rename from kogito-springboot-examples/process-decisions-rest-springboot/src/main/java/org/kie/kogito/traffic/Violation.java rename to kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/acme/traffic/Violation.java index 56446af2d2..232567b0e0 100644 --- a/kogito-springboot-examples/process-decisions-rest-springboot/src/main/java/org/kie/kogito/traffic/Violation.java +++ b/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/acme/traffic/Violation.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.math.BigDecimal; import java.util.Date; diff --git a/kogito-quarkus-examples/process-decisions-quarkus/src/main/resources/LicenseValidationService.drl b/kogito-quarkus-examples/process-decisions-quarkus/src/main/resources/LicenseValidationService.drl index 799c78abd4..06c7bc2412 100644 --- a/kogito-quarkus-examples/process-decisions-quarkus/src/main/resources/LicenseValidationService.drl +++ b/kogito-quarkus-examples/process-decisions-quarkus/src/main/resources/LicenseValidationService.drl @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic +package org.acme.traffic unit LicenseValidationService diff --git a/kogito-quarkus-examples/process-decisions-quarkus/src/main/resources/traffic-rules-dmn.bpmn b/kogito-quarkus-examples/process-decisions-quarkus/src/main/resources/traffic-rules-dmn.bpmn index 2cc3bd1c29..1d047d44ff 100644 --- a/kogito-quarkus-examples/process-decisions-quarkus/src/main/resources/traffic-rules-dmn.bpmn +++ b/kogito-quarkus-examples/process-decisions-quarkus/src/main/resources/traffic-rules-dmn.bpmn @@ -1,27 +1,27 @@ - - - + + + - - + + - + - + - - - + + + - + @@ -118,7 +118,7 @@ _8A36870E-651D-4E0A-B345-D5CFF2182F0F _044AA388-325A-45DE-B783-4F48421B788B - + _A19108FE-08A2-4E80-B7A8-0254C49209A6 _D3E2F4B7-7739-452F-8D55-0C4F169D4A44 - - + + _95EFED1F-73F8-47E7-9604-A81EFE5DE8F5_driverInputX @@ -146,7 +146,7 @@ DRL]]> driver - + @@ -156,7 +156,7 @@ DRL]]> _A19108FE-08A2-4E80-B7A8-0254C49209A6 - + _93FFD317-476E-4624-84EF-994617572560_driverIdInputX @@ -219,10 +219,10 @@ DMN]]> - - + + - + _B076DF7E-91A5-47C7-B3FC-2C2EC06E5941_namespaceInputX _B076DF7E-91A5-47C7-B3FC-2C2EC06E5941_decisionInputX diff --git a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/test/java/org/kie/kogito/traffic/NativeTrafficProcessIT.java b/kogito-quarkus-examples/process-decisions-quarkus/src/test/java/org/acme/traffic/NativeTrafficProcessIT.java similarity index 95% rename from kogito-quarkus-examples/process-decisions-rules-quarkus/src/test/java/org/kie/kogito/traffic/NativeTrafficProcessIT.java rename to kogito-quarkus-examples/process-decisions-quarkus/src/test/java/org/acme/traffic/NativeTrafficProcessIT.java index 1697330392..edb541ac0c 100644 --- a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/test/java/org/kie/kogito/traffic/NativeTrafficProcessIT.java +++ b/kogito-quarkus-examples/process-decisions-quarkus/src/test/java/org/acme/traffic/NativeTrafficProcessIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import io.quarkus.test.junit.NativeImageTest; diff --git a/kogito-quarkus-examples/process-decisions-quarkus/src/test/java/org/kie/kogito/traffic/TrafficProcessIT.java b/kogito-quarkus-examples/process-decisions-quarkus/src/test/java/org/acme/traffic/TrafficProcessIT.java similarity index 98% rename from kogito-quarkus-examples/process-decisions-quarkus/src/test/java/org/kie/kogito/traffic/TrafficProcessIT.java rename to kogito-quarkus-examples/process-decisions-quarkus/src/test/java/org/acme/traffic/TrafficProcessIT.java index 4f9c49ed0e..1cd3f71822 100644 --- a/kogito-quarkus-examples/process-decisions-quarkus/src/test/java/org/kie/kogito/traffic/TrafficProcessIT.java +++ b/kogito-quarkus-examples/process-decisions-quarkus/src/test/java/org/acme/traffic/TrafficProcessIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.math.BigDecimal; import java.util.HashMap; diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/README.md b/kogito-quarkus-examples/process-decisions-rest-quarkus/README.md index 2850fbfb1a..e521b93d6e 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/README.md +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/README.md @@ -23,7 +23,7 @@ It is based on the traffic violation evaluation process, where it is required to ![Traffic Process](docs/images/traffic-rules-dmn-service-task.png) -In this approach it requires coding, to provide an implementation in the application responsible to execute the task, in this case, a REST/HTTP call. The implementation is up to the user, but here it's been used what the platform provides, like the [Quarkus REST Client](https://quarkus.io/guides/rest-client). Details can be seen in the classes [LicenseValidationRestClient](src/main/java/org/kie/kogito/traffic/LicenseValidationRestClient.java) and [TrafficViolationRestClient](src/main/java/org/kie/kogito/traffic/TrafficViolationRestClient.java). +In this approach it requires coding, to provide an implementation in the application responsible to execute the task, in this case, a REST/HTTP call. The implementation is up to the user, but here it's been used what the platform provides, like the [Quarkus REST Client](https://quarkus.io/guides/rest-client). Details can be seen in the classes [LicenseValidationRestClient](src/main/java/org/acme/traffic/LicenseValidationRestClient.java) and [TrafficViolationRestClient](src/main/java/org/acme/traffic/TrafficViolationRestClient.java). The BPMN file where this process is declared is [traffic-rules-dmn-service-task.bpmn](src/main/resources/traffic-rules-dmn-service-task.bpmn) @@ -44,13 +44,13 @@ These are the properties defined for the process, the most important one in this * #### Proces Variables -The variables used in the process itself, but the focus in this example are the classes that are used to define the POJOs to interact the process with decisions, that are the [Violation](src/main/java/org/kie/kogito/traffic/Violation.java), [Driver](src/main/java/org/kie/kogito/traffic/Driver.java), [Fine](src/main/java/org/kie/kogito/traffic/Fine.java) and [TrafficViolationResponse](src/main/java/org/kie/kogito/traffic/TrafficViolationResponse.java). +The variables used in the process itself, but the focus in this example are the classes that are used to define the POJOs to interact the process with decisions, that are the [Violation](src/main/java/org/acme/traffic/Violation.java), [Driver](src/main/java/org/acme/traffic/Driver.java), [Fine](src/main/java/org/acme/traffic/Fine.java) and [TrafficViolationResponse](src/main/java/org/acme/traffic/TrafficViolationResponse.java). **Mapping data from Process to/from DMN** -It is important to mention DMN for instance can define the Data Type in its structure, but we can align all attributes names in a Java class that is used as process variables, in case the attribute names contain spaces or are not following java conventions we can use [Jackson](https://github.com/FasterXML/jackson) annotations to make the process variable POJOs aligned with DMN data types, for instance in the [Violation](src/main/java/org/kie/kogito/traffic/Violation.java) class, where it is mapped the `speedLimit` attribute as `Speed Limit` using `@JsonProperty` annotation, in this case, this attribute from the process variable with Violation can be seamlessly integrated Violation Data Type defined in DMN. +It is important to mention DMN for instance can define the Data Type in its structure, but we can align all attributes names in a Java class that is used as process variables, in case the attribute names contain spaces or are not following java conventions we can use [Jackson](https://github.com/FasterXML/jackson) annotations to make the process variable POJOs aligned with DMN data types, for instance in the [Violation](src/main/java/org/acme/traffic/Violation.java) class, where it is mapped the `speedLimit` attribute as `Speed Limit` using `@JsonProperty` annotation, in this case, this attribute from the process variable with Violation can be seamlessly integrated Violation Data Type defined in DMN. **Violation Data Type in DMN** @@ -61,7 +61,7 @@ It is important to mention DMN for instance can define the Data Type in its stru Fetch for driver information, in this implementation it is just mocking a result, that simply fill with an expired license date in case the `driverId` is an odd number and with a valid date in case of an even number. In a real use case, it could be performing an external call to a service or a database to get this information. -The service task implementation is done in the [DriverService](src/main/java/org/kie/kogito/traffic/DriverService.java) class. +The service task implementation is done in the [DriverService](src/main/java/org/acme/traffic/DriverService.java) class. In the data assignment the input is the `driverId` and output is the `driver` variable, filled with all driver information. @@ -102,7 +102,7 @@ The implementation properties where it is necessary to set the Java class implem -The input for this task is the `Driver` and `Violation` variables, and the output is the `Suspended` and `Fine` that are wrapped into the [TrafficViolationResponse](src/main/java/org/kie/kogito/traffic/TrafficViolationResponse.java). +The input for this task is the `Driver` and `Violation` variables, and the output is the `Suspended` and `Fine` that are wrapped into the [TrafficViolationResponse](src/main/java/org/acme/traffic/TrafficViolationResponse.java). ![Traffic Violation Service Data](docs/images/traffic-violation-drl-service-task-data.png) @@ -111,7 +111,7 @@ The input for this task is the `Driver` and `Violation` variables, and the outpu -The input for this task is the `Driver` and `Violation` variables, and the output is the `Suspended` and `Fine` that are wrapped into the [TrafficViolationResponse](src/main/java/org/kie/kogito/traffic/TrafficViolationResponse.java). For REST Work Item the URL and HTTP Method are set as input parameters in the process itselt, that is different from the Service Task approaach. +The input for this task is the `Driver` and `Violation` variables, and the output is the `Suspended` and `Fine` that are wrapped into the [TrafficViolationResponse](src/main/java/org/acme/traffic/TrafficViolationResponse.java). For REST Work Item the URL and HTTP Method are set as input parameters in the process itselt, that is different from the Service Task approaach. ![Traffic Violation WIH Data](docs/images/traffic-violation-drl-wih-data.png) @@ -129,7 +129,7 @@ Just an example task where it could be performed any action based on the conditi This decision consistis in rules which are evaluated to check if a driver's license is expired or not according to the expiration date and thus populating the result in the information in the driver variable. -The DRL file where this Rule Unit is declared is [LicenseValidationService.drl](src/main/resources/LicenseValidationService.drl) and the the Java class that contains the Rule Unit Data is [LicenseValidationService](src/main/java/org/kie/kogito/traffic/LicenseValidationService.java). +The DRL file where this Rule Unit is declared is [LicenseValidationService.drl](src/main/resources/LicenseValidationService.drl) and the the Java class that contains the Rule Unit Data is [LicenseValidationService](src/main/java/org/acme/traffic/LicenseValidationService.java). ### Traffic Violation - DMN diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/pom.xml b/kogito-quarkus-examples/process-decisions-rest-quarkus/pom.xml index 852e7997b7..bfc4880a69 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/pom.xml @@ -1,15 +1,16 @@ - 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-decisions-rest-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process :: Decisions :: REST Quarkus Process with DMN and DRL integration through REST - Quarkus + 8080 2.16.10.Final @@ -20,7 +21,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -39,6 +51,7 @@ + io.quarkus @@ -104,6 +117,49 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + ${project.build.directory}/${project.build.finalName}-runner + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + \ No newline at end of file diff --git a/kogito-springboot-examples/process-decisions-rest-springboot/src/main/java/org/kie/kogito/traffic/Driver.java b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/Driver.java similarity index 98% rename from kogito-springboot-examples/process-decisions-rest-springboot/src/main/java/org/kie/kogito/traffic/Driver.java rename to kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/Driver.java index f77a47b749..26bd79ee24 100644 --- a/kogito-springboot-examples/process-decisions-rest-springboot/src/main/java/org/kie/kogito/traffic/Driver.java +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/Driver.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.util.Date; diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/DriverService.java b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/DriverService.java similarity index 97% rename from kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/DriverService.java rename to kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/DriverService.java index 595aa50e4b..97a4cc9bd4 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/DriverService.java +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/DriverService.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.time.ZonedDateTime; import java.util.Date; diff --git a/kogito-springboot-examples/process-decisions-rest-springboot/src/main/java/org/kie/kogito/traffic/Fine.java b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/Fine.java similarity index 97% rename from kogito-springboot-examples/process-decisions-rest-springboot/src/main/java/org/kie/kogito/traffic/Fine.java rename to kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/Fine.java index 4b6873829e..d82495c3d1 100644 --- a/kogito-springboot-examples/process-decisions-rest-springboot/src/main/java/org/kie/kogito/traffic/Fine.java +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/Fine.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/LicenseValidationRestClient.java b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/LicenseValidationRestClient.java similarity index 97% rename from kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/LicenseValidationRestClient.java rename to kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/LicenseValidationRestClient.java index d624fcbe21..fe6a6f6819 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/LicenseValidationRestClient.java +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/LicenseValidationRestClient.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.util.Map; diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/LicenseValidationRestService.java b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/LicenseValidationRestService.java similarity index 97% rename from kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/LicenseValidationRestService.java rename to kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/LicenseValidationRestService.java index f8dc393091..8b66c23835 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/LicenseValidationRestService.java +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/LicenseValidationRestService.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.util.Collections; diff --git a/kogito-springboot-examples/process-decisions-springboot/src/main/java/org/kie/kogito/traffic/LicenseValidationService.java b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/LicenseValidationService.java similarity index 97% rename from kogito-springboot-examples/process-decisions-springboot/src/main/java/org/kie/kogito/traffic/LicenseValidationService.java rename to kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/LicenseValidationService.java index 53fd44ed58..2423a7c362 100644 --- a/kogito-springboot-examples/process-decisions-springboot/src/main/java/org/kie/kogito/traffic/LicenseValidationService.java +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/LicenseValidationService.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.util.Date; diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/TrafficViolationResponse.java b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/TrafficViolationResponse.java similarity index 97% rename from kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/TrafficViolationResponse.java rename to kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/TrafficViolationResponse.java index c5945896ca..25445edd93 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/TrafficViolationResponse.java +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/TrafficViolationResponse.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/TrafficViolationRestClient.java b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/TrafficViolationRestClient.java similarity index 97% rename from kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/TrafficViolationRestClient.java rename to kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/TrafficViolationRestClient.java index 7c6945cbf2..bd6a3b6df7 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/TrafficViolationRestClient.java +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/TrafficViolationRestClient.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.util.Map; diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/TrafficViolationRestService.java b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/TrafficViolationRestService.java similarity index 97% rename from kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/TrafficViolationRestService.java rename to kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/TrafficViolationRestService.java index 881e999698..78513c1667 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/TrafficViolationRestService.java +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/TrafficViolationRestService.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.util.HashMap; import java.util.Map; diff --git a/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/kie/kogito/traffic/Violation.java b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/Violation.java similarity index 98% rename from kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/kie/kogito/traffic/Violation.java rename to kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/Violation.java index 56446af2d2..232567b0e0 100644 --- a/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/kie/kogito/traffic/Violation.java +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/acme/traffic/Violation.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.math.BigDecimal; import java.util.Date; diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/LicenseValidationService.drl b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/LicenseValidationService.drl index 799c78abd4..06c7bc2412 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/LicenseValidationService.drl +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/LicenseValidationService.drl @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic +package org.acme.traffic unit LicenseValidationService diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/application.properties b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/application.properties index afbd25e4eb..023d701430 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/application.properties +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/application.properties @@ -4,5 +4,5 @@ quarkus.swagger-ui.always-include=true # REST -org.kie.kogito.traffic.TrafficViolationRestClient/mp-rest/url=http://localhost:8080/ -org.kie.kogito.traffic.LicenseValidationRestClient/mp-rest/url=http://localhost:8080/ \ No newline at end of file +org.acme.traffic.TrafficViolationRestClient/mp-rest/url=http://localhost:8080/ +org.acme.traffic.LicenseValidationRestClient/mp-rest/url=http://localhost:8080/ \ No newline at end of file diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/traffic-rules-dmn-service-task.bpmn b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/traffic-rules-dmn-service-task.bpmn index 7ba4f69c61..9323dd6cb3 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/traffic-rules-dmn-service-task.bpmn +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/traffic-rules-dmn-service-task.bpmn @@ -1,25 +1,25 @@ - - - + + + - - - - - - - + + + + + + + - + - + - + @@ -92,7 +92,7 @@ - + _8A36870E-651D-4E0A-B345-D5CFF2182F0F _E183B890-1419-4A36-B1DC-257EB0B333E0 - - - + + + _BB50D380-3FE4-4B5E-9732-6E7E2B704BA0_driverInputX _BB50D380-3FE4-4B5E-9732-6E7E2B704BA0_violationInputX @@ -126,7 +126,7 @@ DMN]]> trafficViolationResponse - + _A19108FE-08A2-4E80-B7A8-0254C49209A6 _729FBA6E-72AB-4541-9965-DB7CDCD2E0A9 - - + + _8D1A7055-57B3-4C74-A502-2AB715599268_driverInputX @@ -162,7 +162,7 @@ DRL]]> _044AA388-325A-45DE-B783-4F48421B788B _8A36870E-651D-4E0A-B345-D5CFF2182F0F - + @@ -172,7 +172,7 @@ DRL]]> _A19108FE-08A2-4E80-B7A8-0254C49209A6 - + _93FFD317-476E-4624-84EF-994617572560_driverIdInputX diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/traffic-rules-dmn-wih.bpmn b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/traffic-rules-dmn-wih.bpmn index 6aa79d7bdf..0f1767de1f 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/traffic-rules-dmn-wih.bpmn +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/resources/traffic-rules-dmn-wih.bpmn @@ -1,32 +1,32 @@ - - - + + + - + - + - + - - + + - - + + - + @@ -108,14 +108,14 @@ DMN]]> - - + + - + _38F4877F-50AD-4500-98E1-9B4FD3972291_MethodInputX _38F4877F-50AD-4500-98E1-9B4FD3972291_UrlInputX @@ -177,14 +177,14 @@ DRL]]> - + - + _D8D9E6BA-5940-41F5-BF3A-1A08ADA72A4C_MethodInputX _D8D9E6BA-5940-41F5-BF3A-1A08ADA72A4C_UrlInputX @@ -245,7 +245,7 @@ DRL]]> _8A36870E-651D-4E0A-B345-D5CFF2182F0F _044AA388-325A-45DE-B783-4F48421B788B - + @@ -255,7 +255,7 @@ DRL]]> _A19108FE-08A2-4E80-B7A8-0254C49209A6 - + _93FFD317-476E-4624-84EF-994617572560_driverIdInputX diff --git a/kogito-quarkus-examples/process-decisions-quarkus/src/test/java/org/kie/kogito/traffic/NativeTrafficProcessIT.java b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/test/java/org/acme/traffic/NativeTrafficProcessIT.java similarity index 95% rename from kogito-quarkus-examples/process-decisions-quarkus/src/test/java/org/kie/kogito/traffic/NativeTrafficProcessIT.java rename to kogito-quarkus-examples/process-decisions-rest-quarkus/src/test/java/org/acme/traffic/NativeTrafficProcessIT.java index 1697330392..edb541ac0c 100644 --- a/kogito-quarkus-examples/process-decisions-quarkus/src/test/java/org/kie/kogito/traffic/NativeTrafficProcessIT.java +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/test/java/org/acme/traffic/NativeTrafficProcessIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import io.quarkus.test.junit.NativeImageTest; diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/test/java/org/kie/kogito/traffic/TrafficProcessIT.java b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/test/java/org/acme/traffic/TrafficProcessIT.java similarity index 98% rename from kogito-quarkus-examples/process-decisions-rest-quarkus/src/test/java/org/kie/kogito/traffic/TrafficProcessIT.java rename to kogito-quarkus-examples/process-decisions-rest-quarkus/src/test/java/org/acme/traffic/TrafficProcessIT.java index c61d2d2cf7..ee80c83d3c 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/test/java/org/kie/kogito/traffic/TrafficProcessIT.java +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/src/test/java/org/acme/traffic/TrafficProcessIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.math.BigDecimal; import java.util.HashMap; diff --git a/kogito-quarkus-examples/process-decisions-rules-quarkus/README.md b/kogito-quarkus-examples/process-decisions-rules-quarkus/README.md index 811b7c9406..20b50f7b23 100644 --- a/kogito-quarkus-examples/process-decisions-rules-quarkus/README.md +++ b/kogito-quarkus-examples/process-decisions-rules-quarkus/README.md @@ -32,13 +32,13 @@ These are the properties defined for the process, the most important one in this * #### Proces Variables -The variables used in the process itself, but the focus in this example are the classes that are used to define the POJOs to interact the process with decisions, that are the [Violation](src/main/java/org/kie/kogito/traffic/Violation.java), [Driver](src/main/java/org/kie/kogito/traffic/Driver.java), [Fine](src/main/java/org/kie/kogito/traffic/Fine.java). +The variables used in the process itself, but the focus in this example are the classes that are used to define the POJOs to interact the process with decisions, that are the [Violation](src/main/java/org/acme/traffic/Violation.java), [Driver](src/main/java/org/acme/traffic/Driver.java), [Fine](src/main/java/org/acme/traffic/Fine.java). **Mapping data from Process to/from DMN** -It is important to mention DMN for instance can define the Data Type in its structure, but we can align all attributes names in a Java class that is used as process variables, in case the attribute names contain spaces or are not following java conventions we can use [Jackson](https://github.com/FasterXML/jackson) annotations to make the process variable POJOs aligned with DMN data types, for instance in the [Violation](src/main/java/org/kie/kogito/traffic/Violation.java) class, where it is mapped the `speedLimit` attribute as `Speed Limit` using `@JsonProperty` annotation, in this case, this attribute from the process variable with Violation can be seamlessly integrated Violation Data Type defined in DMN. +It is important to mention DMN for instance can define the Data Type in its structure, but we can align all attributes names in a Java class that is used as process variables, in case the attribute names contain spaces or are not following java conventions we can use [Jackson](https://github.com/FasterXML/jackson) annotations to make the process variable POJOs aligned with DMN data types, for instance in the [Violation](src/main/java/org/acme/traffic/Violation.java) class, where it is mapped the `speedLimit` attribute as `Speed Limit` using `@JsonProperty` annotation, in this case, this attribute from the process variable with Violation can be seamlessly integrated Violation Data Type defined in DMN. **Violation Data Type in DMN** @@ -49,7 +49,7 @@ It is important to mention DMN for instance can define the Data Type in its stru Fetch for driver information, in this implementation it is just mocking a result, that simply fill with an expired license date in case the `driverId` is an odd number and with a valid date in case of an even number. In a real use case, it could be performing an external call to a service or a database to get this information. -The service task implementation is done in the [DriverService](src/main/java/org/kie/kogito/traffic/DriverService.java) class. +The service task implementation is done in the [DriverService](src/main/java/org/acme/traffic/DriverService.java) class. In the data assignment the input is the `driverId` and output is the `driver` variable, filled with all driver information. @@ -59,7 +59,7 @@ Represents the task to do the call to the DRL service. -The properties to be set are mainly the `Rule Language`that should be set as `DRL` and the `Rule Flow Group` with `unit:` + `[the FQCN of the Rule Unit Data class]`, in this case [org.kie.kogito.traffic.licensevalidation.LicenseValidationService](src/main/java/org/kie/kogito/traffic/LicenseValidationService.java). +The properties to be set are mainly the `Rule Language`that should be set as `DRL` and the `Rule Flow Group` with `unit:` + `[the FQCN of the Rule Unit Data class]`, in this case [licensevalidation.org.acme.traffic.LicenseValidationService](src/main/java/org/acme/traffic/licensevalidation/LicenseValidationService.java). @@ -95,7 +95,7 @@ Just an example task where it could be performed any action based on the conditi This decision consistis in rules which are evaluated to check if a driver's license is expired or not according to the expiration date and thus populating the result in the information in the driver variable. -The DRL file where this Rule Unit is declared is [LicenseValidationService.drl](src/main/resources/LicenseValidationService.drl) and the the Java class that contains the Rule Unit Data is [LicenseValidationService](src/main/java/org/kie/kogito/traffic/LicenseValidationService.java). +The DRL file where this Rule Unit is declared is [LicenseValidationService.drl](src/main/resources/LicenseValidationService.drl) and the the Java class that contains the Rule Unit Data is [LicenseValidationService](src/main/java/org/acme/traffic/LicenseValidationService.java). ### Traffic Violation - DMN diff --git a/kogito-quarkus-examples/process-decisions-rules-quarkus/pom.xml b/kogito-quarkus-examples/process-decisions-rules-quarkus/pom.xml index d80e3fe235..90b2240e4f 100644 --- a/kogito-quarkus-examples/process-decisions-rules-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-decisions-rules-quarkus/pom.xml @@ -1,13 +1,13 @@ - 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-decisions-rules-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process :: Decisions :: Rules :: Quarkus Process with DRL, DMN and DRL integration - Quarkus @@ -19,7 +19,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -38,6 +49,7 @@ + io.quarkus @@ -83,6 +95,49 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + ${project.build.directory}/${project.build.finalName}-runner + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + \ No newline at end of file diff --git a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/kie/kogito/traffic/DriverService.java b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/DriverService.java similarity index 94% rename from kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/kie/kogito/traffic/DriverService.java rename to kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/DriverService.java index 38ebb18de8..bc329fc09f 100644 --- a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/kie/kogito/traffic/DriverService.java +++ b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/DriverService.java @@ -14,14 +14,14 @@ * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.time.ZonedDateTime; import java.util.Date; import javax.enterprise.context.ApplicationScoped; -import org.kie.kogito.traffic.licensevalidation.Driver; +import org.acme.traffic.licensevalidation.Driver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/kie/kogito/traffic/Fine.java b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/Fine.java similarity index 97% rename from kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/kie/kogito/traffic/Fine.java rename to kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/Fine.java index 4b6873829e..d82495c3d1 100644 --- a/kogito-quarkus-examples/process-decisions-quarkus/src/main/java/org/kie/kogito/traffic/Fine.java +++ b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/Fine.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/Violation.java b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/Violation.java similarity index 98% rename from kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/Violation.java rename to kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/Violation.java index 56446af2d2..232567b0e0 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/main/java/org/kie/kogito/traffic/Violation.java +++ b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/Violation.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.math.BigDecimal; import java.util.Date; diff --git a/kogito-springboot-examples/process-decisions-rules-springboot/src/main/java/org/kie/kogito/traffic/licensevalidated/LicenseValidatedService.java b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/licensevalidated/LicenseValidatedService.java similarity index 96% rename from kogito-springboot-examples/process-decisions-rules-springboot/src/main/java/org/kie/kogito/traffic/licensevalidated/LicenseValidatedService.java rename to kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/licensevalidated/LicenseValidatedService.java index b6a0374e9d..b37b889f3a 100644 --- a/kogito-springboot-examples/process-decisions-rules-springboot/src/main/java/org/kie/kogito/traffic/licensevalidated/LicenseValidatedService.java +++ b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/licensevalidated/LicenseValidatedService.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic.licensevalidated; +package org.acme.traffic.licensevalidated; import java.util.Date; diff --git a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/kie/kogito/traffic/licensevalidated/Validated.java b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/licensevalidated/Validated.java similarity index 96% rename from kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/kie/kogito/traffic/licensevalidated/Validated.java rename to kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/licensevalidated/Validated.java index 90c51f09e3..9f8a843e96 100644 --- a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/kie/kogito/traffic/licensevalidated/Validated.java +++ b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/licensevalidated/Validated.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.kogito.traffic.licensevalidated; +package org.acme.traffic.licensevalidated; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/kogito-springboot-examples/process-decisions-rules-springboot/src/main/java/org/kie/kogito/traffic/licensevalidation/Driver.java b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/licensevalidation/Driver.java similarity index 98% rename from kogito-springboot-examples/process-decisions-rules-springboot/src/main/java/org/kie/kogito/traffic/licensevalidation/Driver.java rename to kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/licensevalidation/Driver.java index 6ee8bfbb04..992738b4f0 100644 --- a/kogito-springboot-examples/process-decisions-rules-springboot/src/main/java/org/kie/kogito/traffic/licensevalidation/Driver.java +++ b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/licensevalidation/Driver.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.kogito.traffic.licensevalidation; +package org.acme.traffic.licensevalidation; import java.util.Date; diff --git a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/licensevalidation/LicenseValidationService.java b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/licensevalidation/LicenseValidationService.java new file mode 100644 index 0000000000..7d4488af6b --- /dev/null +++ b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/acme/traffic/licensevalidation/LicenseValidationService.java @@ -0,0 +1,46 @@ +/* + * Copyright 2020 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.acme.traffic.licensevalidation; + +import java.util.Date; + +import org.drools.ruleunits.api.DataSource; +import org.drools.ruleunits.api.RuleUnitData; +import org.drools.ruleunits.api.SingletonStore; + +public class LicenseValidationService implements RuleUnitData { + private SingletonStore driver; + + public LicenseValidationService() { + this(DataSource.createSingleton()); + } + + public LicenseValidationService(SingletonStore driver) { + this.driver = driver; + } + + public void setDriver(SingletonStore driver) { + this.driver = driver; + } + + public SingletonStore getDriver() { + return driver; + } + + public Date getCurrentTime() { + return new Date(); + } +} diff --git a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/kie/kogito/traffic/licensevalidation/LicenseValidationService.java b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/kie/kogito/traffic/licensevalidation/LicenseValidationService.java deleted file mode 100644 index 2d56c89eea..0000000000 --- a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/java/org/kie/kogito/traffic/licensevalidation/LicenseValidationService.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2020 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.kie.kogito.traffic.licensevalidation; - -import java.util.Date; - -import org.drools.ruleunits.api.DataSource; -import org.drools.ruleunits.api.RuleUnitData; -import org.drools.ruleunits.api.SingletonStore; - -public class LicenseValidationService implements RuleUnitData { - private SingletonStore driver; - - public LicenseValidationService() { - this(DataSource.createSingleton()); - } - - public LicenseValidationService(SingletonStore driver) { - this.driver = driver; - } - - public void setDriver(SingletonStore driver) { - this.driver = driver; - } - - public SingletonStore getDriver() { - return driver; - } - - public Date getCurrentTime() { - return new Date(); - } -} diff --git a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/resources/LicenseValidatedService.drl b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/resources/LicenseValidatedService.drl index 9e91dd8bb8..cca71a9a6e 100644 --- a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/resources/LicenseValidatedService.drl +++ b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/resources/LicenseValidatedService.drl @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic.licensevalidated +package org.acme.traffic.licensevalidated unit LicenseValidatedService diff --git a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/resources/LicenseValidationService.drl b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/resources/LicenseValidationService.drl index 324866bfa3..1b4622d9a3 100644 --- a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/resources/LicenseValidationService.drl +++ b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/resources/LicenseValidationService.drl @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic.licensevalidation +package org.acme.traffic.licensevalidation unit LicenseValidationService diff --git a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/resources/traffic-rules-dmn.bpmn b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/resources/traffic-rules-dmn.bpmn index bb3c183e1e..ee189729e5 100644 --- a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/resources/traffic-rules-dmn.bpmn +++ b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/main/resources/traffic-rules-dmn.bpmn @@ -1,36 +1,36 @@ - - - - + + + + - - - - + + + + - + - - + + - - - + + + - + @@ -114,7 +114,7 @@ - + _BB963FF4-CF17-4CA0-A727-9AFC2BE17C29 _E7EF578E-3735-42D9-BF0C-8CCBF398D41C - - + + _3F719C8E-DA3F-46F8-B8F2-5F04DB132E9C_validatedInputX @@ -155,7 +155,7 @@ DRL]]> _D2252EFF-5EC4-4D61-B797-653F71652627 _044AA388-325A-45DE-B783-4F48421B788B - + _A19108FE-08A2-4E80-B7A8-0254C49209A6 _D3E2F4B7-7739-452F-8D55-0C4F169D4A44 - - + + _95EFED1F-73F8-47E7-9604-A81EFE5DE8F5_driverInputX @@ -183,7 +183,7 @@ DRL]]> driver - + @@ -193,7 +193,7 @@ DRL]]> _A19108FE-08A2-4E80-B7A8-0254C49209A6 - + _93FFD317-476E-4624-84EF-994617572560_driverIdInputX @@ -261,10 +261,10 @@ DMN]]> - - - - + + + + _B076DF7E-91A5-47C7-B3FC-2C2EC06E5941_namespaceInputX _B076DF7E-91A5-47C7-B3FC-2C2EC06E5941_decisionInputX diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/test/java/org/kie/kogito/traffic/NativeTrafficProcessIT.java b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/test/java/org/acme/traffic/NativeTrafficProcessIT.java similarity index 95% rename from kogito-quarkus-examples/process-decisions-rest-quarkus/src/test/java/org/kie/kogito/traffic/NativeTrafficProcessIT.java rename to kogito-quarkus-examples/process-decisions-rules-quarkus/src/test/java/org/acme/traffic/NativeTrafficProcessIT.java index 1697330392..edb541ac0c 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/src/test/java/org/kie/kogito/traffic/NativeTrafficProcessIT.java +++ b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/test/java/org/acme/traffic/NativeTrafficProcessIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import io.quarkus.test.junit.NativeImageTest; diff --git a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/test/java/org/kie/kogito/traffic/TrafficProcessIT.java b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/test/java/org/acme/traffic/TrafficProcessIT.java similarity index 98% rename from kogito-quarkus-examples/process-decisions-rules-quarkus/src/test/java/org/kie/kogito/traffic/TrafficProcessIT.java rename to kogito-quarkus-examples/process-decisions-rules-quarkus/src/test/java/org/acme/traffic/TrafficProcessIT.java index 61a3400fdf..1d6f27e130 100644 --- a/kogito-quarkus-examples/process-decisions-rules-quarkus/src/test/java/org/kie/kogito/traffic/TrafficProcessIT.java +++ b/kogito-quarkus-examples/process-decisions-rules-quarkus/src/test/java/org/acme/traffic/TrafficProcessIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.traffic; +package org.acme.traffic; import java.math.BigDecimal; import java.util.HashMap; diff --git a/kogito-quarkus-examples/process-error-handling/README.md b/kogito-quarkus-examples/process-error-handling/README.md index 862062c7bd..117cc066f8 100644 --- a/kogito-quarkus-examples/process-error-handling/README.md +++ b/kogito-quarkus-examples/process-error-handling/README.md @@ -4,7 +4,7 @@ A simple usage scenario of the Error Handling Strategy -The main process is +The main process is ![hello error](docs/images/hello-error-process.png) @@ -12,22 +12,29 @@ Here the logic: - `Custom Task` is a custom WorkItemHandler, the simple implementation is - - Read the `Input` parameter - - Return the `Result` string with the concatenation of `Hello ` and the value of the `Input` - - Whether `Input` matches one of the following values `RETRY`, `COMPLETE`, `ABORT` or `RETHROW`; it throws a `ProcessWorkItemHandlerException` initialized with the corresponding strategy + - Read the `Input` parameter + - Return the `Result` string with the concatenation of `Hello ` and the value of the `Input` + - Whether `Input` matches one of the following values `RETRY`, `COMPLETE`, `ABORT` or `RETHROW`; it throws + a `ProcessWorkItemHandlerException` initialized with the corresponding strategy - `Print Message` is script which print out the outcome of the previous Task (stored in `message` variable). -- Finally, an event sub-process is defined to catch all exceptions that reach the main process instance and to print out `Catch all` in the console. +- Finally, an event sub-process is defined to catch all exceptions that reach the main process instance and to print + out `Catch all` in the console. In short, it is a sophisticated version of a **Hello World** process! -In order to probe the _Error Handling_ capabilities, you have to trigger the process with the **name** of the error handling strategy. -Regardless the strategy, the sub-process `error-handling` will be executed, then the main process execution is influenced by the strategy: - -- `RETRY`: the `Custom Task` is executed again, the `Input` parameter of the task is refreshed using the outcome of the `error-handling` process. -- `COMPLETE`: the `Custom Task` is skipped, the `Result` parameter of the task is set with the corresponding outcome of the `error-handling` process. -- `ABORT`: the `Custom Task` is aborted and the process instance continues the execution. Pay attention: if the outcome of the task is essential for the following tasks the process is going to fail later). +In order to probe the _Error Handling_ capabilities, you have to trigger the process with the **name** of the error +handling strategy. +Regardless the strategy, the sub-process `error-handling` will be executed, then the main process execution is +influenced by the strategy: + +- `RETRY`: the `Custom Task` is executed again, the `Input` parameter of the task is refreshed using the outcome of + the `error-handling` process. +- `COMPLETE`: the `Custom Task` is skipped, the `Result` parameter of the task is set with the corresponding outcome of + the `error-handling` process. +- `ABORT`: the `Custom Task` is aborted and the process instance continues the execution. Pay attention: if the outcome + of the task is essential for the following tasks the process is going to fail later). - `RETHROW`: the `Custom Task` is aborted and the exception is thrown back at the task scope. The `error-handling` sub-process initiates a user task which goal is to repair the situation. @@ -37,7 +44,8 @@ The process design leaves the user in full control: - Analyze the error message to understand the root cause of the problem - Override the default _error handling strategy_ - In case of `RETRY`, they can provide a different **input** parameter for the task -- In case of `COMPLETE`, they can set the output parameter **result** for the task, in other words, the user replaces the implementation of the task by simulating a response +- In case of `COMPLETE`, they can set the output parameter **result** for the task, in other words, the user replaces + the implementation of the task by simulating a response Here the process model: @@ -46,9 +54,10 @@ Here the process model: The `Init` script calls the corresponding method of the class `ErrorHandlingScript` and there it performs the following: - Logs the process variables -- Store the _error handling strategy_ in the `strategy` process variable +- Store the _error handling strategy_ in the `strategy` process variable -The `Apply` script calls the corresponding method of the class `ErrorHandlingScript` and there it performs the following: +The `Apply` script calls the corresponding method of the class `ErrorHandlingScript` and there it performs the +following: - Read the `strategy` variable - Override the `Error` variable with a new `ProcessWorkItemHandlerException` initialized with the new strategy @@ -58,15 +67,18 @@ The `Apply` script calls the corresponding method of the class `ErrorHandlingScr ### Prerequisites You will need: - - Java 11+ installed - - Environment variable JAVA_HOME set accordingly - - Maven 3.8.6+ installed + +- Java 11+ installed +- Environment variable JAVA_HOME set accordingly +- Maven 3.8.6+ installed When using native image compilation, you will also need: - - GraalVM 19.3+ installed - - Environment variable GRAALVM_HOME set accordingly - - GraalVM native image needs as well native-image extension: https://www.graalvm.org/reference-manual/native-image/ - - Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be installed too, please refer to GraalVM installation documentation for more details. + +- GraalVM 19.3+ installed +- Environment variable GRAALVM_HOME set accordingly +- GraalVM native image needs as well native-image extension: https://www.graalvm.org/reference-manual/native-image/ +- Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be + installed too, please refer to GraalVM installation documentation for more details. ### Compile and Run in Local Dev Mode @@ -74,7 +86,8 @@ When using native image compilation, you will also need: mvn clean compile quarkus:dev ``` -NOTE: With dev mode of Quarkus you can take advantage of hot reload for business assets like processes, rules, decision tables and java code. No need to redeploy or restart your running application. +NOTE: With dev mode of Quarkus you can take advantage of hot reload for business assets like processes, rules, decision +tables and java code. No need to redeploy or restart your running application. ### Package and Run in JVM mode @@ -91,6 +104,7 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh @@ -102,18 +116,27 @@ To run the generated native executable, generated in `target/`, execute ```sh ./target/process-error-handling-runner ``` + ### OpenAPI (Swagger) documentation + [Specification at swagger.io](https://swagger.io/docs/specification/about/) -You can take a look at the [OpenAPI definition](http://localhost:8080/openapi?format=json) - automatically generated and included in this service - to determine all available operations exposed by this service. For easy readability you can visualize the OpenAPI definition file using a UI tool like for example available [Swagger UI](https://editor.swagger.io). +You can take a look at the [OpenAPI definition](http://localhost:8080/openapi?format=json) - automatically generated and +included in this service - to determine all available operations exposed by this service. For easy readability you can +visualize the OpenAPI definition file using a UI tool like for example +available [Swagger UI](https://editor.swagger.io). In addition, various clients to interact with this service can be easily generated using this OpenAPI definition. -When running in either Quarkus Development or Native mode, we also leverage the [Quarkus OpenAPI extension](https://quarkus.io/guides/openapi-swaggerui#use-swagger-ui-for-development) that exposes [Swagger UI](http://localhost:8080/swagger-ui/) that you can use to look at available REST endpoints and send test requests. +When running in either Quarkus Development or Native mode, we also leverage +the [Quarkus OpenAPI extension](https://quarkus.io/guides/openapi-swaggerui#use-swagger-ui-for-development) that +exposes [Swagger UI](http://localhost:8080/swagger-ui/) that you can use to look at available REST endpoints and send +test requests. ### Submit a request -To make use of this application it is as simple as putting a sending request to `http://localhost:8080/hello_error` with following content +To make use of this application it is as simple as putting a sending request to `http://localhost:8080/hello_error` +with following content ```json { @@ -142,7 +165,9 @@ Response should resemble: ### Probe the RETRY strategy -> **TIP:** In the following example, we are going to show the `curl` command line. Although, a more comfortable way is using the following [REST client](https://https://marketplace.visualstudio.com/items?itemName=humao.rest-client), you can find in the project the file with all the requests: `src/test/http/error-handling.http`. +> **TIP:** In the following example, we are going to show the `curl` command line. Although, a more comfortable way is +> using the following [REST client](https://https://marketplace.visualstudio.com/items?itemName=humao.rest-client), you +> can find in the project the file with all the requests: `src/test/http/error-handling.http`. Trigger the process with any error handling strategy: @@ -200,7 +225,8 @@ In the console you should spot an output the resemble the following: Follow all the step in the previous paragraph, but complete the `Repair` task providing a different payload. -- **Complete strategy** The WIH logic is skipped but the task is marked completed, the main process proceeds picking the result provided by the `error-handling` process +- **Complete strategy** The WIH logic is skipped but the task is marked completed, the main process proceeds picking the + result provided by the `error-handling` process ```sh curl --request POST \ @@ -215,7 +241,8 @@ Follow all the step in the previous paragraph, but complete the `Repair` task pr ``` >>> message: Hello Jimmy ``` -- **Abort strategy** The WIH logic is skipped and the task is marked aborted, the main process proceeds but the `Custom Task` result is **null**. +- **Abort strategy** The WIH logic is skipped and the task is marked aborted, the main process proceeds but + the `Custom Task` result is **null**. ```sh curl --request POST \ @@ -231,7 +258,7 @@ Follow all the step in the previous paragraph, but complete the `Repair` task pr >>> message: null ``` -- **Rethrow strategy** The WIH logic is skipped and the main process get an exception +- **Rethrow strategy** The WIH logic is skipped and the main process get an exception ```sh curl --request POST \ @@ -249,4 +276,5 @@ Follow all the step in the previous paragraph, but complete the `Repair` task pr ## Deploying with Kogito Operator -In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). +In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with +the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). diff --git a/kogito-quarkus-examples/process-error-handling/mvnw b/kogito-quarkus-examples/process-error-handling/mvnw deleted file mode 100755 index d2f0ea3808..0000000000 --- a/kogito-quarkus-examples/process-error-handling/mvnw +++ /dev/null @@ -1,310 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" - else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl -o "$wrapperJarPath" "$jarUrl" -f - else - curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f - fi - - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/kogito-quarkus-examples/process-error-handling/mvnw.cmd b/kogito-quarkus-examples/process-error-handling/mvnw.cmd deleted file mode 100644 index b26ab24f03..0000000000 --- a/kogito-quarkus-examples/process-error-handling/mvnw.cmd +++ /dev/null @@ -1,182 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - -FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/kogito-quarkus-examples/process-error-handling/pom.xml b/kogito-quarkus-examples/process-error-handling/pom.xml index a8ea2e0d9c..f76e51c09a 100644 --- a/kogito-quarkus-examples/process-error-handling/pom.xml +++ b/kogito-quarkus-examples/process-error-handling/pom.xml @@ -1,14 +1,15 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-error-handling + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process Scripts With Quarkus Kogito scripts invocation - Quarkus + 2.16.10.Final quarkus-bom @@ -18,7 +19,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -37,6 +49,7 @@ + io.quarkus @@ -89,6 +102,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/process-error-handling/src/main/resources/application.properties b/kogito-quarkus-examples/process-error-handling/src/main/resources/application.properties index c7872ed3a8..9a7e670110 100644 --- a/kogito-quarkus-examples/process-error-handling/src/main/resources/application.properties +++ b/kogito-quarkus-examples/process-error-handling/src/main/resources/application.properties @@ -1,8 +1,6 @@ # Packaging # quarkus.package.type=fast-jar - quarkus.swagger-ui.always-include=true - quarkus.log.console.enable=true quarkus.log.level=INFO quarkus.log.category."org.acme".level=ALL \ No newline at end of file diff --git a/kogito-quarkus-examples/process-error-handling/src/test/http/error-handling.http b/kogito-quarkus-examples/process-error-handling/src/test/http/error-handling.http index 2a6380880f..a897ec4172 100644 --- a/kogito-quarkus-examples/process-error-handling/src/test/http/error-handling.http +++ b/kogito-quarkus-examples/process-error-handling/src/test/http/error-handling.http @@ -45,6 +45,6 @@ Accept: application/json Content-Type: application/json { - "input" : "Jimmy", - "strategy" : "RETRY" + "input": "Jimmy", + "strategy": "RETRY" } diff --git a/kogito-quarkus-examples/process-incubation-api-quarkus/pom.xml b/kogito-quarkus-examples/process-incubation-api-quarkus/pom.xml index bddd25ce0d..777dd5050b 100644 --- a/kogito-quarkus-examples/process-incubation-api-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-incubation-api-quarkus/pom.xml @@ -1,14 +1,15 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-incubation-api-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process Incubation API With Quarkus + 2.16.10.Final quarkus-bom @@ -18,7 +19,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -37,6 +49,7 @@ + io.quarkus @@ -85,6 +98,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/mvnw b/kogito-quarkus-examples/process-infinispan-persistence-quarkus/mvnw deleted file mode 100755 index d2f0ea3808..0000000000 --- a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/mvnw +++ /dev/null @@ -1,310 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" - else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl -o "$wrapperJarPath" "$jarUrl" -f - else - curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f - fi - - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/mvnw.cmd b/kogito-quarkus-examples/process-infinispan-persistence-quarkus/mvnw.cmd deleted file mode 100644 index b26ab24f03..0000000000 --- a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/mvnw.cmd +++ /dev/null @@ -1,182 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - -FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/pom.xml b/kogito-quarkus-examples/process-infinispan-persistence-quarkus/pom.xml index fdecf09f82..2889bf914a 100644 --- a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-infinispan-persistence-quarkus/pom.xml @@ -1,13 +1,13 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-infinispan-persistence-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process Infinispan Persistence Quarkus Process with Infinispan persistence - Quarkus @@ -19,7 +19,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -38,6 +49,7 @@ + io.quarkus @@ -96,6 +108,49 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + ${project.build.directory}/${project.build.finalName}-runner + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/process-kafka-avro-multi-quarkus/pom.xml b/kogito-quarkus-examples/process-kafka-avro-multi-quarkus/pom.xml index 2473da2ba2..a01eed51be 100644 --- a/kogito-quarkus-examples/process-kafka-avro-multi-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-kafka-avro-multi-quarkus/pom.xml @@ -1,15 +1,16 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-kafka-avro-multi-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process with Kafka and Quarkus, multiple channels, avro serialization Kogito with Kafka - Quarkus, using one channel per message name + 2.16.10.Final quarkus-bom @@ -19,7 +20,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -38,6 +50,7 @@ + org.kie.kogito @@ -82,7 +95,7 @@ io.quarkus quarkus-smallrye-health - + ${project.artifactId} @@ -99,6 +112,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/process-kafka-avro-multi-quarkus/src/main/resources/handle-travellers.bpmn b/kogito-quarkus-examples/process-kafka-avro-multi-quarkus/src/main/resources/handle-travellers.bpmn index 5aeaea50cd..807b5dc51a 100644 --- a/kogito-quarkus-examples/process-kafka-avro-multi-quarkus/src/main/resources/handle-travellers.bpmn +++ b/kogito-quarkus-examples/process-kafka-avro-multi-quarkus/src/main/resources/handle-travellers.bpmn @@ -14,7 +14,7 @@ - + diff --git a/kogito-quarkus-examples/process-kafka-multi-quarkus/pom.xml b/kogito-quarkus-examples/process-kafka-multi-quarkus/pom.xml index 3fa03011a6..d594ae6c4f 100644 --- a/kogito-quarkus-examples/process-kafka-multi-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-kafka-multi-quarkus/pom.xml @@ -1,15 +1,16 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-kafka-multi-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process with Kafka and Quarkus, multiple channels Kogito with Kafka - Quarkus, using one channel per message name + 2.16.10.Final quarkus-bom @@ -19,7 +20,19 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + 2.3.0 + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -38,8 +51,9 @@ + - + org.kie.kogito kogito-addons-quarkus-events-process @@ -84,6 +98,7 @@ io.cloudevents cloudevents-json-jackson + ${version.io.cloudevents} test @@ -106,6 +121,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/process-kafka-multi-quarkus/src/main/resources/handle-travellers.bpmn b/kogito-quarkus-examples/process-kafka-multi-quarkus/src/main/resources/handle-travellers.bpmn index 5aeaea50cd..807b5dc51a 100644 --- a/kogito-quarkus-examples/process-kafka-multi-quarkus/src/main/resources/handle-travellers.bpmn +++ b/kogito-quarkus-examples/process-kafka-multi-quarkus/src/main/resources/handle-travellers.bpmn @@ -14,7 +14,7 @@ - + diff --git a/kogito-quarkus-examples/process-kafka-persistence-quarkus/pom.xml b/kogito-quarkus-examples/process-kafka-persistence-quarkus/pom.xml index c0d02b120a..34e01954e2 100644 --- a/kogito-quarkus-examples/process-kafka-persistence-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-kafka-persistence-quarkus/pom.xml @@ -18,16 +18,16 @@ - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + 4.0.0 process-kafka-persistence-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process Kafka Persistence Quarkus Process with Kafka persistence - Quarkus + 2.16.10.Final quarkus-bom @@ -37,7 +37,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -56,6 +67,7 @@ + org.kie.kogito @@ -109,6 +121,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/mvnw b/kogito-quarkus-examples/process-kafka-quickstart-quarkus/mvnw deleted file mode 100755 index d2f0ea3808..0000000000 --- a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/mvnw +++ /dev/null @@ -1,310 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" - else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl -o "$wrapperJarPath" "$jarUrl" -f - else - curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f - fi - - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/mvnw.cmd b/kogito-quarkus-examples/process-kafka-quickstart-quarkus/mvnw.cmd deleted file mode 100644 index b26ab24f03..0000000000 --- a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/mvnw.cmd +++ /dev/null @@ -1,182 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - -FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/pom.xml b/kogito-quarkus-examples/process-kafka-quickstart-quarkus/pom.xml index 294e08f529..6539eedc9b 100644 --- a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-kafka-quickstart-quarkus/pom.xml @@ -1,15 +1,16 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-kafka-quickstart-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process with Kafka and Quarkus Kogito with Kafka - Quarkus + 2.16.10.Final quarkus-bom @@ -19,7 +20,19 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + 2.3.0 + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -38,6 +51,7 @@ + io.quarkus @@ -79,6 +93,7 @@ io.cloudevents cloudevents-json-jackson + ${version.io.cloudevents} test @@ -101,6 +116,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/src/main/resources/handle-travellers.bpmn b/kogito-quarkus-examples/process-kafka-quickstart-quarkus/src/main/resources/handle-travellers.bpmn index 12d61037b4..ebb321b93e 100644 --- a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/src/main/resources/handle-travellers.bpmn +++ b/kogito-quarkus-examples/process-kafka-quickstart-quarkus/src/main/resources/handle-travellers.bpmn @@ -11,7 +11,7 @@ - + diff --git a/kogito-quarkus-examples/process-knative-quickstart-quarkus/mvnw b/kogito-quarkus-examples/process-knative-quickstart-quarkus/mvnw deleted file mode 100755 index d2f0ea3808..0000000000 --- a/kogito-quarkus-examples/process-knative-quickstart-quarkus/mvnw +++ /dev/null @@ -1,310 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" - else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl -o "$wrapperJarPath" "$jarUrl" -f - else - curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f - fi - - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/kogito-quarkus-examples/process-knative-quickstart-quarkus/mvnw.cmd b/kogito-quarkus-examples/process-knative-quickstart-quarkus/mvnw.cmd deleted file mode 100644 index b26ab24f03..0000000000 --- a/kogito-quarkus-examples/process-knative-quickstart-quarkus/mvnw.cmd +++ /dev/null @@ -1,182 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - -FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/kogito-quarkus-examples/process-knative-quickstart-quarkus/pom.xml b/kogito-quarkus-examples/process-knative-quickstart-quarkus/pom.xml index 5d32855e63..b1afdfb9c8 100644 --- a/kogito-quarkus-examples/process-knative-quickstart-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-knative-quickstart-quarkus/pom.xml @@ -1,15 +1,16 @@ - 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-knative-quickstart-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process with Knative Eventing and Quarkus Kogito with Knative Eventing - Quarkus + 2.33.2 2.16.10.Final @@ -20,7 +21,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -39,6 +51,7 @@ + io.quarkus @@ -87,6 +100,7 @@ org.kie.kogito kogito-test-utils + ${version.org.kie.kogito} test @@ -119,7 +133,30 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + @@ -145,5 +182,22 @@ + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + diff --git a/kogito-quarkus-examples/process-knative-quickstart-quarkus/src/main/resources/handle-travellers.bpmn b/kogito-quarkus-examples/process-knative-quickstart-quarkus/src/main/resources/handle-travellers.bpmn index 12d61037b4..ebb321b93e 100644 --- a/kogito-quarkus-examples/process-knative-quickstart-quarkus/src/main/resources/handle-travellers.bpmn +++ b/kogito-quarkus-examples/process-knative-quickstart-quarkus/src/main/resources/handle-travellers.bpmn @@ -11,7 +11,7 @@ - + diff --git a/kogito-quarkus-examples/process-mongodb-persistence-quarkus/pom.xml b/kogito-quarkus-examples/process-mongodb-persistence-quarkus/pom.xml index 094560f07e..648584cd22 100644 --- a/kogito-quarkus-examples/process-mongodb-persistence-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-mongodb-persistence-quarkus/pom.xml @@ -1,13 +1,13 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-mongodb-persistence-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process MongoDB Persistence Quarkus Process with MongoDB persistence - Quarkus @@ -19,7 +19,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -38,6 +49,7 @@ + io.quarkus @@ -95,7 +107,31 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + ${project.build.directory}/${project.build.finalName}-runner + + + + @@ -131,5 +167,23 @@ + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + UTF-8 + UTF-8 + + diff --git a/kogito-quarkus-examples/process-monitoring-quarkus/pom.xml b/kogito-quarkus-examples/process-monitoring-quarkus/pom.xml index 1669a3fdfc..2ab53bc2b1 100755 --- a/kogito-quarkus-examples/process-monitoring-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-monitoring-quarkus/pom.xml @@ -1,13 +1,13 @@ - 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-monitoring-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process Monitoring :: Quarkus @@ -19,7 +19,19 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 3.1.0 + 11 + 11 + UTF-8 + UTF-8 + @@ -74,6 +86,7 @@ org.kie.kogito kogito-test-utils + ${version.org.kie.kogito} test @@ -104,6 +117,7 @@ maven-resources-plugin + ${version.resources.plugin} copy-resources @@ -126,6 +140,49 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + ${project.build.directory}/${project.build.finalName}-runner + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/process-monitoring-quarkus/src/main/java/org/kie/kogito/examples/quarkus/CalculationService.java b/kogito-quarkus-examples/process-monitoring-quarkus/src/main/java/org/acme/examples/quarkus/CalculationService.java similarity index 90% rename from kogito-quarkus-examples/process-monitoring-quarkus/src/main/java/org/kie/kogito/examples/quarkus/CalculationService.java rename to kogito-quarkus-examples/process-monitoring-quarkus/src/main/java/org/acme/examples/quarkus/CalculationService.java index 11dfcb97e2..1856b1cc0b 100644 --- a/kogito-quarkus-examples/process-monitoring-quarkus/src/main/java/org/kie/kogito/examples/quarkus/CalculationService.java +++ b/kogito-quarkus-examples/process-monitoring-quarkus/src/main/java/org/acme/examples/quarkus/CalculationService.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.quarkus; +package org.acme.examples.quarkus; import java.util.Random; import javax.enterprise.context.ApplicationScoped; -import org.kie.kogito.examples.quarkus.demo.Order; +import org.acme.examples.quarkus.demo.Order; @ApplicationScoped public class CalculationService { diff --git a/kogito-quarkus-examples/process-monitoring-quarkus/src/main/java/org/kie/kogito/examples/quarkus/demo/Order.java b/kogito-quarkus-examples/process-monitoring-quarkus/src/main/java/org/acme/examples/quarkus/demo/Order.java similarity index 97% rename from kogito-quarkus-examples/process-monitoring-quarkus/src/main/java/org/kie/kogito/examples/quarkus/demo/Order.java rename to kogito-quarkus-examples/process-monitoring-quarkus/src/main/java/org/acme/examples/quarkus/demo/Order.java index 03a8199193..8841baa41f 100755 --- a/kogito-quarkus-examples/process-monitoring-quarkus/src/main/java/org/kie/kogito/examples/quarkus/demo/Order.java +++ b/kogito-quarkus-examples/process-monitoring-quarkus/src/main/java/org/acme/examples/quarkus/demo/Order.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.quarkus.demo; +package org.acme.examples.quarkus.demo; public class Order implements java.io.Serializable { diff --git a/kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/org/acme/examples/quarkus/orderItems.bpmn2 b/kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/org/acme/examples/quarkus/orderItems.bpmn2 new file mode 100644 index 0000000000..5c4db0b531 --- /dev/null +++ b/kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/org/acme/examples/quarkus/orderItems.bpmn2 @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Message_1 + Message_2 + + + + + + + + + + + + + + + SequenceFlow_1 + + + + + + + + SequenceFlow_4 + + + + + + + + SequenceFlow_1 + SequenceFlow_3 + + + + + DataInput_1 + + + DataOutput_1 + + + + order + DataInput_1 + + + DataOutput_1 + order + + + + + + + + + + + SequenceFlow_3 + SequenceFlow_4 + + + + + + + + + + + + + DataInput_14 + DataInput_15 + DataInput_16 + DataInput_17 + DataInput_18 + DataInput_19 + DataInput_20 + DataInput_21 + DataInput_22 + DataInput_23 + + + + + DataInput_14 + + Verify order + DataInput_14 + + + + DataInput_15 + + 1 + DataInput_15 + + + + DataInput_16 + + + DataInput_17 + + + DataInput_18 + + + DataInput_19 + + true + DataInput_19 + + + + DataInput_20 + + + DataInput_21 + + en-UK + DataInput_21 + + + + DataInput_22 + + + order + DataInput_23 + + + + john + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/org/kie/kogito/examples/orders.bpmn2 b/kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/org/acme/examples/quarkus/orders.bpmn2 similarity index 92% rename from kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/org/kie/kogito/examples/orders.bpmn2 rename to kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/org/acme/examples/quarkus/orders.bpmn2 index 71e4146d37..5d32d890d5 100644 --- a/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/org/kie/kogito/examples/orders.bpmn2 +++ b/kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/org/acme/examples/quarkus/orders.bpmn2 @@ -1,11 +1,11 @@ - + - - - + + + @@ -45,8 +45,8 @@ _58684613-0155-48B2-8746-7675AFF24439 _8216C810-34D8-4BFA-B814-1AA01907810F - - + + _9484CB12-FE52-434C-AE9F-3C3C267D1C96_orderInputX diff --git a/kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/org/kie/kogito/examples/quarkus/orderItems.bpmn2 b/kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/org/kie/kogito/examples/quarkus/orderItems.bpmn2 deleted file mode 100644 index 9f8a81cb32..0000000000 --- a/kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/org/kie/kogito/examples/quarkus/orderItems.bpmn2 +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Message_1 - Message_2 - - - - - - - - - - - - - - - SequenceFlow_1 - - - - - - - - SequenceFlow_4 - - - - - - - - SequenceFlow_1 - SequenceFlow_3 - - - - - DataInput_1 - - - DataOutput_1 - - - - order - DataInput_1 - - - DataOutput_1 - order - - - - - - - - - - - SequenceFlow_3 - SequenceFlow_4 - - - - - - - - - - - - - DataInput_14 - DataInput_15 - DataInput_16 - DataInput_17 - DataInput_18 - DataInput_19 - DataInput_20 - DataInput_21 - DataInput_22 - DataInput_23 - - - - - DataInput_14 - - Verify order - DataInput_14 - - - - DataInput_15 - - 1 - DataInput_15 - - - - DataInput_16 - - - DataInput_17 - - - DataInput_18 - - - DataInput_19 - - true - DataInput_19 - - - - DataInput_20 - - - DataInput_21 - - en-UK - DataInput_21 - - - - DataInput_22 - - - order - DataInput_23 - - - - john - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/kie/kogito/examples/quarkus/DashboardGenerationIT.java b/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/acme/examples/quarkus/DashboardGenerationIT.java similarity index 97% rename from kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/kie/kogito/examples/quarkus/DashboardGenerationIT.java rename to kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/acme/examples/quarkus/DashboardGenerationIT.java index 2ff62553c8..46a443b26c 100644 --- a/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/kie/kogito/examples/quarkus/DashboardGenerationIT.java +++ b/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/acme/examples/quarkus/DashboardGenerationIT.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.kogito.examples.quarkus; +package org.acme.examples.quarkus; import java.util.List; diff --git a/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/kie/kogito/examples/quarkus/NativeDashboardGenerationIT.java b/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/acme/examples/quarkus/NativeDashboardGenerationIT.java similarity index 95% rename from kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/kie/kogito/examples/quarkus/NativeDashboardGenerationIT.java rename to kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/acme/examples/quarkus/NativeDashboardGenerationIT.java index 7bf4ac629a..0f99c4b3e9 100644 --- a/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/kie/kogito/examples/quarkus/NativeDashboardGenerationIT.java +++ b/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/acme/examples/quarkus/NativeDashboardGenerationIT.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.kogito.examples.quarkus; +package org.acme.examples.quarkus; import io.quarkus.test.junit.NativeImageTest; diff --git a/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/kie/kogito/examples/quarkus/ProcessMetricsTest.java b/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/acme/examples/quarkus/ProcessMetricsTest.java similarity index 89% rename from kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/kie/kogito/examples/quarkus/ProcessMetricsTest.java rename to kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/acme/examples/quarkus/ProcessMetricsTest.java index a51cd75eee..eae8abf64d 100644 --- a/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/kie/kogito/examples/quarkus/ProcessMetricsTest.java +++ b/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/acme/examples/quarkus/ProcessMetricsTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.kie.kogito.examples.quarkus; +package org.acme.examples.quarkus; import java.util.HashMap; import java.util.Map; @@ -22,10 +22,10 @@ import javax.inject.Inject; import javax.inject.Named; +import org.acme.examples.quarkus.demo.Order; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.kie.kogito.Model; -import org.kie.kogito.examples.quarkus.demo.Order; import org.kie.kogito.process.Process; import org.kie.kogito.process.ProcessInstance; @@ -91,13 +91,13 @@ public void testProcessMetricsQuarkus() { String.format("kogito_process_instance_running_total{app_id=\"default-process-monitoring-listener\",artifactId=\"%s\",process_id=\"demo.orderItems\",version=\"%s\"} 1.0", PROJECT_ARTIFACT_ID, PROJECT_VERSION))) .body(containsString( - String.format("kogito_work_item_duration_seconds_max{artifactId=\"%s\",name=\"org.kie.kogito.examples.quarkus.CalculationService_calculateTotal_3_Handler\",version=\"%s\"}", + String.format("kogito_work_item_duration_seconds_max{artifactId=\"%s\",name=\"org.acme.examples.quarkus.CalculationService_calculateTotal_3_Handler\",version=\"%s\"}", PROJECT_ARTIFACT_ID, PROJECT_VERSION))) .body(containsString( - String.format("kogito_work_item_duration_seconds_count{artifactId=\"%s\",name=\"org.kie.kogito.examples.quarkus.CalculationService_calculateTotal_3_Handler\",version=\"%s\"}", + String.format("kogito_work_item_duration_seconds_count{artifactId=\"%s\",name=\"org.acme.examples.quarkus.CalculationService_calculateTotal_3_Handler\",version=\"%s\"}", PROJECT_ARTIFACT_ID, PROJECT_VERSION))) .body(containsString( - String.format("kogito_work_item_duration_seconds_sum{artifactId=\"%s\",name=\"org.kie.kogito.examples.quarkus.CalculationService_calculateTotal_3_Handler\",version=\"%s\"}", + String.format("kogito_work_item_duration_seconds_sum{artifactId=\"%s\",name=\"org.acme.examples.quarkus.CalculationService_calculateTotal_3_Handler\",version=\"%s\"}", PROJECT_ARTIFACT_ID, PROJECT_VERSION))); } } diff --git a/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/kie/kogito/examples/quarkus/ProjectMetadataProvider.java b/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/acme/examples/quarkus/ProjectMetadataProvider.java similarity index 97% rename from kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/kie/kogito/examples/quarkus/ProjectMetadataProvider.java rename to kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/acme/examples/quarkus/ProjectMetadataProvider.java index bd1570570f..aa2a309aeb 100644 --- a/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/kie/kogito/examples/quarkus/ProjectMetadataProvider.java +++ b/kogito-quarkus-examples/process-monitoring-quarkus/src/test/java/org/acme/examples/quarkus/ProjectMetadataProvider.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.quarkus; +package org.acme.examples.quarkus; import java.io.IOException; import java.util.Properties; diff --git a/kogito-quarkus-examples/process-outbox-mongodb-quarkus/docker-compose.yml b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/docker-compose.yml index 38f5a11923..127f8b7b2d 100644 --- a/kogito-quarkus-examples/process-outbox-mongodb-quarkus/docker-compose.yml +++ b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/docker-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '2.0' services: kafka: image: vectorized/redpanda:v21.11.8 @@ -73,7 +73,7 @@ services: - KAFKA_HOST=kafka:29092 - CONNECT_HOST=connect:8083 kogito: - image: org.kie.kogito.examples/process-outbox-mongodb-quarkus:1.0 + image: org.acme.examples/process-outbox-mongodb-quarkus:1.0 ports: - "8080:8080" links: diff --git a/kogito-quarkus-examples/process-outbox-mongodb-quarkus/pom.xml b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/pom.xml index 47aa6727e5..b8024321b0 100644 --- a/kogito-quarkus-examples/process-outbox-mongodb-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/pom.xml @@ -3,13 +3,11 @@ 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"> 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - process-outbox-mongodb-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process Transactional Outbox :: MongoDB and Quarkus Process with Transactional Outbox - MongoDB and Quarkus @@ -23,6 +21,14 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + 1.7.36 + 2.8.0 + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 @@ -74,6 +80,7 @@ org.slf4j slf4j-simple + ${version.org.slf4j} test @@ -95,6 +102,7 @@ com.jayway.jsonpath json-path + ${version.com.jayway.jsonpath} test @@ -114,7 +122,49 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/java/org/kie/kogito/examples/CalculationService.java b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/java/org/acme/examples/CalculationService.java similarity index 92% rename from kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/java/org/kie/kogito/examples/CalculationService.java rename to kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/java/org/acme/examples/CalculationService.java index fc2e8fee76..86eae23521 100644 --- a/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/java/org/kie/kogito/examples/CalculationService.java +++ b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/java/org/acme/examples/CalculationService.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; import java.util.Random; import javax.enterprise.context.ApplicationScoped; -import org.kie.kogito.examples.demo.Order; +import org.acme.examples.demo.Order; @ApplicationScoped public class CalculationService { diff --git a/kogito-springboot-examples/process-outbox-mongodb-springboot/src/main/java/org/kie/kogito/examples/PersonValidationService.java b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/java/org/acme/examples/PersonValidationService.java similarity index 92% rename from kogito-springboot-examples/process-outbox-mongodb-springboot/src/main/java/org/kie/kogito/examples/PersonValidationService.java rename to kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/java/org/acme/examples/PersonValidationService.java index af854584cb..a9896bbeb9 100644 --- a/kogito-springboot-examples/process-outbox-mongodb-springboot/src/main/java/org/kie/kogito/examples/PersonValidationService.java +++ b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/java/org/acme/examples/PersonValidationService.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; +import org.acme.examples.demo.Person; import org.drools.ruleunits.api.DataSource; import org.drools.ruleunits.api.DataStore; import org.drools.ruleunits.api.RuleUnitData; -import org.kie.kogito.examples.demo.Person; public class PersonValidationService implements RuleUnitData { private DataStore persons = DataSource.createStore(); diff --git a/kogito-springboot-examples/process-outbox-mongodb-springboot/src/main/java/org/kie/kogito/examples/demo/Order.java b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/java/org/acme/examples/demo/Order.java similarity index 97% rename from kogito-springboot-examples/process-outbox-mongodb-springboot/src/main/java/org/kie/kogito/examples/demo/Order.java rename to kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/java/org/acme/examples/demo/Order.java index 753b87aecd..5ef3a795e9 100755 --- a/kogito-springboot-examples/process-outbox-mongodb-springboot/src/main/java/org/kie/kogito/examples/demo/Order.java +++ b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/java/org/acme/examples/demo/Order.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.demo; +package org.acme.examples.demo; public class Order implements java.io.Serializable { diff --git a/kogito-springboot-examples/process-outbox-mongodb-springboot/src/main/java/org/kie/kogito/examples/demo/Person.java b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/java/org/acme/examples/demo/Person.java similarity index 97% rename from kogito-springboot-examples/process-outbox-mongodb-springboot/src/main/java/org/kie/kogito/examples/demo/Person.java rename to kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/java/org/acme/examples/demo/Person.java index c38f75fe3c..dad4622b65 100644 --- a/kogito-springboot-examples/process-outbox-mongodb-springboot/src/main/java/org/kie/kogito/examples/demo/Person.java +++ b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/java/org/acme/examples/demo/Person.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.demo; +package org.acme.examples.demo; import java.io.Serializable; diff --git a/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/application.properties b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/application.properties index 29295e3600..af01fe35bf 100644 --- a/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/application.properties +++ b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/application.properties @@ -12,6 +12,6 @@ kogito.events.database=kogito quarkus.http.cors=true quarkus.container-image.build=true -quarkus.container-image.group=org.kie.kogito.examples +quarkus.container-image.group=org.acme.examples quarkus.container-image.name=process-outbox-mongodb-quarkus quarkus.container-image.tag=1.0 \ No newline at end of file diff --git a/kogito-springboot-examples/process-outbox-mongodb-springboot/src/main/resources/org/kie/kogito/examples/PersonValidationService.drl b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/org/acme/examples/PersonValidationService.drl similarity index 90% rename from kogito-springboot-examples/process-outbox-mongodb-springboot/src/main/resources/org/kie/kogito/examples/PersonValidationService.drl rename to kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/org/acme/examples/PersonValidationService.drl index 81e156389c..b0b311d775 100644 --- a/kogito-springboot-examples/process-outbox-mongodb-springboot/src/main/resources/org/kie/kogito/examples/PersonValidationService.drl +++ b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/org/acme/examples/PersonValidationService.drl @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples +package org.acme.examples unit PersonValidationService -import org.kie.kogito.examples.demo.Person; +import org.acme.examples.demo.Person; rule "Is adult" when diff --git a/kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/kie/kogito/examples/orderItems.bpmn2 b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/org/acme/examples/orderItems.bpmn2 similarity index 96% rename from kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/kie/kogito/examples/orderItems.bpmn2 rename to kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/org/acme/examples/orderItems.bpmn2 index 9a3df852b4..fe6dbd00e8 100644 --- a/kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/kie/kogito/examples/orderItems.bpmn2 +++ b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/org/acme/examples/orderItems.bpmn2 @@ -1,7 +1,7 @@ - + @@ -11,9 +11,9 @@ - + - + @@ -31,15 +31,15 @@ - + Message_1 Message_2 - + - + diff --git a/kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/kie/kogito/examples/orders.bpmn2 b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/org/acme/examples/orders.bpmn2 similarity index 92% rename from kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/kie/kogito/examples/orders.bpmn2 rename to kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/org/acme/examples/orders.bpmn2 index 71e4146d37..998e93cb78 100644 --- a/kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/kie/kogito/examples/orders.bpmn2 +++ b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/org/acme/examples/orders.bpmn2 @@ -1,11 +1,11 @@ - + - - - + + + @@ -45,8 +45,8 @@ _58684613-0155-48B2-8746-7675AFF24439 _8216C810-34D8-4BFA-B814-1AA01907810F - - + + _9484CB12-FE52-434C-AE9F-3C3C267D1C96_orderInputX diff --git a/kogito-springboot-examples/process-outbox-mongodb-springboot/src/main/resources/org/kie/kogito/examples/persons.bpmn2 b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/org/acme/examples/persons.bpmn2 similarity index 93% rename from kogito-springboot-examples/process-outbox-mongodb-springboot/src/main/resources/org/kie/kogito/examples/persons.bpmn2 rename to kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/org/acme/examples/persons.bpmn2 index 70a41e3cc5..5deac40f48 100644 --- a/kogito-springboot-examples/process-outbox-mongodb-springboot/src/main/resources/org/kie/kogito/examples/persons.bpmn2 +++ b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/main/resources/org/acme/examples/persons.bpmn2 @@ -1,5 +1,5 @@ - + @@ -12,13 +12,13 @@ - + - - - + + + @@ -37,7 +37,7 @@ SequenceFlow_1 - + @@ -46,8 +46,8 @@ SequenceFlow_1 SequenceFlow_2 - - + + BusinessRuleTask_1_personsInputX @@ -84,7 +84,7 @@ SequenceFlow_4 - + diff --git a/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/test/java/org/kie/kogito/quarkus/outbox/OutboxIT.java b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/test/java/org/acme/quarkus/outbox/OutboxIT.java similarity index 99% rename from kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/test/java/org/kie/kogito/quarkus/outbox/OutboxIT.java rename to kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/test/java/org/acme/quarkus/outbox/OutboxIT.java index 22fadaf7a2..6aa8268014 100644 --- a/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/test/java/org/kie/kogito/quarkus/outbox/OutboxIT.java +++ b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/src/test/java/org/acme/quarkus/outbox/OutboxIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.quarkus.outbox; +package org.acme.quarkus.outbox; import java.nio.file.Path; import java.nio.file.Paths; diff --git a/kogito-quarkus-examples/process-performance-client/pom.xml b/kogito-quarkus-examples/process-performance-client/pom.xml index 99cf83fa06..0b277a2908 100755 --- a/kogito-quarkus-examples/process-performance-client/pom.xml +++ b/kogito-quarkus-examples/process-performance-client/pom.xml @@ -1,17 +1,17 @@ + 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"> 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-performance-client + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Client Performance test Client Performance test + 2.16.10.Final quarkus-bom @@ -21,7 +21,15 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + 1.7.36 + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -40,6 +48,7 @@ + io.smallrye.reactive @@ -52,6 +61,7 @@ org.slf4j slf4j-simple + ${version.org.slf4j} com.fasterxml.jackson.core @@ -66,4 +76,52 @@ kogito-services + + + + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/AsyncRestDispatcher.java b/kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/AsyncRestDispatcher.java similarity index 97% rename from kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/AsyncRestDispatcher.java rename to kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/AsyncRestDispatcher.java index 565e46f314..88da440d1b 100644 --- a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/AsyncRestDispatcher.java +++ b/kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/AsyncRestDispatcher.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.performance.client; +package org.acme.performance.client; import java.util.Collections; import java.util.concurrent.ExecutionException; diff --git a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/KafkaDispatcher.java b/kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/KafkaDispatcher.java similarity index 98% rename from kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/KafkaDispatcher.java rename to kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/KafkaDispatcher.java index 39d0a1e490..0c6c87055c 100644 --- a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/KafkaDispatcher.java +++ b/kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/KafkaDispatcher.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.performance.client; +package org.acme.performance.client; import java.util.Collections; import java.util.Map; diff --git a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/MainRunner.java b/kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/MainRunner.java similarity index 86% rename from kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/MainRunner.java rename to kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/MainRunner.java index 988d2ead25..7a6f60bbec 100644 --- a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/MainRunner.java +++ b/kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/MainRunner.java @@ -14,9 +14,8 @@ * limitations under the License. */ -package org.kie.kogito.performance.client; +package org.acme.performance.client; -import org.kie.kogito.performance.client.RequestDispatcherFactory.RequestType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -25,7 +24,7 @@ public class MainRunner { private static final Logger logger = LoggerFactory.getLogger(MainRunner.class); public static void main(String[] args) { - try (RequestDispatcher dispatcher = RequestDispatcherFactory.getDispatcher(RequestType.KAFKA, "test")) { + try (RequestDispatcher dispatcher = RequestDispatcherFactory.getDispatcher(RequestDispatcherFactory.RequestType.KAFKA, "test")) { new RequestDispatcherRunner(dispatcher, 100, 10).call(); } catch (Exception ex) { logger.error("Execution error ", ex); diff --git a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/RequestDispatcher.java b/kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/RequestDispatcher.java similarity index 94% rename from kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/RequestDispatcher.java rename to kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/RequestDispatcher.java index 1bdabe1066..05d5cb0237 100644 --- a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/RequestDispatcher.java +++ b/kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/RequestDispatcher.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.performance.client; +package org.acme.performance.client; import java.util.function.Consumer; diff --git a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/RequestDispatcherFactory.java b/kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/RequestDispatcherFactory.java similarity index 96% rename from kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/RequestDispatcherFactory.java rename to kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/RequestDispatcherFactory.java index 72b0f04ad0..49c51b01ad 100644 --- a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/RequestDispatcherFactory.java +++ b/kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/RequestDispatcherFactory.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.performance.client; +package org.acme.performance.client; public class RequestDispatcherFactory { diff --git a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/RequestDispatcherRunner.java b/kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/RequestDispatcherRunner.java similarity index 99% rename from kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/RequestDispatcherRunner.java rename to kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/RequestDispatcherRunner.java index ec74239016..11a00936cb 100644 --- a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/RequestDispatcherRunner.java +++ b/kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/RequestDispatcherRunner.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.performance.client; +package org.acme.performance.client; import java.io.IOException; import java.time.Duration; diff --git a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/SyncRestDispatcher.java b/kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/SyncRestDispatcher.java similarity index 97% rename from kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/SyncRestDispatcher.java rename to kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/SyncRestDispatcher.java index 9f6728e852..a314823161 100644 --- a/kogito-quarkus-examples/process-performance-client/src/main/java/org/kie/kogito/performance/client/SyncRestDispatcher.java +++ b/kogito-quarkus-examples/process-performance-client/src/main/java/org/acme/performance/client/SyncRestDispatcher.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.performance.client; +package org.acme.performance.client; import java.util.Collections; import java.util.concurrent.ExecutionException; diff --git a/kogito-quarkus-examples/process-performance-quarkus/README.md b/kogito-quarkus-examples/process-performance-quarkus/README.md index f36be8e99c..f6749bf0e8 100644 --- a/kogito-quarkus-examples/process-performance-quarkus/README.md +++ b/kogito-quarkus-examples/process-performance-quarkus/README.md @@ -63,5 +63,5 @@ To run the generated native executable, generated in `target/`, execute ## Example Usage -Once the service is up and running, to collect throughput numbers you need to manually change parameters in code of, compile and run class ```org.kie.kogito.performance.client.MainRunner``` in process-performance-client project +Once the service is up and running, to collect throughput numbers you need to manually change parameters in code of, compile and run class ```org.acme.performance.client.MainRunner``` in process-performance-client project diff --git a/kogito-quarkus-examples/process-performance-quarkus/pom.xml b/kogito-quarkus-examples/process-performance-quarkus/pom.xml index 0d527b4389..0bc5c8e2ca 100755 --- a/kogito-quarkus-examples/process-performance-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-performance-quarkus/pom.xml @@ -1,17 +1,17 @@ + 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"> 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-performance-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Quarkus Performance test Quarkus Performance test + 2.16.10.Final quarkus-bom @@ -21,7 +21,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -40,6 +51,7 @@ + io.quarkus @@ -77,6 +89,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-springboot-examples/process-performance-springboot/src/main/resources/org/kie/kogito/examples/kafkaTest.bpmn2 b/kogito-quarkus-examples/process-performance-quarkus/src/main/resources/org/acme/examples/kafkaTest.bpmn2 similarity index 97% rename from kogito-springboot-examples/process-performance-springboot/src/main/resources/org/kie/kogito/examples/kafkaTest.bpmn2 rename to kogito-quarkus-examples/process-performance-quarkus/src/main/resources/org/acme/examples/kafkaTest.bpmn2 index 16c544ffe6..2b6e9462cc 100644 --- a/kogito-springboot-examples/process-performance-springboot/src/main/resources/org/kie/kogito/examples/kafkaTest.bpmn2 +++ b/kogito-quarkus-examples/process-performance-quarkus/src/main/resources/org/acme/examples/kafkaTest.bpmn2 @@ -6,7 +6,7 @@ - + diff --git a/kogito-quarkus-examples/process-performance-quarkus/src/main/resources/org/kie/kogito/examples/kafkaTestOtherChannel.bpmn2 b/kogito-quarkus-examples/process-performance-quarkus/src/main/resources/org/acme/examples/kafkaTestOtherChannel.bpmn2 similarity index 98% rename from kogito-quarkus-examples/process-performance-quarkus/src/main/resources/org/kie/kogito/examples/kafkaTestOtherChannel.bpmn2 rename to kogito-quarkus-examples/process-performance-quarkus/src/main/resources/org/acme/examples/kafkaTestOtherChannel.bpmn2 index 4ce9c94cf6..64d28cd66b 100644 --- a/kogito-quarkus-examples/process-performance-quarkus/src/main/resources/org/kie/kogito/examples/kafkaTestOtherChannel.bpmn2 +++ b/kogito-quarkus-examples/process-performance-quarkus/src/main/resources/org/acme/examples/kafkaTestOtherChannel.bpmn2 @@ -6,7 +6,7 @@ - + diff --git a/kogito-springboot-examples/process-performance-springboot/src/main/resources/org/kie/kogito/examples/test.bpmn2 b/kogito-quarkus-examples/process-performance-quarkus/src/main/resources/org/acme/examples/test.bpmn2 similarity index 97% rename from kogito-springboot-examples/process-performance-springboot/src/main/resources/org/kie/kogito/examples/test.bpmn2 rename to kogito-quarkus-examples/process-performance-quarkus/src/main/resources/org/acme/examples/test.bpmn2 index d41e777321..685f9246d6 100644 --- a/kogito-springboot-examples/process-performance-springboot/src/main/resources/org/kie/kogito/examples/test.bpmn2 +++ b/kogito-quarkus-examples/process-performance-quarkus/src/main/resources/org/acme/examples/test.bpmn2 @@ -3,7 +3,7 @@ - + diff --git a/kogito-quarkus-examples/process-postgresql-persistence-quarkus/pom.xml b/kogito-quarkus-examples/process-postgresql-persistence-quarkus/pom.xml index 9068e217f4..446e9d96d8 100644 --- a/kogito-quarkus-examples/process-postgresql-persistence-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-postgresql-persistence-quarkus/pom.xml @@ -5,16 +5,13 @@ xmlns="http://maven.apache.org/POM/4.0.0"> 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - - process-postgresql-persistence-quarkus + org.acme.examples + 2.0.0-SNAPSHOT Kogito Example :: Process PostgreSQL Persistence Quarkus Process with PostgreSQL persistence - Quarkus + 2.16.10.Final quarkus-bom @@ -24,7 +21,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -43,6 +51,7 @@ + io.quarkus @@ -102,7 +111,30 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + @@ -123,5 +155,21 @@ + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + diff --git a/kogito-quarkus-examples/process-quarkus-example/README.md b/kogito-quarkus-examples/process-quarkus-example/README.md index 44c0e70b67..fbe98856ac 100644 --- a/kogito-quarkus-examples/process-quarkus-example/README.md +++ b/kogito-quarkus-examples/process-quarkus-example/README.md @@ -2,25 +2,34 @@ ## Description -A simple process service for ordering items, as a sequence of a script task (writing out some debug info) and a call activity invoking a sub-process, using a custom `Order` data element. +A simple process service for ordering items, as a sequence of a script task (writing out some debug info) and a call +activity invoking a sub-process, using a custom `Order` data element. -The sub-process invokes a custom Java service `CalculationService.calculateTotal`, followed by a user task to verify the order. +The sub-process invokes a custom Java service `CalculationService.calculateTotal`, followed by a user task to verify the +order. -Based on these two processes (defined using BPMN 2.0 format), the custom data object and custom Java service, a new service is generated that exposes REST operations to create new orders (following the steps as defined in the main and sub-process), or to list and delete active orders. +Based on these two processes (defined using BPMN 2.0 format), the custom data object and custom Java service, a new +service is generated that exposes REST operations to create new orders (following the steps as defined in the main and +sub-process), or to list and delete active orders. ## Installing and Running ### Prerequisites You will need: - - Java 11+ installed - - Environment variable JAVA_HOME set accordingly - - Maven 3.8.6+ installed + +- Java 11+ installed +- Environment variable JAVA_HOME set accordingly +- Maven 3.8.6+ installed When using native image compilation, you will also need: - - [GraalVM 19.1.1](https://github.com/oracle/graal/releases/tag/vm-19.1.1) installed - - Environment variable GRAALVM_HOME set accordingly - - Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be installed too. You also need 'native-image' installed in GraalVM (using 'gu install native-image'). Please refer to [GraalVM installation documentation](https://www.graalvm.org/docs/reference-manual/aot-compilation/#prerequisites) for more details. + +- [GraalVM 19.1.1](https://github.com/oracle/graal/releases/tag/vm-19.1.1) installed +- Environment variable GRAALVM_HOME set accordingly +- Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be + installed too. You also need 'native-image' installed in GraalVM (using 'gu install native-image'). Please refer + to [GraalVM installation documentation](https://www.graalvm.org/docs/reference-manual/aot-compilation/#prerequisites) + for more details. ### Compile and Run in Local Dev Mode @@ -43,6 +52,7 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ``` @@ -60,43 +70,62 @@ Note: This does not yet work on Windows, GraalVM and Quarkus should be rolling o ### Running with persistence enabled Kogito runtime supports multiple persistence types, including Infinispan. -In order to use the Infinispan based persistence, you need to have a Infinispan server installed and available over the network. +In order to use the Infinispan based persistence, you need to have a Infinispan server installed and available over the +network. The default configuration, expects the server to be running on: + ``` quarkus.infinispan-client.hosts=localhost:11222 ``` + If you need to change it, you can do so by updating the application.properties file located in src/main/resources. -You can install Infinispan server by downloading version 12.x from the [official website](https://infinispan.org/download/). +You can install Infinispan server by downloading version 12.x from +the [official website](https://infinispan.org/download/). -Once Infinispan is up and running you can build this project with `-Ppersistence` to enable additional processing during the build. Next you start it in exact same way as without persistence. +Once Infinispan is up and running you can build this project with `-Ppersistence` to enable additional processing during +the build. Next you start it in exact same way as without persistence. -This extra profile in maven configuration adds additional dependencies needed to work with Infinispan as persistent store. +This extra profile in maven configuration adds additional dependencies needed to work with Infinispan as persistent +store. ### Running with events enabled Kogito supports cloud events using Kafka as message broker. So to be able to enable this you need to have -Kafka cluster installed and available over the network. Refer to [Kafka Apache site](https://kafka.apache.org/quickstart) to more information about how to install. +Kafka cluster installed and available over the network. Refer +to [Kafka Apache site](https://kafka.apache.org/quickstart) to more information about how to install. Kogito will use the following Kafka topics to listen for cloud events: -* `kogito-processinstances-events` - used to emit events by Kogito that can be consumed by data index service and other services -* `kogito-usertaskinstances-events` - used to emit events by Kogito that can be consumed by data index service and other services +* `kogito-processinstances-events` - used to emit events by Kogito that can be consumed by data index service and other + services +* `kogito-usertaskinstances-events` - used to emit events by Kogito that can be consumed by data index service and other + services -Once Kafka is up and running you can build this project with `-Pevents` to enable additional processing during the build. This extra profile in maven configuration adds additional dependencies needed to work with Cloud Events. +Once Kafka is up and running you can build this project with `-Pevents` to enable additional processing during the +build. This extra profile in maven configuration adds additional dependencies needed to work with Cloud Events. ## OpenAPI (Swagger) documentation + [Specification at swagger.io](https://swagger.io/docs/specification/about/) -You can take a look at the [OpenAPI definition](http://localhost:8080/openapi?format=json) - automatically generated and included in this service - to determine all available operations exposed by this service. For easy readability you can visualize the OpenAPI definition file using a UI tool like for example available [Swagger UI](https://editor.swagger.io). +You can take a look at the [OpenAPI definition](http://localhost:8080/openapi?format=json) - automatically generated and +included in this service - to determine all available operations exposed by this service. For easy readability you can +visualize the OpenAPI definition file using a UI tool like for example +available [Swagger UI](https://editor.swagger.io). In addition, various clients to interact with this service can be easily generated using this OpenAPI definition. -When running in either Quarkus Development or Native mode, we also leverage the [Quarkus OpenAPI extension](https://quarkus.io/guides/openapi-swaggerui#use-swagger-ui-for-development) that exposes [Swagger UI](http://localhost:8080/swagger-ui/) that you can use to look at available REST endpoints and send test requests. +When running in either Quarkus Development or Native mode, we also leverage +the [Quarkus OpenAPI extension](https://quarkus.io/guides/openapi-swaggerui#use-swagger-ui-for-development) that +exposes [Swagger UI](http://localhost:8080/swagger-ui/) that you can use to look at available REST endpoints and send +test requests. ## Example Usage -Once the service is up and running, you can use the following examples to interact with the service. Note that rather than using the curl commands below, you can also use the [Swagger UI](http://localhost:8080/swagger-ui/) to send requests. +Once the service is up and running, you can use the following examples to interact with the service. Note that rather +than using the curl commands below, you can also use the [Swagger UI](http://localhost:8080/swagger-ui/) to send +requests. ### POST /orders @@ -119,6 +148,7 @@ Curl command (using the JSON object above): ```sh curl -d '{"approver" : "john", "order" : {"orderNumber" : "12345", "shipped" : false}}' -H "Content-Type: application/json" -X POST http://localhost:8080/orders ``` + or on windows ```sh @@ -148,6 +178,7 @@ Returns list of orders currently active: ```sh curl -X GET http://localhost:8080/orders ``` + Example response: ```json @@ -171,6 +202,7 @@ Returns order with given id (if active): ```sh curl -X GET http://localhost:8080/orders/b5225020-4cf4-4e91-8f86-dc840589cc22 ``` + Example response: ```json @@ -194,6 +226,7 @@ Cancels order with given id ```sh curl -X DELETE http://localhost:8080/orders/b5225020-4cf4-4e91-8f86-dc840589cc22 ``` + Example response: ```json @@ -215,6 +248,7 @@ Getting order items sub processes ```sh curl -X GET http://localhost:8080/orderItems ``` + Example response: ```json @@ -238,6 +272,7 @@ Getting user tasks awaiting user action ```sh curl -X GET http://localhost:8080/orderItems/66c11e3e-c211-4cee-9a07-848b5e861bc5/tasks?user=john ``` + Example response: ```json @@ -253,6 +288,7 @@ Getting user task details ```sh curl -X GET http://localhost:8080/orderItems/66c11e3e-c211-4cee-9a07-848b5e861bc5/Verify_order/62f1c985-d31c-4ead-9906-2fe8d05937f0?user=john ``` + Example response: ```json @@ -276,7 +312,6 @@ Complete user task curl -d '{}' -H "Content-Type: application/json" -X POST http://localhost:8080/orderItems/66c11e3e-c211-4cee-9a07-848b5e861bc5/Verify_order/62f1c985-d31c-4ead-9906-2fe8d05937f0?user=john ``` - As response the updated order is returned. Example response: @@ -295,4 +330,5 @@ Example response: ## Deploying with Kogito Operator -In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). +In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with +the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). diff --git a/kogito-quarkus-examples/process-quarkus-example/operator/process-quarkus-example.yaml b/kogito-quarkus-examples/process-quarkus-example/operator/process-quarkus-example.yaml index fb08685d5c..ef1960e5db 100644 --- a/kogito-quarkus-examples/process-quarkus-example/operator/process-quarkus-example.yaml +++ b/kogito-quarkus-examples/process-quarkus-example/operator/process-quarkus-example.yaml @@ -25,10 +25,10 @@ apiVersion: app.kiegroup.org/v1beta1 kind: KogitoRuntime metadata: name: process-quarkus-example -# uncomment to enable persistence -#spec: -# infra: -# - kogito-infinispan-infra + # uncomment to enable persistence + #spec: + # infra: + # - kogito-infinispan-infra #env: # - name: MAVEN_ARGS_APPEND # value: "-Ppersistence" \ No newline at end of file diff --git a/kogito-quarkus-examples/process-quarkus-example/pom.xml b/kogito-quarkus-examples/process-quarkus-example/pom.xml index 828f07f1fd..20ab710c41 100755 --- a/kogito-quarkus-examples/process-quarkus-example/pom.xml +++ b/kogito-quarkus-examples/process-quarkus-example/pom.xml @@ -1,13 +1,13 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-quarkus-example + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process and Quarkus Order management service @@ -19,7 +19,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -38,6 +49,7 @@ + org.kie.kogito @@ -99,7 +111,30 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + @@ -152,5 +187,21 @@ + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + diff --git a/kogito-quarkus-examples/process-quarkus-example/src/main/java/org/kie/kogito/examples/CalculationService.java b/kogito-quarkus-examples/process-quarkus-example/src/main/java/org/acme/examples/CalculationService.java similarity index 92% rename from kogito-quarkus-examples/process-quarkus-example/src/main/java/org/kie/kogito/examples/CalculationService.java rename to kogito-quarkus-examples/process-quarkus-example/src/main/java/org/acme/examples/CalculationService.java index bf28039f05..a19ceefae6 100644 --- a/kogito-quarkus-examples/process-quarkus-example/src/main/java/org/kie/kogito/examples/CalculationService.java +++ b/kogito-quarkus-examples/process-quarkus-example/src/main/java/org/acme/examples/CalculationService.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; import java.util.Random; import javax.enterprise.context.ApplicationScoped; -import org.kie.kogito.examples.demo.Order; +import org.acme.examples.demo.Order; @ApplicationScoped public class CalculationService { diff --git a/kogito-springboot-examples/process-springboot-example/src/main/java/org/kie/kogito/examples/PersonValidationService.java b/kogito-quarkus-examples/process-quarkus-example/src/main/java/org/acme/examples/PersonValidationService.java similarity index 92% rename from kogito-springboot-examples/process-springboot-example/src/main/java/org/kie/kogito/examples/PersonValidationService.java rename to kogito-quarkus-examples/process-quarkus-example/src/main/java/org/acme/examples/PersonValidationService.java index 1601506f70..c6bc848a17 100644 --- a/kogito-springboot-examples/process-springboot-example/src/main/java/org/kie/kogito/examples/PersonValidationService.java +++ b/kogito-quarkus-examples/process-quarkus-example/src/main/java/org/acme/examples/PersonValidationService.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; +import org.acme.examples.demo.Person; import org.drools.ruleunits.api.DataSource; import org.drools.ruleunits.api.DataStore; import org.drools.ruleunits.api.RuleUnitData; -import org.kie.kogito.examples.demo.Person; public class PersonValidationService implements RuleUnitData { private DataStore persons = DataSource.createStore(); diff --git a/kogito-springboot-examples/process-springboot-example/src/main/java/org/kie/kogito/examples/demo/Order.java b/kogito-quarkus-examples/process-quarkus-example/src/main/java/org/acme/examples/demo/Order.java similarity index 95% rename from kogito-springboot-examples/process-springboot-example/src/main/java/org/kie/kogito/examples/demo/Order.java rename to kogito-quarkus-examples/process-quarkus-example/src/main/java/org/acme/examples/demo/Order.java index de8b4fb8f2..af662bf441 100755 --- a/kogito-springboot-examples/process-springboot-example/src/main/java/org/kie/kogito/examples/demo/Order.java +++ b/kogito-quarkus-examples/process-quarkus-example/src/main/java/org/acme/examples/demo/Order.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.demo; +package org.acme.examples.demo; public class Order implements java.io.Serializable { @@ -51,7 +51,7 @@ public void setTotal(java.lang.Double total) { } public Order(java.lang.String orderNumber, java.lang.Boolean shipped, - java.lang.Double total) { + java.lang.Double total) { this.orderNumber = orderNumber; this.shipped = shipped; this.total = total; diff --git a/kogito-springboot-examples/process-springboot-example/src/main/java/org/kie/kogito/examples/demo/Person.java b/kogito-quarkus-examples/process-quarkus-example/src/main/java/org/acme/examples/demo/Person.java similarity index 97% rename from kogito-springboot-examples/process-springboot-example/src/main/java/org/kie/kogito/examples/demo/Person.java rename to kogito-quarkus-examples/process-quarkus-example/src/main/java/org/acme/examples/demo/Person.java index 4ce2cb03d7..3bcbe19953 100644 --- a/kogito-springboot-examples/process-springboot-example/src/main/java/org/kie/kogito/examples/demo/Person.java +++ b/kogito-quarkus-examples/process-quarkus-example/src/main/java/org/acme/examples/demo/Person.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples.demo; +package org.acme.examples.demo; import java.io.Serializable; diff --git a/kogito-quarkus-examples/process-quarkus-example/src/main/resources/application.properties b/kogito-quarkus-examples/process-quarkus-example/src/main/resources/application.properties index 899e5a43b4..ab92000211 100644 --- a/kogito-quarkus-examples/process-quarkus-example/src/main/resources/application.properties +++ b/kogito-quarkus-examples/process-quarkus-example/src/main/resources/application.properties @@ -1,21 +1,15 @@ # Packaging # quarkus.package.type=fast-jar - quarkus.swagger-ui.always-include=true - quarkus.infinispan-client.hosts=localhost:11222 quarkus.http.cors=true - kafka.bootstrap.servers=localhost:9092 - mp.messaging.outgoing.kogito-processinstances-events.connector=smallrye-kafka mp.messaging.outgoing.kogito-processinstances-events.topic=kogito-processinstances-events mp.messaging.outgoing.kogito-processinstances-events.value.serializer=org.apache.kafka.common.serialization.StringSerializer - mp.messaging.outgoing.kogito-usertaskinstances-events.connector=smallrye-kafka mp.messaging.outgoing.kogito-usertaskinstances-events.topic=kogito-usertaskinstances-events mp.messaging.outgoing.kogito-usertaskinstances-events.value.serializer=org.apache.kafka.common.serialization.StringSerializer - mp.messaging.outgoing.kogito-variables-events.connector=smallrye-kafka mp.messaging.outgoing.kogito-variables-events.topic=kogito-variables-events mp.messaging.outgoing.kogito-variables-events.value.serializer=org.apache.kafka.common.serialization.StringSerializer \ No newline at end of file diff --git a/kogito-springboot-examples/process-springboot-example/src/main/resources/org/kie/kogito/examples/PersonValidationService.drl b/kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/acme/examples/PersonValidationService.drl similarity index 90% rename from kogito-springboot-examples/process-springboot-example/src/main/resources/org/kie/kogito/examples/PersonValidationService.drl rename to kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/acme/examples/PersonValidationService.drl index c78f0bc31b..bb86aec170 100644 --- a/kogito-springboot-examples/process-springboot-example/src/main/resources/org/kie/kogito/examples/PersonValidationService.drl +++ b/kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/acme/examples/PersonValidationService.drl @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples +package org.acme.examples unit PersonValidationService -import org.kie.kogito.examples.demo.Person; +import org.acme.examples.demo.Person; rule "Is adult" when diff --git a/kogito-springboot-examples/process-springboot-example/src/main/resources/org/kie/kogito/examples/orderItems.bpmn2 b/kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/acme/examples/orderItems.bpmn2 similarity index 96% rename from kogito-springboot-examples/process-springboot-example/src/main/resources/org/kie/kogito/examples/orderItems.bpmn2 rename to kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/acme/examples/orderItems.bpmn2 index 9a3df852b4..fe6dbd00e8 100644 --- a/kogito-springboot-examples/process-springboot-example/src/main/resources/org/kie/kogito/examples/orderItems.bpmn2 +++ b/kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/acme/examples/orderItems.bpmn2 @@ -1,7 +1,7 @@ - + @@ -11,9 +11,9 @@ - + - + @@ -31,15 +31,15 @@ - + Message_1 Message_2 - + - + diff --git a/kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/org/kie/kogito/examples/quarkus/orders.bpmn2 b/kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/acme/examples/orders.bpmn2 similarity index 91% rename from kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/org/kie/kogito/examples/quarkus/orders.bpmn2 rename to kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/acme/examples/orders.bpmn2 index 20337562b1..998e93cb78 100644 --- a/kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/org/kie/kogito/examples/quarkus/orders.bpmn2 +++ b/kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/acme/examples/orders.bpmn2 @@ -1,11 +1,11 @@ - + - - - + + + @@ -45,8 +45,8 @@ _58684613-0155-48B2-8746-7675AFF24439 _8216C810-34D8-4BFA-B814-1AA01907810F - - + + _9484CB12-FE52-434C-AE9F-3C3C267D1C96_orderInputX diff --git a/kogito-springboot-examples/process-springboot-example/src/main/resources/org/kie/kogito/examples/persons.bpmn2 b/kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/acme/examples/persons.bpmn2 similarity index 93% rename from kogito-springboot-examples/process-springboot-example/src/main/resources/org/kie/kogito/examples/persons.bpmn2 rename to kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/acme/examples/persons.bpmn2 index 70a41e3cc5..5deac40f48 100644 --- a/kogito-springboot-examples/process-springboot-example/src/main/resources/org/kie/kogito/examples/persons.bpmn2 +++ b/kogito-quarkus-examples/process-quarkus-example/src/main/resources/org/acme/examples/persons.bpmn2 @@ -1,5 +1,5 @@ - + @@ -12,13 +12,13 @@ - + - - - + + + @@ -37,7 +37,7 @@ SequenceFlow_1 - + @@ -46,8 +46,8 @@ SequenceFlow_1 SequenceFlow_2 - - + + BusinessRuleTask_1_personsInputX @@ -84,7 +84,7 @@ SequenceFlow_4 - + diff --git a/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/OrdersProcessIT.java b/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/acme/examples/OrdersProcessIT.java similarity index 98% rename from kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/OrdersProcessIT.java rename to kogito-quarkus-examples/process-quarkus-example/src/test/java/org/acme/examples/OrdersProcessIT.java index 55a9515e73..efa60f6f1a 100644 --- a/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/OrdersProcessIT.java +++ b/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/acme/examples/OrdersProcessIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; import java.util.Collections; import java.util.HashMap; @@ -24,12 +24,12 @@ import javax.inject.Inject; import javax.inject.Named; +import org.acme.examples.demo.Order; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.kie.kogito.Model; import org.kie.kogito.auth.IdentityProviders; import org.kie.kogito.auth.SecurityPolicy; -import org.kie.kogito.examples.demo.Order; import org.kie.kogito.process.Process; import org.kie.kogito.process.ProcessInstance; import org.kie.kogito.process.ProcessInstances; diff --git a/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/OrdersRestIT.java b/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/acme/examples/OrdersRestIT.java similarity index 99% rename from kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/OrdersRestIT.java rename to kogito-quarkus-examples/process-quarkus-example/src/test/java/org/acme/examples/OrdersRestIT.java index a6c91f37bb..4634333b6e 100644 --- a/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/OrdersRestIT.java +++ b/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/acme/examples/OrdersRestIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; import javax.inject.Inject; import javax.inject.Named; diff --git a/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/PersonProcessIT.java b/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/acme/examples/PersonProcessIT.java similarity index 98% rename from kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/PersonProcessIT.java rename to kogito-quarkus-examples/process-quarkus-example/src/test/java/org/acme/examples/PersonProcessIT.java index bf8bec9a80..9f7330a24f 100644 --- a/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/PersonProcessIT.java +++ b/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/acme/examples/PersonProcessIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; import java.util.Collections; import java.util.HashMap; @@ -23,11 +23,11 @@ import javax.inject.Inject; import javax.inject.Named; +import org.acme.examples.demo.Person; import org.junit.jupiter.api.Test; import org.kie.kogito.Model; import org.kie.kogito.auth.IdentityProviders; import org.kie.kogito.auth.SecurityPolicy; -import org.kie.kogito.examples.demo.Person; import org.kie.kogito.process.Process; import org.kie.kogito.process.ProcessInstance; import org.kie.kogito.process.WorkItem; diff --git a/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/PersonsRestIT.java b/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/acme/examples/PersonsRestIT.java similarity index 99% rename from kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/PersonsRestIT.java rename to kogito-quarkus-examples/process-quarkus-example/src/test/java/org/acme/examples/PersonsRestIT.java index 3dece4add2..2c8acca631 100644 --- a/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/kie/kogito/examples/PersonsRestIT.java +++ b/kogito-quarkus-examples/process-quarkus-example/src/test/java/org/acme/examples/PersonsRestIT.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.kie.kogito.examples; +package org.acme.examples; import javax.inject.Inject; import javax.inject.Named; diff --git a/kogito-quarkus-examples/process-quarkus-example/src/test/resources/application.properties b/kogito-quarkus-examples/process-quarkus-example/src/test/resources/application.properties index 21d13b3df3..4223627923 100644 --- a/kogito-quarkus-examples/process-quarkus-example/src/test/resources/application.properties +++ b/kogito-quarkus-examples/process-quarkus-example/src/test/resources/application.properties @@ -1,14 +1,11 @@ # Quarkus quarkus.http.test-port=0 - mp.messaging.outgoing.kogito-processinstances-events.connector=smallrye-kafka mp.messaging.outgoing.kogito-processinstances-events.topic=kogito-processinstances-events mp.messaging.outgoing.kogito-processinstances-events.value.serializer=org.apache.kafka.common.serialization.StringSerializer - mp.messaging.outgoing.kogito-usertaskinstances-events.connector=smallrye-kafka mp.messaging.outgoing.kogito-usertaskinstances-events.topic=kogito-usertaskinstances-events mp.messaging.outgoing.kogito-usertaskinstances-events.value.serializer=org.apache.kafka.common.serialization.StringSerializer - mp.messaging.outgoing.kogito-variables-events.connector=smallrye-kafka mp.messaging.outgoing.kogito-variables-events.topic=kogito-variables-events mp.messaging.outgoing.kogito-variables-events.value.serializer=org.apache.kafka.common.serialization.StringSerializer \ No newline at end of file diff --git a/kogito-quarkus-examples/process-rest-service-call-quarkus/mvnw b/kogito-quarkus-examples/process-rest-service-call-quarkus/mvnw deleted file mode 100755 index d2f0ea3808..0000000000 --- a/kogito-quarkus-examples/process-rest-service-call-quarkus/mvnw +++ /dev/null @@ -1,310 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------------------- -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# ---------------------------------------------------------------------------- - -# ---------------------------------------------------------------------------- -# Maven2 Start Up Batch script -# -# Required ENV vars: -# ------------------ -# JAVA_HOME - location of a JDK home dir -# -# Optional ENV vars -# ----------------- -# M2_HOME - location of maven2's installed home dir -# MAVEN_OPTS - parameters passed to the Java VM when running Maven -# e.g. to debug Maven itself, use -# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -# MAVEN_SKIP_RC - flag to disable loading of mavenrc files -# ---------------------------------------------------------------------------- - -if [ -z "$MAVEN_SKIP_RC" ] ; then - - if [ -f /etc/mavenrc ] ; then - . /etc/mavenrc - fi - - if [ -f "$HOME/.mavenrc" ] ; then - . "$HOME/.mavenrc" - fi - -fi - -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -mingw=false -case "`uname`" in - CYGWIN*) cygwin=true ;; - MINGW*) mingw=true;; - Darwin*) darwin=true - # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home - # See https://developer.apple.com/library/mac/qa/qa1170/_index.html - if [ -z "$JAVA_HOME" ]; then - if [ -x "/usr/libexec/java_home" ]; then - export JAVA_HOME="`/usr/libexec/java_home`" - else - export JAVA_HOME="/Library/Java/Home" - fi - fi - ;; -esac - -if [ -z "$JAVA_HOME" ] ; then - if [ -r /etc/gentoo-release ] ; then - JAVA_HOME=`java-config --jre-home` - fi -fi - -if [ -z "$M2_HOME" ] ; then - ## resolve links - $0 may be a link to maven's home - PRG="$0" - - # need this for relative symlinks - while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi - done - - saveddir=`pwd` - - M2_HOME=`dirname "$PRG"`/.. - - # make it fully qualified - M2_HOME=`cd "$M2_HOME" && pwd` - - cd "$saveddir" - # echo Using m2 at $M2_HOME -fi - -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --unix "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -# For Mingw, ensure paths are in UNIX format before anything is touched -if $mingw ; then - [ -n "$M2_HOME" ] && - M2_HOME="`(cd "$M2_HOME"; pwd)`" - [ -n "$JAVA_HOME" ] && - JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" -fi - -if [ -z "$JAVA_HOME" ]; then - javaExecutable="`which javac`" - if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then - # readlink(1) is not available as standard on Solaris 10. - readLink=`which readlink` - if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then - if $darwin ; then - javaHome="`dirname \"$javaExecutable\"`" - javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" - else - javaExecutable="`readlink -f \"$javaExecutable\"`" - fi - javaHome="`dirname \"$javaExecutable\"`" - javaHome=`expr "$javaHome" : '\(.*\)/bin'` - JAVA_HOME="$javaHome" - export JAVA_HOME - fi - fi -fi - -if [ -z "$JAVACMD" ] ; then - if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - else - JAVACMD="`which java`" - fi -fi - -if [ ! -x "$JAVACMD" ] ; then - echo "Error: JAVA_HOME is not defined correctly." >&2 - echo " We cannot execute $JAVACMD" >&2 - exit 1 -fi - -if [ -z "$JAVA_HOME" ] ; then - echo "Warning: JAVA_HOME environment variable is not set." -fi - -CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher - -# traverses directory structure from process work directory to filesystem root -# first directory with .mvn subdirectory is considered project base directory -find_maven_basedir() { - - if [ -z "$1" ] - then - echo "Path not specified to find_maven_basedir" - return 1 - fi - - basedir="$1" - wdir="$1" - while [ "$wdir" != '/' ] ; do - if [ -d "$wdir"/.mvn ] ; then - basedir=$wdir - break - fi - # workaround for JBEAP-8937 (on Solaris 10/Sparc) - if [ -d "${wdir}" ]; then - wdir=`cd "$wdir/.."; pwd` - fi - # end of workaround - done - echo "${basedir}" -} - -# concatenates all lines of a file -concat_lines() { - if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" - fi -} - -BASE_DIR=`find_maven_basedir "$(pwd)"` -if [ -z "$BASE_DIR" ]; then - exit 1; -fi - -########################################################################################## -# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -# This allows using the maven wrapper in projects that prohibit checking in binary data. -########################################################################################## -if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found .mvn/wrapper/maven-wrapper.jar" - fi -else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." - fi - if [ -n "$MVNW_REPOURL" ]; then - jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - else - jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - fi - while IFS="=" read key value; do - case "$key" in (wrapperUrl) jarUrl="$value"; break ;; - esac - done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" - if [ "$MVNW_VERBOSE" = true ]; then - echo "Downloading from: $jarUrl" - fi - wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" - if $cygwin; then - wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` - fi - - if command -v wget > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found wget ... using wget" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - wget "$jarUrl" -O "$wrapperJarPath" - else - wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" - fi - elif command -v curl > /dev/null; then - if [ "$MVNW_VERBOSE" = true ]; then - echo "Found curl ... using curl" - fi - if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then - curl -o "$wrapperJarPath" "$jarUrl" -f - else - curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f - fi - - else - if [ "$MVNW_VERBOSE" = true ]; then - echo "Falling back to using Java to download" - fi - javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" - # For Cygwin, switch paths to Windows format before running javac - if $cygwin; then - javaClass=`cygpath --path --windows "$javaClass"` - fi - if [ -e "$javaClass" ]; then - if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Compiling MavenWrapperDownloader.java ..." - fi - # Compiling the Java class - ("$JAVA_HOME/bin/javac" "$javaClass") - fi - if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then - # Running the downloader - if [ "$MVNW_VERBOSE" = true ]; then - echo " - Running MavenWrapperDownloader.java ..." - fi - ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") - fi - fi - fi -fi -########################################################################################## -# End of extension -########################################################################################## - -export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} -if [ "$MVNW_VERBOSE" = true ]; then - echo $MAVEN_PROJECTBASEDIR -fi -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - [ -n "$M2_HOME" ] && - M2_HOME=`cygpath --path --windows "$M2_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --windows "$CLASSPATH"` - [ -n "$MAVEN_PROJECTBASEDIR" ] && - MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` -fi - -# Provide a "standardized" way to retrieve the CLI args that will -# work with both Windows and non-Windows executions. -MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" -export MAVEN_CMD_LINE_ARGS - -WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -exec "$JAVACMD" \ - $MAVEN_OPTS \ - -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ - "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ - ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/kogito-quarkus-examples/process-rest-service-call-quarkus/mvnw.cmd b/kogito-quarkus-examples/process-rest-service-call-quarkus/mvnw.cmd deleted file mode 100644 index b26ab24f03..0000000000 --- a/kogito-quarkus-examples/process-rest-service-call-quarkus/mvnw.cmd +++ /dev/null @@ -1,182 +0,0 @@ -@REM ---------------------------------------------------------------------------- -@REM Licensed to the Apache Software Foundation (ASF) under one -@REM or more contributor license agreements. See the NOTICE file -@REM distributed with this work for additional information -@REM regarding copyright ownership. The ASF licenses this file -@REM to you under the Apache License, Version 2.0 (the -@REM "License"); you may not use this file except in compliance -@REM with the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, -@REM software distributed under the License is distributed on an -@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -@REM KIND, either express or implied. See the License for the -@REM specific language governing permissions and limitations -@REM under the License. -@REM ---------------------------------------------------------------------------- - -@REM ---------------------------------------------------------------------------- -@REM Maven2 Start Up Batch script -@REM -@REM Required ENV vars: -@REM JAVA_HOME - location of a JDK home dir -@REM -@REM Optional ENV vars -@REM M2_HOME - location of maven2's installed home dir -@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands -@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending -@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven -@REM e.g. to debug Maven itself, use -@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files -@REM ---------------------------------------------------------------------------- - -@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' -@echo off -@REM set title of command window -title %0 -@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' -@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% - -@REM set %HOME% to equivalent of $HOME -if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") - -@REM Execute a user defined script before this one -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre -@REM check for pre script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" -if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" -:skipRcPre - -@setlocal - -set ERROR_CODE=0 - -@REM To isolate internal variables from possible post scripts, we use another setlocal -@setlocal - -@REM ==== START VALIDATION ==== -if not "%JAVA_HOME%" == "" goto OkJHome - -echo. -echo Error: JAVA_HOME not found in your environment. >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -:OkJHome -if exist "%JAVA_HOME%\bin\java.exe" goto init - -echo. -echo Error: JAVA_HOME is set to an invalid directory. >&2 -echo JAVA_HOME = "%JAVA_HOME%" >&2 -echo Please set the JAVA_HOME variable in your environment to match the >&2 -echo location of your Java installation. >&2 -echo. -goto error - -@REM ==== END VALIDATION ==== - -:init - -@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". -@REM Fallback to current working directory if not found. - -set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% -IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir - -set EXEC_DIR=%CD% -set WDIR=%EXEC_DIR% -:findBaseDir -IF EXIST "%WDIR%"\.mvn goto baseDirFound -cd .. -IF "%WDIR%"=="%CD%" goto baseDirNotFound -set WDIR=%CD% -goto findBaseDir - -:baseDirFound -set MAVEN_PROJECTBASEDIR=%WDIR% -cd "%EXEC_DIR%" -goto endDetectBaseDir - -:baseDirNotFound -set MAVEN_PROJECTBASEDIR=%EXEC_DIR% -cd "%EXEC_DIR%" - -:endDetectBaseDir - -IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig - -@setlocal EnableExtensions EnableDelayedExpansion -for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a -@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% - -:endReadAdditionalConfig - -SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" -set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" -set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain - -set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - -FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( - IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B -) - -@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central -@REM This allows using the maven wrapper in projects that prohibit checking in binary data. -if exist %WRAPPER_JAR% ( - if "%MVNW_VERBOSE%" == "true" ( - echo Found %WRAPPER_JAR% - ) -) else ( - if not "%MVNW_REPOURL%" == "" ( - SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" - ) - if "%MVNW_VERBOSE%" == "true" ( - echo Couldn't find %WRAPPER_JAR%, downloading it ... - echo Downloading from: %DOWNLOAD_URL% - ) - - powershell -Command "&{"^ - "$webclient = new-object System.Net.WebClient;"^ - "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ - "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ - "}"^ - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ - "}" - if "%MVNW_VERBOSE%" == "true" ( - echo Finished downloading %WRAPPER_JAR% - ) -) -@REM End of extension - -@REM Provide a "standardized" way to retrieve the CLI args that will -@REM work with both Windows and non-Windows executions. -set MAVEN_CMD_LINE_ARGS=%* - -%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* -if ERRORLEVEL 1 goto error -goto end - -:error -set ERROR_CODE=1 - -:end -@endlocal & set ERROR_CODE=%ERROR_CODE% - -if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost -@REM check for post script, once with legacy .bat ending and once with .cmd ending -if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" -if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" -:skipRcPost - -@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' -if "%MAVEN_BATCH_PAUSE%" == "on" pause - -if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% - -exit /B %ERROR_CODE% diff --git a/kogito-quarkus-examples/process-rest-service-call-quarkus/pom.xml b/kogito-quarkus-examples/process-rest-service-call-quarkus/pom.xml index f15c86c1ef..145ea3340d 100644 --- a/kogito-quarkus-examples/process-rest-service-call-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-rest-service-call-quarkus/pom.xml @@ -1,15 +1,16 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-rest-service-call-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process Service Rest Cal with Quarkus Kogito service invocation using REST - Quarkus + 2.16.10.Final quarkus-bom @@ -19,7 +20,18 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -38,6 +50,7 @@ + io.quarkus @@ -98,6 +111,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/process-rest-workitem-multi-quarkus/pom.xml b/kogito-quarkus-examples/process-rest-workitem-multi-quarkus/pom.xml index a0cdb59184..57a3f52d7c 100644 --- a/kogito-quarkus-examples/process-rest-workitem-multi-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-rest-workitem-multi-quarkus/pom.xml @@ -1,15 +1,16 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-rest-workitem-multi-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process Rest :: Quarkus Invoking multiple Rest WS using RestWorkItemHandler + 2.16.10.Final quarkus-bom @@ -19,7 +20,19 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + 2.33.2 + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + UTF-8 + UTF-8 + @@ -38,6 +51,7 @@ + org.kie.kogito @@ -86,6 +100,7 @@ com.github.tomakehurst wiremock-jre8 + ${version.com.github.tomakehurst.wiremock} test @@ -108,6 +123,49 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + ${project.build.directory}/${project.build.finalName}-runner + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/process-rest-workitem-quarkus/pom.xml b/kogito-quarkus-examples/process-rest-workitem-quarkus/pom.xml index 70c6af42c8..6121d62368 100644 --- a/kogito-quarkus-examples/process-rest-workitem-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-rest-workitem-quarkus/pom.xml @@ -1,15 +1,16 @@ - + 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 2.0.0-SNAPSHOT - + process-rest-workitem-quarkus + org.acme.examples + 2.0.0-SNAPSHOT + Kogito Example :: Process Service Rest WorkItem call with Quarkus Kogito service invocation using REST work item and Quarkus + 2.16.10.Final quarkus-bom @@ -19,7 +20,16 @@ kogito-bom 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + + 0 + + fast-jar + 3.1.2 + ${version.surefire.plugin} + 11 + 11 + @@ -38,6 +48,7 @@ + io.quarkus @@ -97,6 +108,48 @@ + + + org.apache.maven.plugins + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${tests.quarkus.http.port} + + + + + + + + kogito-apps-downstream-native + + + kogito-apps-native + + + + **/Native*IT.java + + native + 8g + + 8080 + + + diff --git a/kogito-quarkus-examples/process-saga-quarkus/README.md b/kogito-quarkus-examples/process-saga-quarkus/README.md index 3316acafb5..6432771ba4 100644 --- a/kogito-quarkus-examples/process-saga-quarkus/README.md +++ b/kogito-quarkus-examples/process-saga-quarkus/README.md @@ -3,38 +3,38 @@ ## Description Service to demonstrate how to implement Saga pattern based on BPMN process with Kogito. The proposed example is based - on an Order Fulfillment process which consists in a sequence of steps, that could represent calls to external - services, microservices, serverless functions, etc. - - All steps `stock`, `payment` and `shipping` should be executed to confirm an Order, if any of the - steps fail, then a compensation for each completed step should be executed to undo the operation or to keep the - process on a consistent state. For instance, reserve stock step, should cancel the stock reservation. The - compensations for the steps are represented in the process using a boundary `Intermediate Catching Compensation -Event` attached to the respective step to be compensated. +on an Order Fulfillment process which consists in a sequence of steps, that could represent calls to external +services, microservices, serverless functions, etc. + +All steps `stock`, `payment` and `shipping` should be executed to confirm an Order, if any of the +steps fail, then a compensation for each completed step should be executed to undo the operation or to keep the +process on a consistent state. For instance, reserve stock step, should cancel the stock reservation. The +compensations for the steps are represented in the process using a boundary `Intermediate Catching Compensation +Event` attached to the respective step to be compensated. The catching compensation events can be triggered by an `Intermediate Throwing Compensation Event` or the - ` Compensation End Event` in any point of the process that represents an error or inconsistent state, like a response - from a service. - +` Compensation End Event` in any point of the process that represents an error or inconsistent state, like a response +from a service. + The steps and compensations actions in the process example are implemented as service tasks using a Java class under - the `src` of the project, and for this example they are just mocking responses, but in a real use case they - could be executing calls to external services through REST, or any other mechanism depending on the architecture. - - The start point of Saga process is to submit a request to create a new Order with a given `orderId`, this could be - any other payload that represents an `Order`, but for the sake of simplicity, in this example it will be - based on the `id` that could be used as a correlation to client starting the Saga. - The output of each step, is represented by a `Response` that contains a type, indicating success or error - and the id of the resource that was invoked in the service, but this could be any kind of response depending on - the requirement of each service. +the `src` of the project, and for this example they are just mocking responses, but in a real use case they +could be executing calls to external services through REST, or any other mechanism depending on the architecture. + +The start point of Saga process is to submit a request to create a new Order with a given `orderId`, this could be +any other payload that represents an `Order`, but for the sake of simplicity, in this example it will be +based on the `id` that could be used as a correlation to client starting the Saga. +The output of each step, is represented by a `Response` that contains a type, indicating success or error + and the id of the resource that was invoked in the service, but this could be any kind of response depending on +the requirement of each service. ## Order Saga process This is the BPMN process that represents the Order Saga, and it is the one being used in the project to be built using - kogito. +kogito. @@ -43,14 +43,19 @@ This is the BPMN process that represents the Order Saga, and it is the one being ### Prerequisites You will need: - - Java 11+ installed - - Environment variable JAVA_HOME set accordingly - - Maven 3.8.6+ installed + +- Java 11+ installed +- Environment variable JAVA_HOME set accordingly +- Maven 3.8.6+ installed When using native image compilation, you will also need: - - [GraalVM 19.1.1](https://github.com/oracle/graal/releases/tag/vm-19.1.1) installed - - Environment variable GRAALVM_HOME set accordingly - - Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be installed too. You also need 'native-image' installed in GraalVM (using 'gu install native-image'). Please refer to [GraalVM installation documentation](https://www.graalvm.org/docs/reference-manual/aot-compilation/#prerequisites) for more details. + +- [GraalVM 19.1.1](https://github.com/oracle/graal/releases/tag/vm-19.1.1) installed +- Environment variable GRAALVM_HOME set accordingly +- Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be + installed too. You also need 'native-image' installed in GraalVM (using 'gu install native-image'). Please refer + to [GraalVM installation documentation](https://www.graalvm.org/docs/reference-manual/aot-compilation/#prerequisites) + for more details. ### Compile and Run in Local Dev Mode @@ -66,6 +71,7 @@ java -jar target/process-saga-quarkus-runner.jar ``` ### Package and Run using Local Native Image + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ``` @@ -81,17 +87,26 @@ To run the generated native executable, generated in `target/`, execute Note: Native builds does not yet work on Windows, GraalVM and Quarkus should be rolling out support for Windows soon. ## OpenAPI (Swagger) documentation + [Specification at swagger.io](https://swagger.io/docs/specification/about/) -You can take a look at the [OpenAPI definition](http://localhost:8080/openapi?format=json) - automatically generated and included in this service - to determine all available operations exposed by this service. For easy readability you can visualize the OpenAPI definition file using a UI tool like for example available [Swagger UI](https://editor.swagger.io). +You can take a look at the [OpenAPI definition](http://localhost:8080/openapi?format=json) - automatically generated and +included in this service - to determine all available operations exposed by this service. For easy readability you can +visualize the OpenAPI definition file using a UI tool like for example +available [Swagger UI](https://editor.swagger.io). In addition, various clients to interact with this service can be easily generated using this OpenAPI definition. -When running in either Quarkus Development or Native mode, we also leverage the [Quarkus OpenAPI extension](https://quarkus.io/guides/openapi-swaggerui#use-swagger-ui-for-development) that exposes [Swagger UI](http://localhost:8080/swagger-ui/) that you can use to look at available REST endpoints and send test requests. +When running in either Quarkus Development or Native mode, we also leverage +the [Quarkus OpenAPI extension](https://quarkus.io/guides/openapi-swaggerui#use-swagger-ui-for-development) that +exposes [Swagger UI](http://localhost:8080/swagger-ui/) that you can use to look at available REST endpoints and send +test requests. ## Usage -Once the service is up and running, you can use the following examples to interact with the service. Note that rather than using the curl commands below, you can also use the [Swagger UI](http://localhost:8080/swagger-ui/) to send requests. +Once the service is up and running, you can use the following examples to interact with the service. Note that rather +than using the curl commands below, you can also use the [Swagger UI](http://localhost:8080/swagger-ui/) to send +requests. ### Starting the Order Saga @@ -113,9 +128,10 @@ Curl command (using the JSON object above): ```sh curl -H "Content-Type: application/json" -X POST http://localhost:8080/orders -d '{"orderId" : "03e6cf79-3301-434b-b5e1-d6899b5639aa"}' ``` + The response for the request is returned with attributes representing the response of each step, either - success or failure. The `orderResponse` attribute indicates if the order can be confirmed in case of success or - canceled in case of error. +success or failure. The `orderResponse` attribute indicates if the order can be confirmed in case of success or +canceled in case of error. Response example: @@ -146,16 +162,16 @@ Response example: In the console executing the application you can check the log it with the executed steps. ```text -17:16:58:864 INFO [org.kie.kogito.examples.StockService] Created Stock for 12345678 with Id: 8ab1ac13-38d0-49e6-ab40-1edd2dc39922 -17:16:58:865 INFO [org.kie.kogito.examples.PaymentService] Created Payment for 12345678 with Id: 2bfc044a-ccb4-4072-a26e-5a533d835257 -17:16:58:865 INFO [org.kie.kogito.examples.ShippingService] Created Shipping for 12345678 with Id: 84a45015-c98b-4e08-b4cd-cf05a19b87e1 -17:16:58:865 INFO [org.kie.kogito.examples.OrderService] Success Order 12345678 +17:16:58:864 INFO [org.acme.examples.StockService] Created Stock for 12345678 with Id: 8ab1ac13-38d0-49e6-ab40-1edd2dc39922 +17:16:58:865 INFO [org.acme.examples.PaymentService] Created Payment for 12345678 with Id: 2bfc044a-ccb4-4072-a26e-5a533d835257 +17:16:58:865 INFO [org.acme.examples.ShippingService] Created Shipping for 12345678 with Id: 84a45015-c98b-4e08-b4cd-cf05a19b87e1 +17:16:58:865 INFO [org.acme.examples.OrderService] Success Order 12345678 ``` #### Simulating errors to activate the compensation flows To make testing the process easier it was introduced an optional attribute `failService` that indicates which service - should respond with an error. The attribute is basically the simple class name of the service. +should respond with an error. The attribute is basically the simple class name of the service. Example: @@ -165,6 +181,7 @@ Example: "failService" : "PaymentService" } ``` + Curl command (using the JSON object above): ```sh @@ -200,15 +217,16 @@ Response example: In the console executing the application you can check the log it with the executed steps. ```text -17:16:17:723 INFO [org.kie.kogito.examples.StockService] Created Stock for 12345678 with Id: 9098daa2-f40f-4231-995a-1c7d159df190 -17:16:17:724 INFO [org.kie.kogito.examples.PaymentService] Created Payment for 12345678 with Id: d6ac4086-efe9-4a9e-849c-2b6d48dbc1f0 -17:16:17:724 INFO [org.kie.kogito.examples.ShippingService] Created Shipping for 12345678 with Id: 39c40aa1-10af-42ad-8ba2-b8dd9c6279e1 -17:16:17:746 WARN [org.kie.kogito.examples.ShippingService] Cancel Shipping for 39c40aa1-10af-42ad-8ba2-b8dd9c6279e1 -17:16:17:746 WARN [org.kie.kogito.examples.PaymentService] Cancel Payment for d6ac4086-efe9-4a9e-849c-2b6d48dbc1f0 -17:16:17:747 WARN [org.kie.kogito.examples.StockService] Cancel Stock for 9098daa2-f40f-4231-995a-1c7d159df190 -17:16:17:747 WARN [org.kie.kogito.examples.OrderService] Failed Order 12345678 +17:16:17:723 INFO [org.acme.examples.StockService] Created Stock for 12345678 with Id: 9098daa2-f40f-4231-995a-1c7d159df190 +17:16:17:724 INFO [org.acme.examples.PaymentService] Created Payment for 12345678 with Id: d6ac4086-efe9-4a9e-849c-2b6d48dbc1f0 +17:16:17:724 INFO [org.acme.examples.ShippingService] Created Shipping for 12345678 with Id: 39c40aa1-10af-42ad-8ba2-b8dd9c6279e1 +17:16:17:746 WARN [org.acme.examples.ShippingService] Cancel Shipping for 39c40aa1-10af-42ad-8ba2-b8dd9c6279e1 +17:16:17:746 WARN [org.acme.examples.PaymentService] Cancel Payment for d6ac4086-efe9-4a9e-849c-2b6d48dbc1f0 +17:16:17:747 WARN [org.acme.examples.StockService] Cancel Stock for 9098daa2-f40f-4231-995a-1c7d159df190 +17:16:17:747 WARN [org.acme.examples.OrderService] Failed Order 12345678 ``` ## Deploying with Kogito Operator -In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). \ No newline at end of file +In the [`operator`](operator) directory you'll find the custom resources needed to deploy this example on OpenShift with +the [Kogito Operator](https://docs.jboss.org/kogito/release/latest/html_single/#chap_kogito-deploying-on-openshift). \ No newline at end of file diff --git a/kogito-quarkus-examples/process-saga-quarkus/docs/images/orders-saga-svg.svg b/kogito-quarkus-examples/process-saga-quarkus/docs/images/orders-saga-svg.svg index fc594e8e1a..36cdb11d89 100644 --- a/kogito-quarkus-examples/process-saga-quarkus/docs/images/orders-saga-svg.svg +++ b/kogito-quarkus-examples/process-saga-quarkus/docs/images/orders-saga-svg.svg @@ -1,2567 +1,3516 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - saga-examples/orders-saga-svg.svg at main · tiagodolphine/saga-examples - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + saga-examples/orders-saga-svg.svg at main · tiagodolphine/saga-examples + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - + - + + + + - + - - + - - - - - - - + + + - + + + + + - - - + + + - - - - + - + - - - + + + - + - - - - - + + + + - - - + + + + + + + + + - + - + - + - + - - - + + + - - + + - + - - -
- Skip to content - - - - - - - - -
-
- + +
- -
- -
+
+ +
- @tiagodolphine - + @tiagodolphine + - - -

- - Loading - - - - - -

-

- - Sorry, something went wrong. -

-
+ + +

+ + Loading + + + + + + +

+

+ + Sorry, something went wrong. +

+
-
- - - -
- -
+ + + +
+
-
+ -
- - - - + - -
- - - - - - - - + + - - + - + - + - + - + - + - + - + - - - - - tiagodolphine - /saga-examples - - - - - - Type # for issues and pull requests, > for commands, and ? for help - - - Type # for issues, pull requests, and projects, > for commands, and ? for help - - - Type # for issues, pull requests, and projects, / for files, and > for commands - - -
- -
-
- We’ve encountered an error and some results aren't available at this time. Type a new search or try again later. -
-
- - No results matched your search - + data-scope-types="["owner"]" + data-placeholder="Search or jump to..." + > + + + + + tiagodolphine + + /saga-examples + + + + + + + Type # for issues and pull requests, > + for commands, and ? for help + + + Type # for issues, pull requests, and projects, > + for commands, and ? for help + + + Type # for issues, pull requests, and projects, / + for files, and > for commands + + +
+ +
+
+ We’ve encountered an error and some results aren't available at this time. Type a new search or try again later. +
+
+ + No results matched your search + - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - -
+ > + +
+ + - - - - - + + - Search for issues and pull requests - - # - - - + Search for issues and + pull requests + + + # + + + - Search for issues, pull requests, discussions, and projects - - # - - - + Search for issues, pull requests, discussions, + and + projects + + + # + + + - Search for organizations, repositories, and users - - @ - - - + Search for organizations, repositories, and + users + + + @ + + + - Search for projects - - ! - - - + Search for + projects + + + ! + + + - Search for files - - / - - - + Search for + files + + + / + + + - Activate command mode - - > - - - + Activate + command mode + + + > + + + - Search your issues, pull requests, and discussions - - # author:@me - - - + Search your issues, pull requests, and discussions + + # author:@me + + + - Search your issues, pull requests, and discussions - - # author:@me - - - + Search your issues, pull requests, and discussions + + # author:@me + + + - Filter to pull requests - - # is:pr - - - + Filter to pull requests + + # is:pr + + + - Filter to issues - - # is:issue - - - + Filter to issues + + # is:issue + + + - Filter to discussions - - # is:discussion - - - + Filter to discussions + + # is:discussion + + + - Filter to projects - - # is:project - - - + Filter to projects + + # is:project + + + - Filter to open issues, pull requests, and discussions - - # is:open - - - - - - - - - - - - - - - - - - - - - - - -
-
-
+ data-prefix="# is:open" + > + Filter to open issues, pull requests, and discussions + + # is:open + + + + + + + + + + + + + + + + + + + + + + + + + +
- + - + - + - + - +
- -
-
-
- - - - - - - +
+
+
+ + +
+ +
+ +
+

+ + + / + + saga-examples + + + Public +

-
+
-
+
    -
    -

    - - - / - - saga-examples - +
  • + +
    - Public -
  • + -
    -
      - -
    • - -
      - - - - - - - - Unwatch - - - - - + + - -
      -
      -

      Notifications

      - -
      - -
      -
      - - - - - - - - -
      - +
      -
      -
- +
-
  • -
    -
    - - -
    -
    - - -
    -
    +
  • + +
  • +
    +
    + + + + Fork + + + + +
    + +

    Fork saga-examples

    +
    -
  • +
    + + + Loading + + + + + + +

    If this dialog fails to load, you can visit the fork page + directly. +

    +
    +
    -
  • -
    -
    - - - - Fork + +
    +
    - + - - -
    - -

    Fork saga-examples

    -
    - -
    - - - Loading - - - - - -

    If this dialog fails to load, you can visit the fork page directly.

    -
    -
    +
  • - - -
    - +
  • -
  • + + -
  • - +
  • - - +
    +
    -
    -
    -
    + + +
    + +
    +
    - -
    -
    +
    +
    Open in github.dev - - - - - -
    - +
    - Permalink + + Permalink + -
    - -
    -
    - - - main - - - - -
    -
    -
    - Switch branches/tags - -
    - - - -
    - -
    +
    + +
    +
    + + + main + + + + +
    +
    +
    + Switch branches/tags + +
    + + + +
    + +
    -
    - - -
    +
    + + +
    -
    - + - - - - - - - - - - + query-endpoint="/tiagodolphine/saga-examples/refs" + can-create + cache-key="v0:1616324018.551733" + current-committish="bWFpbg==" + default-branch="bWFpbg==" + name-with-owner="dGlhZ29kb2xwaGluZS9zYWdhLWV4YW1wbGVz" + prefetch-on-mouseover + > + + + + + + + - - + + + + + -
    +
    - + + +
    - - -
    -
    -
    + -
    +
    - - - Go to file - + + + Go to file + + +
    + + + + + + + + +
    + -
    -
    + Copy path + + +
  • + + + Copy permalink + + +
  • + +
    + +
    -
    - -
    -
    -
     
    -
    -
    -
     
    - Cannot retrieve contributors at this time -
    -
    +
    + +
    +
    +
     
    +
    +
    +
     
    + Cannot retrieve contributors at this time +
    +
    +
    +
    - +
    +
    + 1 lines (1 sloc) + + 212 KB +
    +
    +
    + + - -
    - -
    + + + -
    + +
    - 1 lines (1 sloc) - - 212 KB -
    - -
    +
    - + - - + + + + + + + + + + + + + + + +
    + + +
    + + + +
    + + +
    +
    +
    + +
    +
    -
    -
    - -
    + +
  • + Edit file + +
  • +
  • + Delete + file + +
  • + +
    +
    + +
    + +
    +
    + + Loading + + + + + - -
    - -
    -
    - - Loading - - - - - -
    Sorry, something went wrong. Reload?
    -
    Sorry, we cannot display this file.
    -
    Sorry, this file is invalid so it cannot be displayed.
    - +
    Sorry, something went wrong. + + Reload? +
    +
    Sorry, we cannot display this file.
    +
    Sorry, this file is invalid so it cannot be displayed.
    +
    - -
    +
    -
    +
    + +
    - +
    + + + +
    + +
    -
    + -
    +
    +
    +
    -
    -
    + + - - + - - - - + +You can’t perform that action at this time. + - -