From a42a3206d385004bf122d8c3f237ddc93249ecc2 Mon Sep 17 00:00:00 2001 From: spolti Date: Wed, 6 Sep 2023 15:01:51 -0300 Subject: [PATCH] remove parent poms Signed-off-by: spolti --- .../quarkus-3/patches/0001_before_sh.patch | 82 +- .../patches/0003_wiremock_update.patch | 2 +- .../0001_align-protobuf-and-grpc.patch | 2 +- .../decisiontable-quarkus-example/pom.xml | 78 +- .../dmn-drools-quarkus-metrics/pom.xml | 74 +- .../dmn-event-driven-quarkus/pom.xml | 65 +- .../src/main/resources/application.properties | 3 - .../evaluate_all/full_result/all/input.json | 30 +- .../dmn-incubation-api-quarkus/pom.xml | 65 +- .../dmn-knative-quickstart-quarkus/pom.xml | 69 +- .../dmn-listener-dtable/README.md | 3 +- .../dmn-listener-dtable/pom.xml | 70 +- .../src/main/resources/application.properties | 1 - .../dmn-listener-quarkus/README.md | 46 +- .../dmn-listener-quarkus/pom.xml | 70 +- .../src/main/resources/application.properties | 1 - .../dmn-pmml-quarkus-example/pom.xml | 67 +- .../dmn-quarkus-example/README.md | 76 +- .../dmn-quarkus-example/pom.xml | 69 +- .../src/main/resources/application.properties | 1 - .../dmn-tracing-quarkus/README.md | 57 +- .../dmn-tracing-quarkus/pom.xml | 69 +- .../src/main/resources/application.properties | 1 - .../flexible-process-quarkus/pom.xml | 68 +- .../kogito-travel-agency/README.md | 8 +- .../kogito-travel-agency/basic/README.md | 44 +- .../kogito-travel-agency/basic/mvnw | 310 - .../kogito-travel-agency/basic/mvnw.cmd | 182 - .../kogito-travel-agency/basic/pom.xml | 70 +- .../resources/META-INF/resources/index.html | 514 +- .../src/main/resources/application.properties | 1 - .../extended/docker-compose/README.md | 66 +- .../docker-compose/docker-compose.yml | 8 +- .../provisioning/dashboards/dashboard.yml | 16 +- .../provisioning/datasources/datasource.yml | 76 +- .../docker-compose/prometheus/prometheus.yml | 4 +- .../kogito-travel-agency/extended/pom.xml | 53 +- .../extended/travels/README.md | 102 +- .../extended/travels/mvnw | 310 - .../extended/travels/mvnw.cmd | 182 - .../extended/travels/pom.xml | 71 +- .../org/acme/travels/VisaApplication.java | 2 +- .../META-INF/processSVG/flightBooking.svg | 140 +- .../META-INF/processSVG/hotelBooking.svg | 140 +- .../resources/META-INF/processSVG/travels.svg | 1066 +- .../src/main/resources/application.properties | 12 - .../src/main/resources/templates/index.html | 516 +- .../src/test/resources/application.properties | 7 - .../extended/visas/README.md | 77 +- .../kogito-travel-agency/extended/visas/mvnw | 310 - .../extended/visas/mvnw.cmd | 182 - .../extended/visas/pom.xml | 72 +- ...icationPrometheusProcessEventListener.java | 14 +- .../org/acme/travels/VisaApplication.java | 2 +- .../META-INF/processSVG/visaApplications.svg | 507 +- .../src/main/resources/application.properties | 14 - .../src/main/resources/templates/index.html | 175 +- .../kogito-travel-agency/pom.xml | 38 +- kogito-quarkus-examples/ocp-tryout/README.md | 131 +- .../ocp-tryout/applicationImage.md | 8 +- .../ocp-tryout/installer.properties | 1 - .../ocp-tryout/kogito-shared/README.md | 17 +- .../kogito-shared/kogito-configs.yaml | 32 +- .../testapp/example/protobuf/travels.proto | 212 +- .../example/protobuf/visaApplications.proto | 62 +- .../testapp/example/svg/flightBooking.svg | 140 +- .../testapp/example/svg/hotelBooking.svg | 140 +- .../testapp/example/svg/travels.svg | 962 +- .../testapp/example/svg/visaApplications.svg | 423 +- .../templates/tests/test-connection.yaml | 4 +- .../ocp-tryout/tryout-kogito-app/values.yaml | 28 +- .../onboarding-example/hr/README.md | 3 +- .../onboarding-example/hr/pom.xml | 109 +- .../java/org/acme/examples/hr/Address.java | 2 +- .../java/org/acme/examples/hr/Employee.java | 4 +- .../src/main/resources/application.properties | 2 - .../onboarding-quarkus/README.md | 3 +- .../onboarding-quarkus/pom.xml | 109 +- .../org/acme/examples/onboarding/Address.java | 2 +- .../acme/examples/onboarding/Employee.java | 4 +- .../org/acme/examples/onboarding/Payroll.java | 2 +- .../src/main/resources/application.properties | 2 - .../onboarding-example/payroll/README.md | 3 +- .../onboarding-example/payroll/pom.xml | 91 +- .../org/acme/examples/payroll/Address.java | 2 +- .../org/acme/examples/payroll/Employee.java | 4 +- .../org/acme/examples/payroll/Payroll.java | 2 +- .../src/main/resources/application.properties | 2 - .../onboarding-example/pom.xml | 69 +- .../pmml-event-driven-quarkus/pom.xml | 71 +- .../pmml-incubation-api-quarkus/pom.xml | 69 +- .../pmml-quarkus-example/README.md | 41 +- .../pmml-quarkus-example/pom.xml | 70 +- .../src/main/resources/application.properties | 2 - .../pmml/quarkus/example/CommonTestUtils.java | 16 +- kogito-quarkus-examples/pom.xml | 98 +- .../process-business-rules-quarkus/pom.xml | 69 +- .../process-decisions-quarkus/pom.xml | 67 +- .../process-decisions-rest-quarkus/pom.xml | 68 +- .../process-decisions-rules-quarkus/pom.xml | 67 +- .../process-error-handling/README.md | 88 +- .../process-error-handling/pom.xml | 67 +- .../src/main/resources/application.properties | 2 - .../src/test/http/error-handling.http | 4 +- .../process-incubation-api-quarkus/pom.xml | 69 +- .../pom.xml | 69 +- .../process-kafka-avro-multi-quarkus/pom.xml | 71 +- .../process-kafka-multi-quarkus/pom.xml | 73 +- .../process-kafka-persistence-quarkus/pom.xml | 64 +- .../process-kafka-quickstart-quarkus/pom.xml | 71 +- .../pom.xml | 66 +- .../pom.xml | 68 +- .../process-monitoring-quarkus/pom.xml | 69 +- .../process-outbox-mongodb-quarkus/pom.xml | 60 +- .../process-performance-client/pom.xml | 74 +- .../process-performance-quarkus/pom.xml | 70 +- .../pom.xml | 60 +- .../process-quarkus-example/README.md | 80 +- .../operator/process-quarkus-example.yaml | 8 +- .../process-quarkus-example/pom.xml | 65 +- .../java/org/acme/examples/demo/Order.java | 2 +- .../src/main/resources/application.properties | 6 - .../src/test/resources/application.properties | 3 - .../process-rest-service-call-quarkus/pom.xml | 69 +- .../pom.xml | 72 +- .../process-rest-workitem-quarkus/pom.xml | 67 +- .../process-saga-quarkus/README.md | 86 +- .../docs/images/orders-saga-svg.svg | 5203 ++-- .../process-saga-quarkus/pom.xml | 61 +- .../src/main/resources/application.properties | 1 - .../java/org/acme/examples/ProcessSagaIT.java | 20 +- .../process-scripts-quarkus/README.md | 44 +- .../process-scripts-quarkus/pom.xml | 67 +- .../src/main/resources/application.properties | 1 - .../process-service-calls-quarkus/pom.xml | 67 +- .../process-timer-quarkus/README.md | 89 +- .../process-timer-quarkus/pom.xml | 63 +- .../src/main/resources/application.properties | 4 - .../pom.xml | 103 +- .../pom.xml | 64 +- .../process-usertasks-quarkus/pom.xml | 67 +- .../pom.xml | 62 +- .../pom.xml | 66 +- .../pom.xml | 73 +- .../pom.xml | 67 +- .../rules-incubation-api-quarkus/pom.xml | 67 +- .../rules-legacy-quarkus-example/pom.xml | 67 +- .../rules-quarkus-helloworld/pom.xml | 67 +- .../ruleunit-event-driven-quarkus/pom.xml | 63 +- .../ruleunit-quarkus-example/pom.xml | 67 +- .../trusty-demonstration/README.md | 11 +- .../docker-compose/README.md | 46 +- .../provisioning/dashboards/dashboard.yml | 18 +- .../provisioning/datasources/datasource.yml | 76 +- .../docker-compose/prometheus/prometheus.yml | 2 +- .../trusty-demonstration/kubernetes/README.md | 70 +- .../kubernetes/resources/kafka.yaml | 4 +- .../pom.xml | 65 +- .../decisiontable-springboot-example/pom.xml | 31 +- .../src/test/resources/logback-test.xml | 2 +- .../dmn-drools-springboot-metrics/pom.xml | 35 +- .../springboot/GrafanaDockerComposeIT.java | 2 +- .../dmn-event-driven-springboot/pom.xml | 31 +- .../dmn-listener-springboot/pom.xml | 35 +- .../dmn-pmml-springboot-example/pom.xml | 30 +- .../dmn-springboot-example/pom.xml | 30 +- .../dmn-tracing-springboot/pom.xml | 30 +- .../operator/flexible-process-springboot.yaml | 2 +- .../flexible-process-springboot/pom.xml | 33 +- .../onboarding-springboot/pom.xml | 51 +- .../pmml-event-driven-springboot/pom.xml | 30 +- .../example/KogitoSpringbootApplication.java | 2 +- .../pmml-springboot-example/pom.xml | 30 +- kogito-springboot-examples/pom.xml | 71 +- .../process-business-rules-springboot/pom.xml | 49 +- .../process-decisions-rest-springboot/pom.xml | 28 +- .../pom.xml | 28 +- .../process-decisions-springboot/pom.xml | 28 +- .../pom.xml | 46 +- .../process-kafka-multi-springboot/pom.xml | 30 +- .../pom.xml | 47 +- .../pom.xml | 47 +- .../process-monitoring-springboot/pom.xml | 36 +- .../process-outbox-mongodb-springboot/pom.xml | 22 +- .../src/test/resources/logback.xml | 16 +- .../process-performance-springboot/pom.xml | 37 +- .../pom.xml | 44 +- .../pom.xml | 47 +- .../process-scripts-springboot/pom.xml | 47 +- .../process-service-calls-springboot/pom.xml | 47 +- .../process-springboot-example/pom.xml | 37 +- .../process-timer-springboot/pom.xml | 47 +- .../pom.xml | 44 +- .../pom.xml | 43 +- .../process-usertasks-springboot/pom.xml | 47 +- .../pom.xml | 34 +- .../pom.xml | 31 +- .../pom.xml | 34 +- .../rules-legacy-springboot-example/pom.xml | 30 +- .../src/test/resources/logback-test.xml | 2 +- .../ruleunit-event-driven-springboot/pom.xml | 30 +- .../ruleunit-springboot-example/pom.xml | 30 +- .../src/test/resources/logback-test.xml | 2 +- pom.xml | 50 +- serverless-workflow-examples/pom.xml | 8 +- .../pom.xml | 250 +- .../callback-event-service/pom.xml | 236 +- .../callback-workflow/pom.xml | 289 +- .../pom.xml | 22 +- .../pom.xml | 7 +- .../serverless-workflow-camel-routes/pom.xml | 4 +- .../pom.xml | 7 +- .../pom.xml | 272 +- .../pom.xml | 9 +- .../custom-function-knative-service/pom.xml | 245 +- .../pom.xml | 23 +- .../workflow/pom.xml | 322 +- .../serverless-workflow-custom-type/pom.xml | 38 +- .../pom.xml | 33 +- .../pom.xml | 37 +- .../serverless-workflow-custom-rpc/pom.xml | 51 +- .../pom.xml | 52 +- .../pom.xml | 7 +- .../serverless-workflow-error-quarkus/pom.xml | 9 +- .../pom.xml | 7 +- .../pom.xml | 9 +- .../pom.xml | 11 +- .../pom.xml | 9 +- .../pom.xml | 9 +- .../serverless-workflow-funqy/pom.xml | 3 +- .../sw-funqy-services/pom.xml | 17 +- .../sw-funqy-workflow/pom.xml | 17 +- .../github-service/pom.xml | 23 +- .../notification-service/pom.xml | 23 +- .../pom.xml | 13 +- .../pr-checker-workflow/pom.xml | 20 +- .../pom.xml | 9 +- .../pom.xml | 5 +- .../pom.xml | 17 +- .../pom.xml | 309 +- .../serverless-workflow-hello-world/pom.xml | 324 +- .../aggregator/mvnw | 316 - .../aggregator/mvnw.cmd | 188 - .../aggregator/pom.xml | 34 +- .../loanbroker-flow/pom.xml | 35 +- .../loanbroker-ui/pom.xml | 27 +- .../pom.xml | 29 +- .../pom.xml | 22 +- .../subscription-flow/pom.xml | 34 +- .../subscription-service/pom.xml | 35 +- .../acme-financial-service/pom.xml | 20 +- .../currency-exchange-workflow/pom.xml | 18 +- .../pom.xml | 6 +- .../model/v3-small_224_1.0_float.xml | 19554 ++++++++-------- .../pom.xml | 38 +- .../pom.xml | 8 +- .../pom.xml | 300 +- .../pom.xml | 43 +- .../pom.xml | 14 +- .../query-answer-service/pom.xml | 23 +- .../query-service/pom.xml | 24 +- .../serverless-workflow-saga-quarkus/pom.xml | 9 +- .../pom.xml | 6 +- .../fake-stock-service/pom.xml | 33 +- .../serverless-workflow-stock-profit/pom.xml | 60 +- .../real-stock-service/pom.xml | 33 +- .../stock-portfolio-service/pom.xml | 34 +- .../stock-profit/pom.xml | 45 +- .../conversion-workflow-full/pom.xml | 18 +- .../conversion-workflow-function/pom.xml | 18 +- .../conversion-workflow-spec/pom.xml | 17 +- .../conversion-workflow/pom.xml | 18 +- .../multiplication-service/pom.xml | 17 +- .../pom.xml | 7 +- .../subtraction-service/pom.xml | 18 +- .../pom.xml | 310 +- .../pom.xml | 5 +- .../pom.xml | 9 +- .../pom.xml | 7 +- 279 files changed, 25505 insertions(+), 17999 deletions(-) delete mode 100755 kogito-quarkus-examples/kogito-travel-agency/basic/mvnw delete mode 100644 kogito-quarkus-examples/kogito-travel-agency/basic/mvnw.cmd delete mode 100755 kogito-quarkus-examples/kogito-travel-agency/extended/travels/mvnw delete mode 100644 kogito-quarkus-examples/kogito-travel-agency/extended/travels/mvnw.cmd delete mode 100755 kogito-quarkus-examples/kogito-travel-agency/extended/visas/mvnw delete mode 100644 kogito-quarkus-examples/kogito-travel-agency/extended/visas/mvnw.cmd delete mode 100755 serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/mvnw delete mode 100644 serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/mvnw.cmd diff --git a/.ci/environments/quarkus-3/patches/0001_before_sh.patch b/.ci/environments/quarkus-3/patches/0001_before_sh.patch index fb198bf8e4..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 @@ -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,7 +4593,7 @@ 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 @@ -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 @@ -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 6a7c0bdcc5..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.acme.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/dmn-drools-quarkus-metrics/pom.xml b/kogito-quarkus-examples/dmn-drools-quarkus-metrics/pom.xml index 9d20b646d7..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.acme.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-event-driven-quarkus/pom.xml b/kogito-quarkus-examples/dmn-event-driven-quarkus/pom.xml index d574fdb19f..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.acme.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/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 433b27dde2..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.acme.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 a91f0cb15a..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.acme.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-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 bf53b0c0dc..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.acme.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/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-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 5beb0e3754..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.acme.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/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-pmml-quarkus-example/pom.xml b/kogito-quarkus-examples/dmn-pmml-quarkus-example/pom.xml index 5d436855c4..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.acme.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/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 c5bf7e88ca..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.acme.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-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 d0c440240a..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.acme.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/flexible-process-quarkus/pom.xml b/kogito-quarkus-examples/flexible-process-quarkus/pom.xml index ee8085a983..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.acme.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/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 0822ada8ff..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.acme.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 92018856e5..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.acme.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/acme/app/VisaApplicationPrometheusProcessEventListener.java b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/app/VisaApplicationPrometheusProcessEventListener.java index 7a500426e8..7d1958d482 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/app/VisaApplicationPrometheusProcessEventListener.java +++ b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/java/org/acme/app/VisaApplicationPrometheusProcessEventListener.java @@ -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 ee635a998a..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.acme.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 2d54e38960..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.acme.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/acme/examples/hr/Address.java b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/Address.java index 4bb3f6a879..db39c78887 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/Address.java +++ b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/Address.java @@ -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/acme/examples/hr/Employee.java b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/Employee.java index deebc384d0..71a9408ae9 100644 --- a/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/Employee.java +++ b/kogito-quarkus-examples/onboarding-example/hr/src/main/java/org/acme/examples/hr/Employee.java @@ -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, - 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/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/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 4801153dce..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.acme.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/acme/examples/onboarding/Address.java b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Address.java index b834e1b17c..dd4ba442ca 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Address.java +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Address.java @@ -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/acme/examples/onboarding/Employee.java b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Employee.java index 44e6c2b905..de960d4514 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Employee.java +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Employee.java @@ -74,8 +74,8 @@ public void setAddress(Address address) { } public Employee(java.lang.String firstName, java.lang.String lastName, - java.lang.String personalId, java.util.Date birthDate, - 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/acme/examples/onboarding/Payroll.java b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Payroll.java index 60655f3fa8..ebbb4b58e8 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Payroll.java +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/src/main/java/org/acme/examples/onboarding/Payroll.java @@ -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/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 ac1383c13b..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.acme.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/acme/examples/payroll/Address.java b/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Address.java index dff65fe766..e591cbc3e2 100644 --- a/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Address.java +++ b/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Address.java @@ -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/acme/examples/payroll/Employee.java b/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Employee.java index 86f887ab64..fdb1d2995b 100644 --- a/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Employee.java +++ b/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Employee.java @@ -74,8 +74,8 @@ public void setAddress(Address address) { } public Employee(java.lang.String firstName, java.lang.String lastName, - java.lang.String personalId, java.util.Date birthDate, - 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/acme/examples/payroll/Payroll.java b/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Payroll.java index 32ebb3fae7..f84802909b 100644 --- a/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Payroll.java +++ b/kogito-quarkus-examples/onboarding-example/payroll/src/main/java/org/acme/examples/payroll/Payroll.java @@ -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/pom.xml b/kogito-quarkus-examples/onboarding-example/pom.xml index f7b83ded9c..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.acme.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 0be0a6e420..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.acme.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-incubation-api-quarkus/pom.xml b/kogito-quarkus-examples/pmml-incubation-api-quarkus/pom.xml index 5b89ec39dc..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.acme.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 924e7fd985..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.acme.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/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/CommonTestUtils.java b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/CommonTestUtils.java index 60ba888800..318c728419 100644 --- a/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/CommonTestUtils.java +++ b/kogito-quarkus-examples/pmml-quarkus-example/src/test/java/org/acme/pmml/quarkus/example/CommonTestUtils.java @@ -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/pom.xml b/kogito-quarkus-examples/pom.xml index e448ced4ce..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.acme.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/pom.xml b/kogito-quarkus-examples/process-business-rules-quarkus/pom.xml index 8fd4165073..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.acme.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/pom.xml b/kogito-quarkus-examples/process-decisions-quarkus/pom.xml index de7aa9c017..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.acme.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-rest-quarkus/pom.xml b/kogito-quarkus-examples/process-decisions-rest-quarkus/pom.xml index 07264021a2..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.acme.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-quarkus-examples/process-decisions-rules-quarkus/pom.xml b/kogito-quarkus-examples/process-decisions-rules-quarkus/pom.xml index 1e08a9f15f..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.acme.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-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/pom.xml b/kogito-quarkus-examples/process-error-handling/pom.xml index 16f49055e4..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.acme.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 bc7f52fe59..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.acme.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/pom.xml b/kogito-quarkus-examples/process-infinispan-persistence-quarkus/pom.xml index 55f27aa816..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.acme.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 822b413e8b..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.acme.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-multi-quarkus/pom.xml b/kogito-quarkus-examples/process-kafka-multi-quarkus/pom.xml index 2873039d86..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.acme.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-persistence-quarkus/pom.xml b/kogito-quarkus-examples/process-kafka-persistence-quarkus/pom.xml index 8b6db76e1d..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.acme.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/pom.xml b/kogito-quarkus-examples/process-kafka-quickstart-quarkus/pom.xml index de316a1b80..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.acme.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-knative-quickstart-quarkus/pom.xml b/kogito-quarkus-examples/process-knative-quickstart-quarkus/pom.xml index d9eda52294..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.acme.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-mongodb-persistence-quarkus/pom.xml b/kogito-quarkus-examples/process-mongodb-persistence-quarkus/pom.xml index 1e85b1c861..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.acme.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 0febe54847..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.acme.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-outbox-mongodb-quarkus/pom.xml b/kogito-quarkus-examples/process-outbox-mongodb-quarkus/pom.xml index 55faa2caef..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.acme.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-performance-client/pom.xml b/kogito-quarkus-examples/process-performance-client/pom.xml index 2d605de453..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.acme.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-quarkus/pom.xml b/kogito-quarkus-examples/process-performance-quarkus/pom.xml index c83f60f962..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.acme.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-quarkus-examples/process-postgresql-persistence-quarkus/pom.xml b/kogito-quarkus-examples/process-postgresql-persistence-quarkus/pom.xml index 740a899bd1..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.acme.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 b5d4894bbb..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.acme.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/acme/examples/demo/Order.java b/kogito-quarkus-examples/process-quarkus-example/src/main/java/org/acme/examples/demo/Order.java index ad88b5f75b..af662bf441 100755 --- a/kogito-quarkus-examples/process-quarkus-example/src/main/java/org/acme/examples/demo/Order.java +++ b/kogito-quarkus-examples/process-quarkus-example/src/main/java/org/acme/examples/demo/Order.java @@ -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-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-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/pom.xml b/kogito-quarkus-examples/process-rest-service-call-quarkus/pom.xml index 7737faeeeb..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.acme.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 179a7c2d4a..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.acme.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 860b1329c3..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.acme.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 ef863044a7..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: @@ -155,7 +171,7 @@ In the console executing the application you can check the log it with the execu #### 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 @@ -211,4 +228,5 @@ In the console executing the application you can check the log it with the execu ## 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. + - -