diff --git a/kogito-quarkus-examples/dmn-15-quarkus-example/README.md b/kogito-quarkus-examples/dmn-15-quarkus-example/README.md new file mode 100644 index 0000000000..bbdc502cc2 --- /dev/null +++ b/kogito-quarkus-examples/dmn-15-quarkus-example/README.md @@ -0,0 +1,496 @@ + +# DMN 1.5 + Quarkus example + +## Description + +Multiple DMN services to evaluate new features of the DMN 1.5 version + +Demonstrates DMN on Kogito capabilities, including REST interface code generation. +It also demonstrates the usage models imported through external jar resources. + +In this case, the models are contained in the `org.kie:kie-dmn-test-resources` artifact, and the referenced ones are extracted with the following maven configuration +```xml + + org.apache.maven.plugins + maven-dependency-plugin + ${dependency-plugin.version} + + + unpack + generate-resources + + unpack + + + + + org.kie + kie-dmn-test-resources + ${project.version} + tests + jar + true + ${project.build.directory}/generated-resources + valid_models/DMNv1_5/**/AllowedValuesChecksInsideCollection.dmn, + valid_models/DMNv1_5/**/TypeConstraintsChecks.dmn, + valid_models/DMNv1_5/**/Imported_Model_Unamed.dmn, + valid_models/DMNv1_5/**/Importing_EmptyNamed_Model_With_Href_Namespace.dmn + + + + + + + +``` + +Extracted models could be found under `target/generated-resources/valid_models.DMNv1_5` directory. + +This example also features the `org.kie.dmn.runtime.typecheck` enviropnment variable, to enforce constraint checks + +```xml + + org.codehaus.mojo + properties-maven-plugin + + + + set-system-properties + + + + + org.kie.dmn.runtime.typecheck + ${enable.runtime.typecheck} + + + + + + +``` + +## Installing and Running + +### Prerequisites + +You will need: + - Java 17+ installed + - Environment variable JAVA_HOME set accordingly + - Maven 3.9.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. + +### Compile and Run in Local Dev Mode + +``` +mvn clean compile quarkus:dev +``` + +### Package and Run in JVM mode + +``` +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar +``` + +or on Windows + +``` +mvn clean package +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 + +``` +mvn clean package -Pnative +``` + +To run the generated native executable, generated in `target/`, execute + +``` +./target/dmn-quarkus-example-runner +``` + +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). + +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/q/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. + +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` + +## Example Usage + +Once the service is up and running, multiple services will be available + +### POST /AllowedValuesChecksInsideCollection + +Demonstrates usage of `allowedValues`constraint (to be used as comparison with the `ConstraintsChecks`) + +Given inputs: + +```json +{ + "p1": { + "Name": "string", + "Interests": [ + "Golf" + ] + } +} +``` + +Curl command (using the JSON object above): + +```sh +curl -X 'POST' \ + 'http://localhost:8080/AllowedValuesChecksInsideCollection' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d '{ + "p1": { + "Name": "string", + "Interests": [ + "Golf" + ] + } +}' +``` +or on Windows: + +```sh +curl -X 'POST' \ + 'http://localhost:8080/AllowedValuesChecksInsideCollection' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d "{ + \"p1\": { + \"Name\": \"string\", + \"Interests\": [ + \"Golf\" + ] + } +}" +``` + +As response, the interests information is returned. + +Example response: + +```json +{ + "p1": { + "Interests": [ + "Golf" + ], + "Name": "string" + }, + "MyDecision": "The Person string likes 1 thing(s)." +} +``` + + + +### POST /TypeConstraintsChecks + +Demonstrates usage of `typeConstraint` constraint. + +Given inputs: + +```json +{ + "p1": { + "Name": "string", + "Interests": [ + "anything" + ] + } +} +``` + +Curl command (using the JSON object above): + +```sh +curl -X 'POST' \ + 'http://localhost:8080/TypeConstraintsChecks' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d '{ + "p1": { + "Name": "string", + "Interests": [ + "anything" + ] + } +}' +``` +or on Windows: + +```sh +curl -X 'POST' \ + 'http://localhost:8080/TypeConstraintsChecks' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d "{ + \"p1\": { + \"Name\": \"string\", + \"Interests\": [ + \"anything\" + ] + } +}" +}" +``` + +As response, the interests information is returned. + +Example response: + +```json +{ + "p1": { + "Interests": [ + "anything" + ], + "Name": "string" + }, + "MyDecision": "The Person string likes 1 thing(s)." +} +``` + +The following input, on the other side, would rise an error + +```json +{ + "p1": { + "Name": "string", + "Interests": [ + "string", "strong" + ] + } +} +``` + +Curl command (using the JSON object above): + +```sh +curl -X 'POST' \ + 'http://localhost:8080/TypeConstraintsChecks' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d '{ + "p1": { + "Name": "string", + "Interests": [ + "string", "strong" + ] + } +}' +``` +or on Windows: + +```sh +curl -X 'POST' \ + 'http://localhost:8080/TypeConstraintsChecks' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d "{ + \"p1\": { + \"Name\": \"string\", + \"Interests\": [ + \"string\", \"strong\" + ] + } +}" +}" +``` + +### POST /Imported Model + +Used to demonstrates usage of `unnamed` import in the `/Importing empty-named Model` service. + +Given inputs: + +```json +{ + "A Person": { + "name": "string", + "age": 0 + }, + "An Imported Person": { + "name": "string", + "age": 0 + } +} +``` + +Curl command (using the JSON object above): + +```sh +curl -X 'POST' \ + 'http://localhost:8080/Imported Model' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d '{ + "A Person": { + "name": "string", + "age": 0 + }, + "An Imported Person": { + "name": "string", + "age": 0 + } +}' +``` +or on Windows: + +```sh +curl -X 'POST' \ + 'http://localhost:8080/Imported Model' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d "{ + \"A Person\": { + \"name\": \"string\", + \"age\": 0 + }, + \"An Imported Person\": { + \"name\": \"string\", + \"age\": 0 + } +}" +``` + +As response, the greeting is returned. + +Example response: + +```json +{ + "A Person": { + "name": "string", + "age": 0 + }, + "Say Hello": "function Say Hello( Person )", + "Remote Greeting": "Hello string!", + "An Imported Person": { + "name": "string", + "age": 0 + } +} +``` + +### POST /Importing empty-named Model + +Used to demonstrates usage of `unnamed` import (it refers to the dmn model behind the `/Imported Model` service). + +Given inputs: + +```json +{ + "A Person": { + "name": "string", + "age": 0 + }, + "An Imported Person": { + "name": "string", + "age": 0 + } +} +``` + +Curl command (using the JSON object above): + +```sh +curl -X 'POST' \ + 'http://localhost:8080/Importing empty-named Model' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d '{ + "A Person": { + "name": "string", + "age": 0 + }, + "An Imported Person": { + "name": "string", + "age": 0 + } +}' +``` +or on Windows: + +```sh +curl -X 'POST' \ + 'http://localhost:8080/Importing empty-named Model' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -d "{ + \"A Person\": { + \"name\": \"string\", + \"age\": 0 + }, + \"An Imported Person\": { + \"name\": \"string\", + \"age\": 0 + } +}" +``` + +As response, both model-local and imported greetings are returned. + +Example response: + +```json +{ + "Local Hello": "function Local Hello( Person )", + "A Person": { + "name": "string", + "age": 0 + }, + "Say Hello": "function Say Hello( Person )", + "Imported Greeting": "Hello string!", + "Local Greeting": "Local Hello string!", + "An Imported Person": { + "name": "string", + "age": 0 + } +} +``` + diff --git a/kogito-quarkus-examples/dmn-15-quarkus-example/pom.xml b/kogito-quarkus-examples/dmn-15-quarkus-example/pom.xml index 59bd7cd1cf..166eb82c55 100644 --- a/kogito-quarkus-examples/dmn-15-quarkus-example/pom.xml +++ b/kogito-quarkus-examples/dmn-15-quarkus-example/pom.xml @@ -21,6 +21,7 @@ 999-SNAPSHOT 999-SNAPSHOT 3.6.1 + true @@ -104,6 +105,25 @@ + + org.codehaus.mojo + properties-maven-plugin + + + + set-system-properties + + + + + org.kie.dmn.runtime.typecheck + ${enable.runtime.typecheck} + + + + + + ${quarkus.platform.group-id} quarkus-maven-plugin @@ -138,7 +158,11 @@ jar true ${project.build.directory}/generated-resources - valid_models/**/*.dmn + valid_models/DMNv1_5/**/AllowedValuesChecksInsideCollection.dmn, + valid_models/DMNv1_5/**/TypeConstraintsChecks.dmn, + valid_models/DMNv1_5/**/Imported_Model_Unamed.dmn, + valid_models/DMNv1_5/**/Importing_EmptyNamed_Model_With_Href_Namespace.dmn + diff --git a/kogito-quarkus-examples/dmn-multiple-models-quarkus-example/src/test/resources/TrafficViolationTest.scesim b/kogito-quarkus-examples/dmn-multiple-models-quarkus-example/src/test/resources/TrafficViolationTest.scesim index ff5d6a2b3e..3a9a5d98f5 100644 --- a/kogito-quarkus-examples/dmn-multiple-models-quarkus-example/src/test/resources/TrafficViolationTest.scesim +++ b/kogito-quarkus-examples/dmn-multiple-models-quarkus-example/src/test/resources/TrafficViolationTest.scesim @@ -753,7 +753,7 @@ - src/main/resources/Traffic Violation.dmn + ../../main/resources/Traffic Violation.dmn DMN https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF Traffic Violation diff --git a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/resources/KiePMMLRegressionTest.scesim b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/resources/KiePMMLRegressionTest.scesim index ce32e9a1d0..f394b4fb2a 100644 --- a/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/resources/KiePMMLRegressionTest.scesim +++ b/kogito-quarkus-examples/dmn-pmml-quarkus-example/src/test/resources/KiePMMLRegressionTest.scesim @@ -440,7 +440,7 @@ - src/main/resources/KiePMMLRegression.dmn + ../../main/resources/KiePMMLRegression.dmn DMN https://kiegroup.org/dmn/_51A1FD67-8A67-4332-9889-B718BE8B7456 TestRegressionDMN diff --git a/kogito-quarkus-examples/dmn-quarkus-example/src/test/resources/TrafficViolationTest.scesim b/kogito-quarkus-examples/dmn-quarkus-example/src/test/resources/TrafficViolationTest.scesim index ff5d6a2b3e..3a9a5d98f5 100644 --- a/kogito-quarkus-examples/dmn-quarkus-example/src/test/resources/TrafficViolationTest.scesim +++ b/kogito-quarkus-examples/dmn-quarkus-example/src/test/resources/TrafficViolationTest.scesim @@ -753,7 +753,7 @@ - src/main/resources/Traffic Violation.dmn + ../../main/resources/Traffic Violation.dmn DMN https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF Traffic Violation diff --git a/kogito-quarkus-examples/dmn-resource-jar-quarkus-example/dmn-consumer-example/src/test/resources/TrafficViolationTest.scesim b/kogito-quarkus-examples/dmn-resource-jar-quarkus-example/dmn-consumer-example/src/test/resources/TrafficViolationTest.scesim index 0a8d8c3f68..e98bd57e9c 100644 --- a/kogito-quarkus-examples/dmn-resource-jar-quarkus-example/dmn-consumer-example/src/test/resources/TrafficViolationTest.scesim +++ b/kogito-quarkus-examples/dmn-resource-jar-quarkus-example/dmn-consumer-example/src/test/resources/TrafficViolationTest.scesim @@ -753,7 +753,7 @@ - target/generated-resources/Traffic Violation.dmn + ../../../target/generated-resources/Traffic Violation.dmn DMN https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF Traffic Violation diff --git a/kogito-quarkus-examples/kogito-travel-agency/basic/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/kogito-travel-agency/basic/src/main/docker/Dockerfile.jvm index 3cf0c2abd1..07e2ca2001 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/basic/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/kogito-travel-agency/basic/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/kogito-travel-agency-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/kogito-travel-agency/basic/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/kogito-travel-agency/basic/src/main/docker/Dockerfile.native index 49bc0edc48..c1a1320724 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/basic/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/kogito-travel-agency/basic/src/main/docker/Dockerfile.native @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/using-kogito # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/travels/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/kogito-travel-agency/extended/travels/src/main/docker/Dockerfile.jvm index 5b2e76cc27..236d2ad18d 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/travels/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/kogito-travel-agency/extended/travels/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/kogito-travel-agency-travels-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/travels/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/kogito-travel-agency/extended/travels/src/main/docker/Dockerfile.native index 49bc0edc48..c1a1320724 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/travels/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/kogito-travel-agency/extended/travels/src/main/docker/Dockerfile.native @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/using-kogito # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/docker/Dockerfile.jvm index 9e3ee62832..053550180f 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/kogito-travel-agency-visas-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/docker/Dockerfile.native index dafe4e4bcd..3924261fd9 100644 --- a/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/kogito-travel-agency/extended/visas/src/main/docker/Dockerfile.native @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/sample-kogito # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/README.md b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/README.md index 6d91a79e2b..054bf1bf00 100644 --- a/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/README.md +++ b/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/README.md @@ -17,6 +17,10 @@ mvn clean package quarkus:dev ``` ### Compile and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` Note that this requires GRAALVM_HOME to point to a valid GraalVM installation diff --git a/kogito-quarkus-examples/pom.xml b/kogito-quarkus-examples/pom.xml index 06fd0bfdee..b64e75a425 100644 --- a/kogito-quarkus-examples/pom.xml +++ b/kogito-quarkus-examples/pom.xml @@ -61,7 +61,6 @@ dmn-quarkus-example dmn-resource-jar-quarkus-example dmn-multiple-models-quarkus-example - dmn-tracing-quarkus flexible-process-quarkus kogito-travel-agency onboarding-example @@ -97,15 +96,14 @@ process-usertasks-custom-lifecycle-quarkus process-usertasks-quarkus process-usertasks-timer-quarkus-with-console - process-usertasks-timer-data-index-persistence-addon-quarkus process-usertasks-with-security-oidc-quarkus process-usertasks-with-security-quarkus rules-incubation-api-quarkus rules-legacy-quarkus-example + rules-legacy-scesim-quarkus-example rules-quarkus-helloworld ruleunit-event-driven-quarkus ruleunit-quarkus-example - trusty-tracing-quarkus-devservices diff --git a/kogito-quarkus-examples/process-business-rules-quarkus/README.md b/kogito-quarkus-examples/process-business-rules-quarkus/README.md index 966243ba00..5b3d8e282f 100644 --- a/kogito-quarkus-examples/process-business-rules-quarkus/README.md +++ b/kogito-quarkus-examples/process-business-rules-quarkus/README.md @@ -87,6 +87,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh @@ -206,7 +211,7 @@ Should return something like ``` -Then to see the Task created perfor the following command +Then to see the Task created perform the following command ``` curl http://localhost:8080/persons/{uuid}/ChildrenHandling/{tuuid} diff --git a/kogito-quarkus-examples/process-business-rules-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-business-rules-quarkus/src/main/docker/Dockerfile.jvm index 014531a48f..6f691954b1 100644 --- a/kogito-quarkus-examples/process-business-rules-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-business-rules-quarkus/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-business-rules-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-business-rules-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-business-rules-quarkus/src/main/docker/Dockerfile.native index b508cbb1d3..dca027f3e7 100644 --- a/kogito-quarkus-examples/process-business-rules-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-business-rules-quarkus/src/main/docker/Dockerfile.native @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native -t quarkus/kogito-infinispan-persistence-quarkus . +# docker build -f src/main/docker/Dockerfile.native -t quarkus/process-business-rules-quarkus . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/kogito-infinispan-persistence-quarkus +# docker run -i --rm -p 8080:8080 quarkus/process-business-rules-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-business-rules-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-business-rules-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index cc6e2fe97c..0000000000 --- a/kogito-quarkus-examples/process-business-rules-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - kogito-infinispan-persistence-quarkus - 1.0-SNAPSHOT - - - - - - -
-
-

Congratulations, you have created a new Quarkus application.

- -

Why do you see this?

- -

This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

- -

What can I do from here?

- -

If not already done, run the application in dev mode using: mvn compile quarkus:dev. -

-
    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/application.properties. -
  • -
- -

How do I get rid of this page?

-

Just delete the src/main/resources/META-INF/resources/index.html file.

-
-
-
-

Application

-
    -
  • GroupId: org.acme
  • -
  • ArtifactId: kogito-infinispan-persistence-quarkus
  • -
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 0.19.1
  • -
-
- -
-
- - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-decisions-quarkus/README.md b/kogito-quarkus-examples/process-decisions-quarkus/README.md index 7714b8c8bd..8134d0edb8 100644 --- a/kogito-quarkus-examples/process-decisions-quarkus/README.md +++ b/kogito-quarkus-examples/process-decisions-quarkus/README.md @@ -144,6 +144,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-decisions-rest-quarkus/README.md b/kogito-quarkus-examples/process-decisions-rest-quarkus/README.md index e65fb32fae..4f9916543a 100644 --- a/kogito-quarkus-examples/process-decisions-rest-quarkus/README.md +++ b/kogito-quarkus-examples/process-decisions-rest-quarkus/README.md @@ -178,6 +178,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-decisions-rules-quarkus/README.md b/kogito-quarkus-examples/process-decisions-rules-quarkus/README.md index 67112c8adf..1d086fb763 100644 --- a/kogito-quarkus-examples/process-decisions-rules-quarkus/README.md +++ b/kogito-quarkus-examples/process-decisions-rules-quarkus/README.md @@ -144,6 +144,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh @@ -274,7 +279,7 @@ After the Curl command, you should see a similar console log "Suspended": "yes", "ValidLicense": false }, - "fine": null, + "fine": {"Amount": 500.0, "Points": 3}, "violation": { "Code": null, "Date": null, diff --git a/kogito-quarkus-examples/process-error-handling/README.md b/kogito-quarkus-examples/process-error-handling/README.md index 32817d65ac..14973444a2 100644 --- a/kogito-quarkus-examples/process-error-handling/README.md +++ b/kogito-quarkus-examples/process-error-handling/README.md @@ -91,6 +91,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-error-handling/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-error-handling/src/main/docker/Dockerfile.jvm index 51512fde1a..b2230927d6 100644 --- a/kogito-quarkus-examples/process-error-handling/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-error-handling/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-error-handling-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-error-handling/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-error-handling/src/main/docker/Dockerfile.native index b508cbb1d3..b69d820725 100644 --- a/kogito-quarkus-examples/process-error-handling/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-error-handling/src/main/docker/Dockerfile.native @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native -t quarkus/kogito-infinispan-persistence-quarkus . +# docker build -f src/main/docker/Dockerfile.native -t quarkus/process-error-handling . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/kogito-infinispan-persistence-quarkus +# docker run -i --rm -p 8080:8080 quarkus/process-error-handling # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-error-handling/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-error-handling/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index cc6e2fe97c..0000000000 --- a/kogito-quarkus-examples/process-error-handling/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - kogito-infinispan-persistence-quarkus - 1.0-SNAPSHOT - - - - - - -
-
-

Congratulations, you have created a new Quarkus application.

- -

Why do you see this?

- -

This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

- -

What can I do from here?

- -

If not already done, run the application in dev mode using: mvn compile quarkus:dev. -

-
    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/application.properties. -
  • -
- -

How do I get rid of this page?

-

Just delete the src/main/resources/META-INF/resources/index.html file.

-
-
-
-

Application

-
    -
  • GroupId: org.acme
  • -
  • ArtifactId: kogito-infinispan-persistence-quarkus
  • -
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 0.19.1
  • -
-
- -
-
- - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/README.md b/kogito-quarkus-examples/process-infinispan-persistence-quarkus/README.md index 0c6ccf1e09..b1a45052e2 100644 --- a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/README.md +++ b/kogito-quarkus-examples/process-infinispan-persistence-quarkus/README.md @@ -123,6 +123,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-infinispan-persistence-quarkus/src/main/docker/Dockerfile.jvm index e9c3d78f50..5610f6f842 100644 --- a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-infinispan-persistence-quarkus/src/main/docker/Dockerfile.jvm @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/kogito-infinispan-persistence-quarkus-jvm . +# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/process-infinispan-persistence-quarkus-jvm . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/kogito-infinispan-persistence-quarkus-jvm +# docker run -i --rm -p 8080:8080 quarkus/process-infinispan-persistence-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-infinispan-persistence-quarkus/src/main/docker/Dockerfile.native index b508cbb1d3..4058c3da21 100644 --- a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-infinispan-persistence-quarkus/src/main/docker/Dockerfile.native @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native -t quarkus/kogito-infinispan-persistence-quarkus . +# docker build -f src/main/docker/Dockerfile.native -t quarkus/process-infinispan-persistence-quarkus . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/kogito-infinispan-persistence-quarkus +# docker run -i --rm -p 8080:8080 quarkus/process-infinispan-persistence-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-infinispan-persistence-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index cc6e2fe97c..0000000000 --- a/kogito-quarkus-examples/process-infinispan-persistence-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - kogito-infinispan-persistence-quarkus - 1.0-SNAPSHOT - - - - - - -
-
-

Congratulations, you have created a new Quarkus application.

- -

Why do you see this?

- -

This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

- -

What can I do from here?

- -

If not already done, run the application in dev mode using: mvn compile quarkus:dev. -

-
    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/application.properties. -
  • -
- -

How do I get rid of this page?

-

Just delete the src/main/resources/META-INF/resources/index.html file.

-
-
-
-

Application

-
    -
  • GroupId: org.acme
  • -
  • ArtifactId: kogito-infinispan-persistence-quarkus
  • -
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 0.19.1
  • -
-
- -
-
- - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-kafka-avro-multi-quarkus/README.md b/kogito-quarkus-examples/process-kafka-avro-multi-quarkus/README.md index 886e93b4ec..de9a02a369 100644 --- a/kogito-quarkus-examples/process-kafka-avro-multi-quarkus/README.md +++ b/kogito-quarkus-examples/process-kafka-avro-multi-quarkus/README.md @@ -14,13 +14,12 @@ A quick reminder of what the original example was doing: * if not processed traveller, info is logged and then process instance finishes sending a reply to a different Kafka topic The functionality is still the same, but the format of the event, rather than being a cloudevent JSON format, it is a representation of the traveller object using Avro format. To help us deal with the serialization details, -[jackson-kafka-avro-serializer](https://github.com/productboardlabs/jackson-kafka-avro-serializer) dependency is added to `pom.xml` +`kie-addons-quarkus-marshallers-avro` dependency is added to `pom.xml` ``` - - io.github.productboardlabs - jackson-kafka-avro-serializer - 0.7.0 + + org.kie + kie-addons-quarkus-marshallers-avro ``` @@ -122,6 +121,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ``` diff --git a/kogito-quarkus-examples/process-kafka-avro-multi-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-kafka-avro-multi-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index 1688079438..0000000000 --- a/kogito-quarkus-examples/process-kafka-avro-multi-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - kafka-quickstart - 1.0-SNAPSHOT - - - - - - -
-
-

Congratulations, you have created a new Quarkus application.

- -

Why do you see this?

- -

This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

- -

What can I do from here?

- -

If not already done, run the application in dev mode using: mvn compile quarkus:dev. -

-
    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/application.properties. -
  • -
- -

How do I get rid of this page?

-

Just delete the src/main/resources/META-INF/resources/index.html file.

-
-
-
-

Application

-
    -
  • GroupId: org.acme
  • -
  • ArtifactId: kafka-quickstart
  • -
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 0.18.0
  • -
-
- -
-
- - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-kafka-multi-quarkus/README.md b/kogito-quarkus-examples/process-kafka-multi-quarkus/README.md index d824553492..1bb522d903 100644 --- a/kogito-quarkus-examples/process-kafka-multi-quarkus/README.md +++ b/kogito-quarkus-examples/process-kafka-multi-quarkus/README.md @@ -111,6 +111,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ``` @@ -161,11 +166,11 @@ Content (cloud event format) ```json { - "specversion": "0.3", + "specversion": "1.0", "id": "21627e26-31eb-43e7-8343-92a696fd96b1", "source": "", - "type": "TravellersMessageDataEvent_3", - "time": "2022-02-24T13:25:16+0000", + "type": "travellers", + "time": "2022-02-24T13:25:16Z", "data": { "firstName" : "Jan", "lastName" : "Kowalski", @@ -177,7 +182,7 @@ Content (cloud event format) One liner ```json -{"specversion": "0.3","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}} +{"specversion": "1.0","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}} ``` @@ -207,7 +212,7 @@ this will then trigger the successful processing of the traveller and put anothe } ``` -there are bunch of extension attributes that starts with `kogito` to provide some context of the execution and the event producer. +there is a bunch of extension attributes that starts with `kogito` to provide some context of the execution and the event producer. To take the other path of the process put following message on `travellers` topic @@ -221,7 +226,7 @@ With the following content (Cloud Event Format) ```json { - "specversion": "0.3", + "specversion": "1.0", "id": "31627e26-31eb-43e7-8343-92a696fd96b1", "source": "", "type": "travellers", @@ -238,7 +243,7 @@ With the following content (Cloud Event Format) One Liner ```json -{"specversion": "0.3","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}} +{"specversion": "1.0","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}} ``` this will result in message being send to `cancelledtravelers` topic, according to this configuration diff --git a/kogito-quarkus-examples/process-kafka-multi-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-kafka-multi-quarkus/src/main/docker/Dockerfile.jvm index eaf393e837..0ca426515f 100644 --- a/kogito-quarkus-examples/process-kafka-multi-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-kafka-multi-quarkus/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-kafka-multi-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-kafka-multi-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-kafka-multi-quarkus/src/main/docker/Dockerfile.native index 80ff691a65..d79a0aef2c 100644 --- a/kogito-quarkus-examples/process-kafka-multi-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-kafka-multi-quarkus/src/main/docker/Dockerfile.native @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-kafka-multi-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-kafka-multi-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-kafka-multi-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index 1688079438..0000000000 --- a/kogito-quarkus-examples/process-kafka-multi-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - kafka-quickstart - 1.0-SNAPSHOT - - - - - - -
-
-

Congratulations, you have created a new Quarkus application.

- -

Why do you see this?

- -

This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

- -

What can I do from here?

- -

If not already done, run the application in dev mode using: mvn compile quarkus:dev. -

-
    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/application.properties. -
  • -
- -

How do I get rid of this page?

-

Just delete the src/main/resources/META-INF/resources/index.html file.

-
-
-
-

Application

-
    -
  • GroupId: org.acme
  • -
  • ArtifactId: kafka-quickstart
  • -
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 0.18.0
  • -
-
- -
-
- - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-kafka-persistence-quarkus/README.md b/kogito-quarkus-examples/process-kafka-persistence-quarkus/README.md index 8c1e8b8bd8..5e64654c05 100644 --- a/kogito-quarkus-examples/process-kafka-persistence-quarkus/README.md +++ b/kogito-quarkus-examples/process-kafka-persistence-quarkus/README.md @@ -107,6 +107,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-kafka-persistence-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-kafka-persistence-quarkus/src/main/docker/Dockerfile.jvm index 081c98debf..dfc200ff2f 100644 --- a/kogito-quarkus-examples/process-kafka-persistence-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-kafka-persistence-quarkus/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-kafka-persistence-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-kafka-persistence-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-kafka-persistence-quarkus/src/main/docker/Dockerfile.native index 3c420fea93..5cd76cc4ed 100644 --- a/kogito-quarkus-examples/process-kafka-persistence-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-kafka-persistence-quarkus/src/main/docker/Dockerfile.native @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native -t quarkus/kogito-infinispan-persistence-quarkus . +# docker build -f src/main/docker/Dockerfile.native -t quarkus/process-kafka-persistence-quarkus . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/kogito-kafka-persistence-quarkus +# docker run -i --rm -p 8080:8080 quarkus/process-kafka-persistence-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-kafka-persistence-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-kafka-persistence-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index c26803e187..0000000000 --- a/kogito-quarkus-examples/process-kafka-persistence-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - kogito-infinispan-persistence-quarkus - 1.0-SNAPSHOT - - - - - - -
-
-

Congratulations, you have created a new Quarkus application.

- -

Why do you see this?

- -

This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

- -

What can I do from here?

- -

If not already done, run the application in dev mode using: mvn compile quarkus:dev. -

-
    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/application.properties. -
  • -
- -

How do I get rid of this page?

-

Just delete the src/main/resources/META-INF/resources/index.html file.

-
-
-
-

Application

-
    -
  • GroupId: org.acme
  • -
  • ArtifactId: kogito-kafka-persistence-quarkus
  • -
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 1.8.3
  • -
-
- -
-
- - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/README.md b/kogito-quarkus-examples/process-kafka-quickstart-quarkus/README.md index db4bbe384a..1992bea867 100644 --- a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/README.md +++ b/kogito-quarkus-examples/process-kafka-quickstart-quarkus/README.md @@ -111,6 +111,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ``` @@ -154,11 +159,11 @@ Content (cloud event format) ```json { - "specversion": "0.3", + "specversion": "1.0", "id": "21627e26-31eb-43e7-8343-92a696fd96b1", "source": "", "type": "travellers", - "time": "2022-02-24T13:25:16+0000", + "time": "2022-02-24T13:25:16Z", "data": { "firstName" : "Jan", "lastName" : "Kowalski", @@ -170,7 +175,7 @@ Content (cloud event format) One liner ```json -{"specversion": "0.3","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16+0000","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}} +{"specversion": "1.0","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}} ``` @@ -178,29 +183,27 @@ this will then trigger the successful processing of the traveller and put anothe ```json { - "specversion": "0.3", - "id": "86f69dd6-7145-4188-aeaa-e44622eeec86", - "source": "", - "type": "TravellersMessageDataEvent_3", - "time": "2019-10-03T16:22:40.373523+02:00[Europe/Warsaw]", - "data": { - "firstName": "Jan", - "lastName": "Kowalski", - "email": "jan.kowalski@example.com", - "nationality": "Polish", - "processed": true - }, - "kogitoProcessinstanceId": "4fb091c2-82f7-4655-8687-245a4ab07483", - "kogitoParentProcessinstanceId": null, - "kogitoRootProcessinstanceId": null, - "kogitoProcessId": "Travellers", - "kogitoRootProcessId": null, - "kogitoProcessinstanceState": "1", - "kogitoReferenceId": null + "specversion": "1.0", + "id": "e84a4591-3581-42cd-bb2a-fac989ffd1a0", + "source": "/process/Travelers", + "type": "processedtravellers", + "time": "2024-06-05T11:30:49.722368+02:00", + "kogitoproctype": "BPMN", + "kogitoprocinstanceid": "66d1c981-9d6d-4c01-bc43-b712dc73b6cc", + "kogitoprocist": "Active", + "kogitoprocversion": "1.0", + "kogitoprocid": "Travelers", + "data": { + "firstName": "Jan", + "lastName": "Kowalski", + "email": "jan.kowalski@example.com", + "nationality": "Polish", + "processed": true + } } ``` -there are bunch of extension attributes that starts with `kogito` to provide some context of the execution and the event producer. +there are a bunch of extension attributes that starts with `kogito` to provide some context of the execution and the event producer. To take the other path of the process put following message on `travellers` topic @@ -214,11 +217,11 @@ With the following content (Cloud Event Format) ```json { - "specversion": "0.3", + "specversion": "1.0", "id": "31627e26-31eb-43e7-8343-92a696fd96b1", "source": "", "type": "travellers", - "time": "2022-02-24T13:25:16+0000", + "time": "2022-02-24T13:25:16Z", "data": { "firstName" : "John", "lastName" : "Doe", @@ -231,7 +234,7 @@ With the following content (Cloud Event Format) One Liner ```json -{"specversion": "0.3","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16+0000","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}} +{"specversion": "1.0","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}} ``` -this will not result in message being send to `processedtravelers` topic. +this will not result in message being sent to `processedtravelers` topic. diff --git a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-kafka-quickstart-quarkus/src/main/docker/Dockerfile.jvm index 78574625e3..2ad0a062fe 100644 --- a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-kafka-quickstart-quarkus/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-kafka-quickstart-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-kafka-quickstart-quarkus/src/main/docker/Dockerfile.native index 957b2ba60a..6e93db7e21 100644 --- a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-kafka-quickstart-quarkus/src/main/docker/Dockerfile.native @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native -t quarkus/kafka-quickstart . +# docker build -f src/main/docker/Dockerfile.native -t quarkus/process-kafka-quickstart-quarkus . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/kafka-quickstart +# docker run -i --rm -p 8080:8080 quarkus/process-kafka-quickstart-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-kafka-quickstart-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index 1688079438..0000000000 --- a/kogito-quarkus-examples/process-kafka-quickstart-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - kafka-quickstart - 1.0-SNAPSHOT - - - - - - -
-
-

Congratulations, you have created a new Quarkus application.

- -

Why do you see this?

- -

This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

- -

What can I do from here?

- -

If not already done, run the application in dev mode using: mvn compile quarkus:dev. -

-
    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/application.properties. -
  • -
- -

How do I get rid of this page?

-

Just delete the src/main/resources/META-INF/resources/index.html file.

-
-
-
-

Application

-
    -
  • GroupId: org.acme
  • -
  • ArtifactId: kafka-quickstart
  • -
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 0.18.0
  • -
-
- -
-
- - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-knative-quickstart-quarkus/README.md b/kogito-quarkus-examples/process-knative-quickstart-quarkus/README.md index dd8e63dd42..774e0edd84 100644 --- a/kogito-quarkus-examples/process-knative-quickstart-quarkus/README.md +++ b/kogito-quarkus-examples/process-knative-quickstart-quarkus/README.md @@ -120,6 +120,10 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` Note that this requires GRAALVM_HOME to point to a valid GraalVM installation diff --git a/kogito-quarkus-examples/process-mongodb-persistence-quarkus/README.md b/kogito-quarkus-examples/process-mongodb-persistence-quarkus/README.md index 274e6ab13f..4c1d628ddb 100644 --- a/kogito-quarkus-examples/process-mongodb-persistence-quarkus/README.md +++ b/kogito-quarkus-examples/process-mongodb-persistence-quarkus/README.md @@ -121,6 +121,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-mongodb-persistence-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-mongodb-persistence-quarkus/src/main/docker/Dockerfile.jvm index a201b741c2..0a9917e447 100644 --- a/kogito-quarkus-examples/process-mongodb-persistence-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-mongodb-persistence-quarkus/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-mongodb-persistence-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-mongodb-persistence-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-mongodb-persistence-quarkus/src/main/docker/Dockerfile.native index fe9ec08d58..109f195f80 100644 --- a/kogito-quarkus-examples/process-mongodb-persistence-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-mongodb-persistence-quarkus/src/main/docker/Dockerfile.native @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-mongodb-persistence-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-mongodb-persistence-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-mongodb-persistence-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index a79d3cddd4..0000000000 --- a/kogito-quarkus-examples/process-mongodb-persistence-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - process-mongodb-persistence-quarkus - 1.0-SNAPSHOT - - - - - - -
-
-

Congratulations, you have created a new Quarkus application.

- -

Why do you see this?

- -

This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

- -

What can I do from here?

- -

If not already done, run the application in dev mode using: mvn compile quarkus:dev. -

-
    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/application.properties. -
  • -
- -

How do I get rid of this page?

-

Just delete the src/main/resources/META-INF/resources/index.html file.

-
-
-
-

Application

-
    -
  • GroupId: org.acme
  • -
  • ArtifactId: process-mongodb-persistence-quarkus
  • -
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 0.19.1
  • -
-
- -
-
- - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-monitoring-quarkus/docker-compose.yml b/kogito-quarkus-examples/process-monitoring-quarkus/docker-compose.yml index fe2cf90c14..9ecdf51640 100644 --- a/kogito-quarkus-examples/process-monitoring-quarkus/docker-compose.yml +++ b/kogito-quarkus-examples/process-monitoring-quarkus/docker-compose.yml @@ -21,7 +21,7 @@ version: '2' services: hello: - build: . + image: org.kie.kogito.examples/process-monitoring-quarkus:1.0 ports: - 8080:8080 diff --git a/kogito-quarkus-examples/process-monitoring-quarkus/pom.xml b/kogito-quarkus-examples/process-monitoring-quarkus/pom.xml index 2e25acde99..2446331927 100755 --- a/kogito-quarkus-examples/process-monitoring-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-monitoring-quarkus/pom.xml @@ -68,6 +68,10 @@ org.kie kie-addons-quarkus-monitoring-prometheus
+ + io.quarkus + quarkus-container-image-jib + io.quarkus quarkus-smallrye-openapi diff --git a/kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/application.properties b/kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/application.properties index c27ab72359..4bbbce90e6 100644 --- a/kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/application.properties +++ b/kogito-quarkus-examples/process-monitoring-quarkus/src/main/resources/application.properties @@ -18,3 +18,9 @@ # quarkus.swagger-ui.always-include=true + +# Container image +quarkus.container-image.build=true +quarkus.container-image.group=org.kie.kogito.examples +quarkus.container-image.name=process-monitoring-quarkus +quarkus.container-image.tag=1.0 diff --git a/kogito-quarkus-examples/process-performance-quarkus/README.md b/kogito-quarkus-examples/process-performance-quarkus/README.md index 8c5c2c4ef5..22a9e68b4f 100644 --- a/kogito-quarkus-examples/process-performance-quarkus/README.md +++ b/kogito-quarkus-examples/process-performance-quarkus/README.md @@ -49,6 +49,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ``` diff --git a/kogito-quarkus-examples/process-postgresql-persistence-quarkus/README.md b/kogito-quarkus-examples/process-postgresql-persistence-quarkus/README.md index b56e9a7058..c6d3111ba0 100644 --- a/kogito-quarkus-examples/process-postgresql-persistence-quarkus/README.md +++ b/kogito-quarkus-examples/process-postgresql-persistence-quarkus/README.md @@ -59,7 +59,7 @@ It utilizes PostgreSQL server as the backend store. This quickstart requires a PostgreSQL server to be available with a database, a user and credentials already created , these configurations should then be set in the data source URL parameter in [applications.properties](src/main/resources/application.properties) file with the key - `quarkus.datasource.reactive.url`, i.e `quarkus.datasource.reactive.url=postgresql://localhost:5432/kogito` here are the [full settings for URI](https://quarkus.io/guides/reactive-sql-clients#reactive-datasource) + `quarkus.datasource.jdbc.url`, i.e `quarkus.datasource.jdbc.url=postgresql://localhost:5432/kogito`. You must set the property `kogito.persistence.type=postgresql` to enable PostgreSQL persistence. There is also a configuration to allow the application to run DDL scripts during the initialization, which you can enable with the @@ -134,6 +134,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/docker/Dockerfile.jvm index f58feb9b3f..a61d75e741 100644 --- a/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-postgresql-persistence-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/docker/Dockerfile.native index 7e40ad5732..4320540157 100644 --- a/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/docker/Dockerfile.native @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-postgresql-persistence-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/resources/application.properties b/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/resources/application.properties index a68288a52e..8919fc3679 100644 --- a/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/resources/application.properties +++ b/kogito-quarkus-examples/process-postgresql-persistence-quarkus/src/main/resources/application.properties @@ -21,25 +21,7 @@ quarkus.swagger-ui.always-include=true kogito.persistence.type=jdbc quarkus.datasource.db-kind=postgresql -#quarkus.datasource.username=postgres -#quarkus.datasource.password=changeme -#quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/jdbc_test +%prod.quarkus.datasource.username=kogito-user +%prod.quarkus.datasource.password=kogito-pass +%prod.quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/kogito quarkus.flyway.migrate-at-start=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 - -mp.messaging.outgoing.kogito-processdefinitions-events.connector=smallrye-kafka -mp.messaging.outgoing.kogito-processdefinitions-events.topic=kogito-processdefinitions-events -mp.messaging.outgoing.kogito-processdefinitions-events.value.serializer=org.apache.kafka.common.serialization.StringSerializer diff --git a/kogito-quarkus-examples/process-quarkus-example/README.md b/kogito-quarkus-examples/process-quarkus-example/README.md index 4323470447..d03a817ac4 100644 --- a/kogito-quarkus-examples/process-quarkus-example/README.md +++ b/kogito-quarkus-examples/process-quarkus-example/README.md @@ -43,6 +43,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ``` diff --git a/kogito-quarkus-examples/process-rest-service-call-quarkus/README.md b/kogito-quarkus-examples/process-rest-service-call-quarkus/README.md index 4db274c004..fef23edc2f 100644 --- a/kogito-quarkus-examples/process-rest-service-call-quarkus/README.md +++ b/kogito-quarkus-examples/process-rest-service-call-quarkus/README.md @@ -80,6 +80,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-rest-service-call-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-rest-service-call-quarkus/src/main/docker/Dockerfile.jvm index 85f68f01b2..9035593d3f 100644 --- a/kogito-quarkus-examples/process-rest-service-call-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-rest-service-call-quarkus/src/main/docker/Dockerfile.jvm @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/process-service-rest-call-quarkus-jvm . +# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/process-rest-service-call-quarkus-jvm . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/process-service-rest-call-quarkus-jvm +# docker run -i --rm -p 8080:8080 quarkus/process-rest-service-call-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-rest-service-call-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-rest-service-call-quarkus/src/main/docker/Dockerfile.native index b508cbb1d3..6f9a5614d9 100644 --- a/kogito-quarkus-examples/process-rest-service-call-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-rest-service-call-quarkus/src/main/docker/Dockerfile.native @@ -7,16 +7,16 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native -t quarkus/kogito-infinispan-persistence-quarkus . +# docker build -f src/main/docker/Dockerfile.native -t quarkus/process-rest-service-call-quarkus . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/kogito-infinispan-persistence-quarkus +# docker run -i --rm -p 8080:8080 quarkus/process-rest-service-call-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work EXPOSE 8080 -CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] \ No newline at end of file +CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] diff --git a/kogito-quarkus-examples/process-rest-service-call-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-rest-service-call-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index cc6e2fe97c..0000000000 --- a/kogito-quarkus-examples/process-rest-service-call-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - kogito-infinispan-persistence-quarkus - 1.0-SNAPSHOT - - - - - - -
-
-

Congratulations, you have created a new Quarkus application.

- -

Why do you see this?

- -

This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

- -

What can I do from here?

- -

If not already done, run the application in dev mode using: mvn compile quarkus:dev. -

-
    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/application.properties. -
  • -
- -

How do I get rid of this page?

-

Just delete the src/main/resources/META-INF/resources/index.html file.

-
-
-
-

Application

-
    -
  • GroupId: org.acme
  • -
  • ArtifactId: kogito-infinispan-persistence-quarkus
  • -
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 0.19.1
  • -
-
- -
-
- - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-rest-service-call-quarkus/src/main/resources/application.properties b/kogito-quarkus-examples/process-rest-service-call-quarkus/src/main/resources/application.properties index 0bf4f46b1f..d3332094ef 100644 --- a/kogito-quarkus-examples/process-rest-service-call-quarkus/src/main/resources/application.properties +++ b/kogito-quarkus-examples/process-rest-service-call-quarkus/src/main/resources/application.properties @@ -23,4 +23,4 @@ quarkus.swagger-ui.always-include=true org.acme.travels.rest.UsersRemoteService/mp-rest/url=https://petstore.swagger.io -org.acme.travels.rest.UsersRemoteService/mp-rest/scope=javax.enterprise.context.ApplicationScoped \ No newline at end of file +org.acme.travels.rest.UsersRemoteService/mp-rest/scope=jakarta.enterprise.context.ApplicationScoped \ No newline at end of file diff --git a/kogito-quarkus-examples/process-rest-service-call-quarkus/src/test/resources/application.properties b/kogito-quarkus-examples/process-rest-service-call-quarkus/src/test/resources/application.properties index b7c9de9a09..019f9366ad 100644 --- a/kogito-quarkus-examples/process-rest-service-call-quarkus/src/test/resources/application.properties +++ b/kogito-quarkus-examples/process-rest-service-call-quarkus/src/test/resources/application.properties @@ -21,4 +21,4 @@ quarkus.http.test-port=0 org.acme.travels.rest.UsersRemoteService/mp-rest/url=https://petstore.swagger.io -org.acme.travels.rest.UsersRemoteService/mp-rest/scope=javax.enterprise.context.ApplicationScoped \ No newline at end of file +org.acme.travels.rest.UsersRemoteService/mp-rest/scope=jakarta.enterprise.context.ApplicationScoped \ No newline at end of file diff --git a/kogito-quarkus-examples/process-rest-workitem-multi-quarkus/README.md b/kogito-quarkus-examples/process-rest-workitem-multi-quarkus/README.md index ed307fdb71..6f2561e94c 100644 --- a/kogito-quarkus-examples/process-rest-workitem-multi-quarkus/README.md +++ b/kogito-quarkus-examples/process-rest-workitem-multi-quarkus/README.md @@ -47,6 +47,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Compile and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```text @@ -66,6 +71,7 @@ with following content ```json { + "port": 8080, "inputNumbers": { "numbers": [ 1, @@ -85,11 +91,11 @@ with following content Complete curl command can be found below: ```text -curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"inputNumbers" : {"numbers": [1,2,3,4,5,6,7,8,7]}}' http://localhost:8080/RestExample +curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"inputNumbers" : {"port":8080, "numbers": [1,2,3,4,5,6,7,8,7]}}' http://localhost:8080/RestExample ``` curl response will be something like this, which includes field `sum`, the result of multiplying each input number by 8 (that number might differ in your execution) and summing all of them: ```text -{"id":"8e79ac60-c0c1-40d0-808e-8d3585307661","randomNumber":8,"sum":344,"inputNumbers":{"numbers":[1,2,3,4,5,6,7,8,7]}} +{"id":"8e79ac60-c0c1-40d0-808e-8d3585307661","port":8080,"randomNumber":8,"sum":344,"inputNumbers":{"numbers":[1,2,3,4,5,6,7,8,7]}} ``` diff --git a/kogito-quarkus-examples/process-rest-workitem-quarkus/README.md b/kogito-quarkus-examples/process-rest-workitem-quarkus/README.md index 91c464c7b8..6a8ffbd94a 100644 --- a/kogito-quarkus-examples/process-rest-workitem-quarkus/README.md +++ b/kogito-quarkus-examples/process-rest-workitem-quarkus/README.md @@ -84,6 +84,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-rest-workitem-quarkus/pom.xml b/kogito-quarkus-examples/process-rest-workitem-quarkus/pom.xml index d785a78edf..e4a9cfef3a 100644 --- a/kogito-quarkus-examples/process-rest-workitem-quarkus/pom.xml +++ b/kogito-quarkus-examples/process-rest-workitem-quarkus/pom.xml @@ -79,10 +79,6 @@ io.quarkus quarkus-smallrye-openapi
- - io.quarkus - quarkus-rest-client - io.quarkus quarkus-junit5 diff --git a/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/docker/Dockerfile.jvm index 85f68f01b2..c357883772 100644 --- a/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/docker/Dockerfile.jvm @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/process-service-rest-call-quarkus-jvm . +# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/process-rest-workitem-quarkus-jvm . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/process-service-rest-call-quarkus-jvm +# docker run -i --rm -p 8080:8080 quarkus/process-rest-workitem-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter @@ -23,4 +23,4 @@ COPY target/quarkus-app/*.jar /deployments/ COPY target/quarkus-app/app/ /deployments/app/ COPY target/quarkus-app/quarkus/ /deployments/quarkus/ -ENTRYPOINT [ "/deployments/run-java.sh" ] \ No newline at end of file +ENTRYPOINT [ "/deployments/run-java.sh" ] diff --git a/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/docker/Dockerfile.native index b508cbb1d3..d825de4b48 100644 --- a/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/docker/Dockerfile.native @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native -t quarkus/kogito-infinispan-persistence-quarkus . +# docker build -f src/main/docker/Dockerfile.native -t quarkus/process-rest-workitem-quarkus . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/kogito-infinispan-persistence-quarkus +# docker run -i --rm -p 8080:8080 quarkus/process-rest-workitem-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/java/org/acme/travels/rest/UsersRemoteService.java b/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/java/org/acme/travels/rest/UserResource.java similarity index 83% rename from kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/java/org/acme/travels/rest/UsersRemoteService.java rename to kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/java/org/acme/travels/rest/UserResource.java index 9cf97fe664..9e8ee5c798 100644 --- a/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/java/org/acme/travels/rest/UsersRemoteService.java +++ b/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/java/org/acme/travels/rest/UserResource.java @@ -19,19 +19,23 @@ package org.acme.travels.rest; import org.acme.travels.User; -import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; +import jakarta.inject.Inject; import jakarta.ws.rs.GET; import jakarta.ws.rs.Path; import jakarta.ws.rs.PathParam; import jakarta.ws.rs.Produces; @Path("/v2") -@RegisterRestClient -public interface UsersRemoteService { +public class UserResource { + + @Inject + UserService userService; @GET @Path("/user/{username}") @Produces("application/json") - User get(@PathParam("username") String username); + public User getUser(@PathParam("username") String username) { + return userService.getUser(username); + } } diff --git a/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/java/org/acme/travels/rest/UserService.java b/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/java/org/acme/travels/rest/UserService.java new file mode 100644 index 0000000000..f4f89a0a00 --- /dev/null +++ b/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/java/org/acme/travels/rest/UserService.java @@ -0,0 +1,18 @@ +package org.acme.travels.rest; + +import org.acme.travels.User; + +import jakarta.enterprise.context.ApplicationScoped; + +@ApplicationScoped +public class UserService { + + public User getUser(String name) { + if ("test".equals(name)) { + User user = new User(); + user.setLastName(name); + return user; + } + return null; + } +} diff --git a/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/resources/application.properties b/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/resources/application.properties index 0bf4f46b1f..9553ee92e4 100644 --- a/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/resources/application.properties +++ b/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/resources/application.properties @@ -21,6 +21,3 @@ # quarkus.package.type=fast-jar quarkus.swagger-ui.always-include=true - -org.acme.travels.rest.UsersRemoteService/mp-rest/url=https://petstore.swagger.io -org.acme.travels.rest.UsersRemoteService/mp-rest/scope=javax.enterprise.context.ApplicationScoped \ No newline at end of file diff --git a/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/resources/org/acme/travels/users.bpmn b/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/resources/org/acme/travels/users.bpmn index 27a92410df..6be2d68d1c 100644 --- a/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/resources/org/acme/travels/users.bpmn +++ b/kogito-quarkus-examples/process-rest-workitem-quarkus/src/main/resources/org/acme/travels/users.bpmn @@ -1,13 +1,25 @@ - + + + + - + + + + - + + _E5D17755-D671-43ED-BD7D-F6538933069C_InMessage + _E5D17755-D671-43ED-BD7D-F6538933069C_OutMessage + + + + @@ -21,21 +33,21 @@ - + - + - + - + - + - + @@ -57,13 +69,15 @@ _DBA10C00-6407-4EF5-9D85-01177AE8F39F _1A98DE32-CF81-424B-A59E-6D22899E31C0 - + + - _296CCA4D-3C70-469C-A10E-2FF421D4D7A8_EndpointInputX + _296CCA4D-3C70-469C-A10E-2FF421D4D7A8_UrlInputX _296CCA4D-3C70-469C-A10E-2FF421D4D7A8_usernameInputX + _296CCA4D-3C70-469C-A10E-2FF421D4D7A8_PortInputX _296CCA4D-3C70-469C-A10E-2FF421D4D7A8_TaskNameInputX @@ -71,16 +85,23 @@ - _296CCA4D-3C70-469C-A10E-2FF421D4D7A8_EndpointInputX + _296CCA4D-3C70-469C-A10E-2FF421D4D7A8_UrlInputX - + username _296CCA4D-3C70-469C-A10E-2FF421D4D7A8_usernameInputX + + _296CCA4D-3C70-469C-A10E-2FF421D4D7A8_PortInputX + + + + + _296CCA4D-3C70-469C-A10E-2FF421D4D7A8_TaskNameInputX @@ -88,6 +109,10 @@ + + _296CCA4D-3C70-469C-A10E-2FF421D4D7A8_ResultOutputX + traveller + @@ -131,8 +156,8 @@ _1A98DE32-CF81-424B-A59E-6D22899E31C0 - _BF17E37C-6984-4F27-9B6A-A9880E95B019 _4EFC11AE-52BB-4EEF-B241-CFAAE4B7AE93 + _BF17E37C-6984-4F27-9B6A-A9880E95B019 @@ -171,15 +196,15 @@ + + + + - - - - @@ -241,7 +266,7 @@ - _1ztzQLGyEDmz-aPY8v7uEg - _1ztzQLGyEDmz-aPY8v7uEg + _yBVmwPqbEDyfjZKSxf4Vqg + _yBVmwPqbEDyfjZKSxf4Vqg \ No newline at end of file diff --git a/kogito-quarkus-examples/process-rest-workitem-quarkus/src/test/resources/application.properties b/kogito-quarkus-examples/process-rest-workitem-quarkus/src/test/resources/application.properties index b7c9de9a09..019f9366ad 100644 --- a/kogito-quarkus-examples/process-rest-workitem-quarkus/src/test/resources/application.properties +++ b/kogito-quarkus-examples/process-rest-workitem-quarkus/src/test/resources/application.properties @@ -21,4 +21,4 @@ quarkus.http.test-port=0 org.acme.travels.rest.UsersRemoteService/mp-rest/url=https://petstore.swagger.io -org.acme.travels.rest.UsersRemoteService/mp-rest/scope=javax.enterprise.context.ApplicationScoped \ No newline at end of file +org.acme.travels.rest.UsersRemoteService/mp-rest/scope=jakarta.enterprise.context.ApplicationScoped \ No newline at end of file diff --git a/kogito-quarkus-examples/process-saga-quarkus/README.md b/kogito-quarkus-examples/process-saga-quarkus/README.md index 53fa0887eb..5122c01703 100644 --- a/kogito-quarkus-examples/process-saga-quarkus/README.md +++ b/kogito-quarkus-examples/process-saga-quarkus/README.md @@ -66,6 +66,11 @@ java -jar target/process-saga-quarkus-runner.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ``` @@ -95,7 +100,7 @@ Once the service is up and running, you can use the following examples to intera ### Starting the Order Saga -#### POST /orders +#### POST /order Allows to start a new Order Saga with the given data: @@ -111,7 +116,7 @@ Given data: 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"}' +curl -H "Content-Type: application/json" -X POST http://localhost:8080/order -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 @@ -168,7 +173,7 @@ Example: 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", "failService" : "PaymentService"}' +curl -H "Content-Type: application/json" -X POST http://localhost:8080/order -d '{"orderId" : "03e6cf79-3301-434b-b5e1-d6899b5639aa", "failService" : "PaymentService"}' ``` Response example: diff --git a/kogito-quarkus-examples/process-scripts-quarkus/README.md b/kogito-quarkus-examples/process-scripts-quarkus/README.md index 13eb9996dd..65066692a6 100644 --- a/kogito-quarkus-examples/process-scripts-quarkus/README.md +++ b/kogito-quarkus-examples/process-scripts-quarkus/README.md @@ -61,6 +61,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-scripts-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-scripts-quarkus/src/main/docker/Dockerfile.jvm index 3f72cf2ffb..6c017c3a77 100644 --- a/kogito-quarkus-examples/process-scripts-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-scripts-quarkus/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-scripts-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-scripts-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-scripts-quarkus/src/main/docker/Dockerfile.native index b508cbb1d3..a9454a415d 100644 --- a/kogito-quarkus-examples/process-scripts-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-scripts-quarkus/src/main/docker/Dockerfile.native @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native -t quarkus/kogito-infinispan-persistence-quarkus . +# docker build -f src/main/docker/Dockerfile.native -t quarkus/process-scripts-quarkus . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/kogito-infinispan-persistence-quarkus +# docker run -i --rm -p 8080:8080 quarkus/process-scripts-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-scripts-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-scripts-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index cc6e2fe97c..0000000000 --- a/kogito-quarkus-examples/process-scripts-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - kogito-infinispan-persistence-quarkus - 1.0-SNAPSHOT - - - - - - -
-
-

Congratulations, you have created a new Quarkus application.

- -

Why do you see this?

- -

This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

- -

What can I do from here?

- -

If not already done, run the application in dev mode using: mvn compile quarkus:dev. -

-
    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/application.properties. -
  • -
- -

How do I get rid of this page?

-

Just delete the src/main/resources/META-INF/resources/index.html file.

-
-
-
-

Application

-
    -
  • GroupId: org.acme
  • -
  • ArtifactId: kogito-infinispan-persistence-quarkus
  • -
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 0.19.1
  • -
-
- -
-
- - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-service-calls-quarkus/README.md b/kogito-quarkus-examples/process-service-calls-quarkus/README.md index 1c67012d9a..d0c4e4f7ce 100644 --- a/kogito-quarkus-examples/process-service-calls-quarkus/README.md +++ b/kogito-quarkus-examples/process-service-calls-quarkus/README.md @@ -97,6 +97,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-service-calls-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-service-calls-quarkus/src/main/docker/Dockerfile.jvm index 5b9b2c40dc..8c37c500a9 100644 --- a/kogito-quarkus-examples/process-service-calls-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-service-calls-quarkus/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-service-calls-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-service-calls-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-service-calls-quarkus/src/main/docker/Dockerfile.native index b508cbb1d3..265fcdb472 100644 --- a/kogito-quarkus-examples/process-service-calls-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-service-calls-quarkus/src/main/docker/Dockerfile.native @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native -t quarkus/kogito-infinispan-persistence-quarkus . +# docker build -f src/main/docker/Dockerfile.native -t quarkus/process-service-calls-quarkus . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/kogito-infinispan-persistence-quarkus +# docker run -i --rm -p 8080:8080 quarkus/process-service-calls-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-service-calls-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-service-calls-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index cc6e2fe97c..0000000000 --- a/kogito-quarkus-examples/process-service-calls-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - kogito-infinispan-persistence-quarkus - 1.0-SNAPSHOT - - - - - - -
-
-

Congratulations, you have created a new Quarkus application.

- -

Why do you see this?

- -

This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

- -

What can I do from here?

- -

If not already done, run the application in dev mode using: mvn compile quarkus:dev. -

-
    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/application.properties. -
  • -
- -

How do I get rid of this page?

-

Just delete the src/main/resources/META-INF/resources/index.html file.

-
-
-
-

Application

-
    -
  • GroupId: org.acme
  • -
  • ArtifactId: kogito-infinispan-persistence-quarkus
  • -
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 0.19.1
  • -
-
- -
-
- - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-timer-quarkus/README.md b/kogito-quarkus-examples/process-timer-quarkus/README.md index 74908c24bf..7f8dc8a1c2 100644 --- a/kogito-quarkus-examples/process-timer-quarkus/README.md +++ b/kogito-quarkus-examples/process-timer-quarkus/README.md @@ -186,6 +186,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-timer-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-timer-quarkus/src/main/docker/Dockerfile.jvm index d1b303e72b..0001a08a9a 100644 --- a/kogito-quarkus-examples/process-timer-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-timer-quarkus/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-timer-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-timer-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-timer-quarkus/src/main/docker/Dockerfile.native index b508cbb1d3..523dd9aff9 100644 --- a/kogito-quarkus-examples/process-timer-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-timer-quarkus/src/main/docker/Dockerfile.native @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native -t quarkus/kogito-infinispan-persistence-quarkus . +# docker build -f src/main/docker/Dockerfile.native -t quarkus/process-timer-quarkus . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/kogito-infinispan-persistence-quarkus +# docker run -i --rm -p 8080:8080 quarkus/process-timer-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-timer-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-timer-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index cc6e2fe97c..0000000000 --- a/kogito-quarkus-examples/process-timer-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - kogito-infinispan-persistence-quarkus - 1.0-SNAPSHOT - - - - - - -
-
-

Congratulations, you have created a new Quarkus application.

- -

Why do you see this?

- -

This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

- -

What can I do from here?

- -

If not already done, run the application in dev mode using: mvn compile quarkus:dev. -

-
    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/application.properties. -
  • -
- -

How do I get rid of this page?

-

Just delete the src/main/resources/META-INF/resources/index.html file.

-
-
-
-

Application

-
    -
  • GroupId: org.acme
  • -
  • ArtifactId: kogito-infinispan-persistence-quarkus
  • -
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 0.19.1
  • -
-
- -
-
- - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/README.md b/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/README.md index 9b18f5c84f..a01919344a 100644 --- a/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/README.md +++ b/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/README.md @@ -88,6 +88,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/src/main/docker/Dockerfile.jvm index 37d2444940..a1075b9a16 100644 --- a/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-usertasks-custom-lifecycle-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/src/main/docker/Dockerfile.native index b508cbb1d3..72a3638697 100644 --- a/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/src/main/docker/Dockerfile.native @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native -t quarkus/kogito-infinispan-persistence-quarkus . +# docker build -f src/main/docker/Dockerfile.native -t quarkus/process-usertasks-custom-lifecycle-quarkus . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/kogito-infinispan-persistence-quarkus +# docker run -i --rm -p 8080:8080 quarkus/process-usertasks-custom-lifecycle-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index cc6e2fe97c..0000000000 --- a/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - kogito-infinispan-persistence-quarkus - 1.0-SNAPSHOT - - - - - - -
-
-

Congratulations, you have created a new Quarkus application.

- -

Why do you see this?

- -

This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

- -

What can I do from here?

- -

If not already done, run the application in dev mode using: mvn compile quarkus:dev. -

-
    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/application.properties. -
  • -
- -

How do I get rid of this page?

-

Just delete the src/main/resources/META-INF/resources/index.html file.

-
-
-
-

Application

-
    -
  • GroupId: org.acme
  • -
  • ArtifactId: kogito-infinispan-persistence-quarkus
  • -
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 0.19.1
  • -
-
- -
-
- - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-usertasks-quarkus/README.md b/kogito-quarkus-examples/process-usertasks-quarkus/README.md index ff6548c8b2..d8075e48b4 100644 --- a/kogito-quarkus-examples/process-usertasks-quarkus/README.md +++ b/kogito-quarkus-examples/process-usertasks-quarkus/README.md @@ -75,6 +75,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-usertasks-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-usertasks-quarkus/src/main/docker/Dockerfile.jvm index ec46ab84c7..7b27d886e8 100644 --- a/kogito-quarkus-examples/process-usertasks-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-usertasks-quarkus/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-usertasks-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-usertasks-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-usertasks-quarkus/src/main/docker/Dockerfile.native index b508cbb1d3..d7370681e1 100644 --- a/kogito-quarkus-examples/process-usertasks-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-usertasks-quarkus/src/main/docker/Dockerfile.native @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native -t quarkus/kogito-infinispan-persistence-quarkus . +# docker build -f src/main/docker/Dockerfile.native -t quarkus/process-usertasks-quarkus . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/kogito-infinispan-persistence-quarkus +# docker run -i --rm -p 8080:8080 quarkus/process-usertasks-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-usertasks-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-usertasks-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index cc6e2fe97c..0000000000 --- a/kogito-quarkus-examples/process-usertasks-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - kogito-infinispan-persistence-quarkus - 1.0-SNAPSHOT - - - - - - -
-
-

Congratulations, you have created a new Quarkus application.

- -

Why do you see this?

- -

This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

- -

What can I do from here?

- -

If not already done, run the application in dev mode using: mvn compile quarkus:dev. -

-
    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/application.properties. -
  • -
- -

How do I get rid of this page?

-

Just delete the src/main/resources/META-INF/resources/index.html file.

-
-
-
-

Application

-
    -
  • GroupId: org.acme
  • -
  • ArtifactId: kogito-infinispan-persistence-quarkus
  • -
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 0.19.1
  • -
-
- -
-
- - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/README.md b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/README.md deleted file mode 100644 index 1b3c4418c8..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/README.md +++ /dev/null @@ -1,538 +0,0 @@ -# Process user tasks with timer with persistence addon : Hiring - -## Description - -This example showcases a basic implementation of the **Hiring** process that drives a *Candidate* through different -interviews until he gets hired. - -This quickstart project shows a simple example user task orchestration including the use of DMN decisions to -generate the candidate offer and timers to skip User Tasks. - -This example also demonstrates how to configure the whole *Kogito* environment using the new *Compact Architecture* that -enable simplifying the communication among *Kogito* services removing the need of events (Kafka/HTTP) between them. This can -be achieved using the following *Quarkus* addons: -- `kogito-addons-quarkus-data-index-persistence-postgresql`: enables the *Kogito Runtime* persisting directly into the -*Data-Index* database. -- `kogito-addons-quarkus-jobs`: enables collocating the *Jobs Service* inside the *Kogito Runtime*. - -## The Java models - -The **Hiring** process uses two POJOs to handle the process data, both of them can be found in the *org.kie.kogito.hr* package. - -The `CandidateData` POJO is the input of the process. It represents the person that wants to get the job. - -```java -public class CandidateData { - - private String name; // Name of the candidate - private String lastName; // Last name of the candidate - private String email; // Email of the candidate - private Integer experience; // Years of experience - private List skills; // List of technical skills - - // Constructors, setters, getters... -} -``` - -The `Offer` POJO is the output of the process and represents the job offer that will be sent to the candidate. -It will be automatically calculated during the process execution depending on the candidate years of experience & skills. -```java -public class Offer { - - private String category; // Job category based on the candidate experience - private Integer salary; // Salary based on the candidate experience and skills - - // Constructors, setters, getters... -} -``` -## The *New Hiring Offer* DMN -This example makes use of the *New Hiring Offer* DMN to generate a base offer for the `Candidate`. The DMN looks like this: - -In this simple DMN we have an `Offer` *Decision*, that will generate the candidate offer, which -has a requirement of a `CandidateData` *Input Data*. - -
-
- DMN Diagram -
New Hiring Offer DMN diagram
-
-
- -The DMN defines the following data types (`tCandidateData` & `tOffer` ) matching the POJOs defined in the project -(`CandidateData.java` & `Offer.java`): - -
-
- DMN Type Definitions -
New Hiring Offer DMN types
-
-
- -As expected, `CandidateData` *Input Data* & `Offer` *Decision* have a `tCandidateData` data - -The `Offer` decision uses the following *Boxed Expression* to generate the `tOffer`: - -
-
- DMN Decision -
New Hiring Offer DMN decision
-
-
- -## The Hiring Process -### Process variables - -The process handles the following _Variables_: - -| Variable | Type | Tags | Description | -|--------------------|-----------------------------------|--------------|---------------------------------------------------| -| **candidateData** | `org.kie.kogito.hr.CandidateData` | **input** | The candidate data | -| **offer** | `org.kie.kogito.hr.Offer` | **output** | The generated candidate offer | -| **hr_approval** | `Boolean` | **internal** | Determines that HR department approves the hiring | -| **it_approval** | `Boolean` | **internal** | Determines that IT department approves the hiring | - -### The BPMN Process - -
-
- Hiring Process Diagram -
Hiring Process Diagram
-
-
- -The process starts receiving the `CandidateData` as an input and storing it into the `candidateData` variable, and if the -candidate meets two minimal requirements, the process will continue and reach the **Generate base offer**, otherwise the -candidate application will be denied and the process will complete without sending the `offer` to the candidate. - -The **Generate base offer** is a *Business Rule Task* that will use the *New Hiring Offer* decision defined in the -`NewHiringOffer.dmn` to generate the an `Offer` based on the candidate experience and skills. The task takes the `candidateData` -as an input and will produce an instance of `org.kie.kogito.hr.Offer` that will be stored in the `offer` variable. - - -
-
- Offer assignments -
Generate base Offer data assignments
-
-
- -After the `offer` has been generated, the process will jump into the **HR Interview** *User Task*, where the candidate we'll -be interviewed by the *HR* department. The task takes the `candidateData` and `offer` as inputs and as an output will produce -the `hr_approve` boolean and an updated `offer`. - -
-
- HR Interview assignments -
HR Interviewr task data assignments
-
-
- -The **HR Interview** *User Task* also has a *Boundary Timer Event* that will prevent the task to delay and will cancel the -task after certain time (for example purpose just 3 minutes). This *Boundary Timer Event* will schedule a Job in the Jobs Service -that when trigger will notify the *Kogito Runtime* to cancel the task and deny the application. - -If **HR Interview** successfully completed, the process will jump into the **IT Interview** *User Task*. Again the candidate -we'll have a second interview with the *IT* department. Again, this task will take the `candidateData` and `offer` as inputs -but as an output will produce the `it_approve` boolean. - -
-
- IT Interview assignments -
IT Interviewr task data assignments
-
-
- - -Once both tasks are completed, if the candidate got the approvals from *HR* & *IT* (both `hr_interview` & `hr_interview` being true) -the process will jump into the **Send Offer to Candidate** *Script Task* that will notify the candidate about the offer -and the process will end. - -> **NOTE:** for simplicity, all the *User Tasks* in this example are assigned to the *jdoe* user present in the keycloak configuration - -## Running the example -### Prerequisites - -* Java 17+ installed -* Environment variable JAVA_HOME set accordingly -* Maven 3.9.3+ installed -* Docker and Docker Compose to run the required example infrastructure. - -And when using native image compilation, you will also need: -- GraalVM 20.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. - -### 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. - -- PostgreSQL: 5432 -- Data Index: 8180 -- Management Console: 8280 -- Task Console: 8380 -- Keycloak: 8480 -- PgAdmin: 8055 -- Kogito Example Service: 8080 - -To help bootstraping the Infrastructure Services, the example provides the `startServices.sh` script inside the *docker-compose* -folder. - -> **_NOTE_**: the docker compose template requires using _extra_hosts_ to allow the services use the host network, this may -> carry some issues if you are using a **podman** version older than **4.7**. - -### Building & Running the example - -To build the example, on a Terminal, run the following command: -```shell -mvn clean package -Pcontainer -``` -This will build the example quarkus application and create a Docker image that will be started in the `docker-compose` template. - -To execute the full example (including consoles), open a Terminal and run the following command inside the `docker-compose` folder: - -```shell -sh startServices.sh -``` - -Additionally, if you want to start only the example and the minimal Infrastructure Services (PostgreSQL, Data-Index and Jobs Service), -you can run the same `startServices.sh` script but passing the `example` argument - -```shell -sh startServices.sh example -``` - -> **_NOTE:_** starting the Infrastructure Services, please consider running a ```mvn clean package -Pcontainer``` -> command on the project root before running the ```startServices.sh``` script for the first time or any time you modify the project. - -### Running the example in Development mode - -To run the example in Development mode, just run the following command in a Terminal: - -```shell -mvn clean package quarkus:dev -Pdevelopment -``` - -The Development Mode will embed all the needed Infrastructure Services (PostgreSQL, Data-Index & Jobs Service) and won't -require any extra step. - -The `development` profile includes the **Runtime Tools Quarkus Extension** that exposes a new section in the **Quarkus Dev-UI** -unifying the **Management Console** & **Task Console** functionalities. **Quarkus Dev-UI** is available at http://localhost:8080/q/dev - -> **_NOTE:_** For more information about how to work with Kogito Runtime Tools Quarkus Extension, please refer to the [Kogito Documentation](https://docs.kogito.kie.org/latest/html_single/#con-runtime-tools-dev-ui_kogito-developing-process-services) page. - -### Starting an instance of the Hiring Process - -Once the service is up and running you can make use of the **Hiring** application by a sending request to `http://localhost:8080/hiring`. - -Sending the following valid `CandidateData` will start a process instance that will land into the *HR Interview* task: - -```json -{ - "candidateData": { - "name": "Jon", - "lastName": "Snow", - "email": "jon@snow.org", - "experience": 5, - "skills": [ - "Java", "Kogito", "Fencing" - ] - } -} -``` - -In a Terminal you can execute this curl command to start a **Hiring** process: -```bash -curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://localhost:8080/hiring -d '{"candidateData": { "name": "Jon", "lastName": "Snow", "email": "jon@snow.org", "experience": 5, "skills": ["Java", "Kogito", "Fencing"]}}' -``` - -If everything went well you may get a response like: -```json -{ - "id": "628e679f-4deb-4abc-9f28-668914c64ef9", - "offer": { - "category": "Senior Software Engineer", - "salary": 40450 - } -} -``` - -In the server log You may find a trace like: -``` -New Hiring has been created for candidate: Jon Snow -################################### -Generated offer for candidate: Jon Snow -Job Category: Senior Software Engineer -Base salary: 40450 -################################### -``` - -Use the following `CandidateData` that don't match the minimal candidate requirements, to start a process that will automatically end: -```json -{ - "candidateData": { - "name": "Jon", - "lastName": "Snow", - "email": "jon@snow.org", - "experience": 0, - "skills": [] - } -} -``` - -In a Terminal you can execute this curl command to start a **Hiring** process: -```bash -curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://localhost:8080/hiring -d '{"candidateData": { "name": "Jon", "lastName": "Snow", "email": "jon@snow.org", "experience": 0, "skills": []}}' -``` - -If everything went well you may get a response like: -```json -{ - "id": "3659601a-bb59-458d-859e-7892621ad5b7", - "offer": null -} -``` - -In the server log You may find a trace like: -``` -New Hiring has been created for candidate: Jon Snow -################################### -Candidate Jon Snow don't meet the requirements for the position but we'll keep it on records for the future! -################################### -``` - -### 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. - -It will install the *Kogito Realm* that comes with a predefined set of users: - -| Login | Password | Roles | -| ------------- | ---------- | ------------------- | -| 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. - -> **_NOTE:_** This example uses keycloak authentication to enable security only in the consoles not in runtime. - -### Using the Kogito Runtime Consoles to interact with the Hiring Process - -The following *step-by-step* guides will show how to take advantage of both *Kogito Management Console* and *Kogito Task Console* -to operate with the instances of *Hiring* process. - -To be able to follow the guides, please make sure that the example has been built using the `container` and all the *Infractructure Services* -are started as explained in the [Building & Running the example](#building--running-the-example) section. - -> **_NOTE_**: For more information about how to operate with the *Kogito Runtime Consoles*, please refer to the -> [Management Console](https://docs.kogito.kie.org/latest/html_single/#con-management-console_kogito-developing-process-services) & [Task Console](https://docs.kogito.kie.org/latest/html_single/#con-task-console_kogito-developing-process-services) documentation. - -#### Show active Hiring process instance at Kogito Management Console - -*Kogito Management Console* is the tool that enables the user to view and administrate process instances in our *Kogito application*. - -In this guide we'll see how to use the *Kogito Management Console* to view the state of the Hiring process instances. - -1. With the example built and all the *Infrastructure Services* running, let's start an instance of the *Hiring* process. To do so, in a Terminal just run: - - ```bash - curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://localhost:8080/hiring -d '{"candidateData": { "name": "Jon", "lastName": "Snow", "email": "jon@snow.org", "experience": 5, "skills": ["Java", "Kogito", "Fencing"]}}' - ``` - - If everything went well, you should get a response like: - ```json - {"id":"064a6372-b5bb-4eff-a059-d7b24d4ac64a","offer":{"category":"Senior Software Engineer","salary":40450}} - ``` - Which indicates that a new process instance with id **064a6372-b5bb-4eff-a059-d7b24d4ac64a** has been started. - - -2. Now let's check the process instance state with the *Kogito Management Console*. To do so, in your browser navigate - to http://localhost:8280 and log in using any of the users specified in the [Using Keycloak as Authentication Server](#using-keycloak-as-authentication-server). - - Once you are logged in, you should be redirected to the **Process Instances** page where you should be able to see - the started process instance in active state. - - -
-
- Process List -
Process List in Kogito Management Console
-
-
- - -3. Click on the instance **id** to navigate into the *Process Details* page. In there you'll be able to see different panels displaying relevant information about the instance state, such as the *Diagram*, *Timeline*, *Details*, *Variables*, *Jobs*... - - -
-
- Process Details -
Process Instance Details page
-
-
- - Now check the **Diagram** panel, in there you'll se the instance execution path. Notice that it's stopped *HR Interview* *User Task* waiting for some input from the user. - The task has *Timer* that will skip the task if it's not completed in a given time (3 minutes in this example). You should be able to see the - associated *Job* in the **Jobs** panel. Now, let's wait 3 minutes to see the timer in action. - -4. After 3 minutes, the scheduled *Job* should have been executed, making the process instance skip the *HR Interview* task. - In the **Process Details** page, click the *Refresh* button to see the process instance state. - -
-
- Process Details after timer -
Process Instance completed after the timer execution.
-
-
- - Again, check the *Diagram* panel to see the process instance execution path and the *HR Interview* task - should have been skipped and the process instance continued its execution by following the *Application denied* path - reaching the *Completed* state. - - Notice in the *Jobs* panel that the associated *Job* has the **Executed** status. - -#### Complete Hiring process instances using Kogito Task Console - -When a *Kogito* process reaches a *User Task*, the process execution stops waiting for the user input -that will enable the *User Task* to finish and allowing the process execution to continue. - -*Kogito Task Console* is the tool that enables the user interacting with the process *User Tasks* and provide the necesary data -for the process to continue (usually wiht forms). - -In this guide, we'll see how to complete the process *User Tasks* using the *Kogito Task Console* to interact with the process *User Tasks* -using the engine autogenerated forms. - -> **_NOTE_**: For simplicity, all the *User Tasks* are assigned to the user *jdoe*. Please make sure you use the *jdoe*/*jdoe* credentials -> when logging in the *Task Console* - -1. With the example built and all the *Infrastructure Services* running, let's start an instance of the *Hiring* process. To do so, in a Terminal just run: - - ```bash - curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://localhost:8080/hiring -d '{"candidateData": { "name": "Jon", "lastName": "Snow", "email": "jon@snow.org", "experience": 5, "skills": ["Java", "Kogito", "Fencing"]}}' - ``` - - If everything went well, you should get a response like: - ```json - {"id":"3cf0d58f-a824-4046-ba6c-c2e79edc1df7","offer":{"category":"Senior Software Engineer","salary":40450}} - ``` - Which indicates that a new process instance with id **3cf0d58f-a824-4046-ba6c-c2e79edc1df7** has been started. - - -2. Let's check the process instance state. Again browse to http://localhost:8280 to access the *Kogito Management Console*, - and in the **Process List** click the **Id** column to open the **Process Details** page. - -
-
- Process List -
Process List in Kogito Management Console
-
-
- -
-
- Process Details -
Process instance Details page.
-
-
- - As expected, the process instance is stopped in the *HR Interview* task waiting for some input from the user. Let's try to - complete the task. - - -3. Now open the *Kogito Task Console* by browsing to http://localhost:8380 and login using the **jdoe/jdoe** credentials. - After logging in, you'll be redirected to the **Task Inbox** page, which contains the list of *Active* tasks assigned to the - logged user. In this case you should be able to see only the new *HR Interview* task. - -
-
- Task Inbox -
Task Inbox in Kogito Task Console
-
-
- - Click on the **HR Interview** task to open the form and complete it! - - -4. The **Task Form** is the main component to interact with User Tasks, it allows the user to provide the data required by - the task and transition it to the next phase, allowing the Process to continue. The **Task Form** is autogenerated based - on the *User Task* data assignments. - - -
-
- HR Interview Form -
HR Interview Task Form
-
-
- - - *HR Interview* Form allows you to edit the actual **Offer** that will be sent to the *Candidate* and also approve or deny - the job application with the **Approve** checkbox. - - Now, check the **Approve** checkbox click the **Complete** button in order to submit the form and complete the task. If the - task could be successfully completed, a notification should appear in the screen and the form will stay in Read-Only mode. - - -
-
- HR Interview Form Notification -
HR Interview Success notification!
-
-
- - With the *HR Interview* task successfully completed the process has moved forward and reached the *IT Interview* task. - - Optionally, you can check the process instance state in the **Kogito Management Console** and verify the current - execution path. - -
-
- Process Details -
Process Instance details stopped in IT Interview
-
-
- -5. Now is time to complete the **IT Interview** task and complete this Hiring process instance. In **Task Console**, go - back to **Task Inbox** and as expected, there you'll see that **HR Interview** is no longer available and a new - **IT Interview** has appeared. - -
-
- Task Inbox -
IT Interview in Task Inbox
-
-
- - As done in Step #3, click in the **IT Interview** task to open the task form. *IT Interview* task only needs the - candidate **Approval** to be submitted. Please, check the **Approval** field and click the **Complete** button to - submit the form. - -
-
- IT Interview Form -
IT Interview Task Form
-
-
- - -6. After the form is submitted the *IT Task* should be completed and the process should continue, notifying the *Candidate* - that he has succesfully finished the Hiring process. Please go back to **Task Inbox** to verify there are no other active tasks - waiting for you. - -
-
- Empty Task Inbox -
Empty **Task Inbox** after completing the *IT Interview* Task
-
-
- - You can also open use *Kogito Management Console* to check the state of the process instance and verify that the - instance has been successfully completed. - -
-
- Hiring Process succesfully completed -
Hiring Process sucessfully completed
-
-
\ No newline at end of file diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/.gitignore b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/.gitignore deleted file mode 100644 index b6632dbda5..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.env -svg/ -persistence/ \ No newline at end of file diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/README.md b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/README.md deleted file mode 100644 index 17ed70a4db..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# Kogito and Infrastructure services - -To allow a quick setup of all services required to run this demo, we provide a docker compose template that starts the following services: -- Postgresql -- PgAdmin -- Kogito Data Index -- Kogito Example Service (Only available if the example has been compiled using the `container` mvn profile eg: ```mvn cleanp package -Dcontainer```) -- Kogito Management Console -- Kogito Task Console -- Keycloak - -The docker compose template provides three profiles to enable starting only the set of services you want to use. The profiles are: -- **infra**: Starts only the minimal infrastructure to run the example (Postgresql, pgadmin, Kogito Data Index) -- **example**: Starts the services in *infra* profile and the Kogito Example Service. Requires the example to be compiled using the `container` mvn profile eg: ```mvn cleanp package -Dcontainer```. -- **full** (default): includes all the above and also starts the **Management Console**, **Task Console** and a **Keycloak** to handle the consoles authentication. Requires the example to be compiled using the `container` mvn profile eg: ```mvn cleanp package -Dcontainer```. - -> NOTE: In order to use it, please ensure you have Docker Compose installed on your machine, otherwise follow the instructions available -in [here](https://docs.docker.com/compose/install/). - -## Starting the services - -Use the `startServices.sh` passing the docker profile you want to use as an argument. If no profile is provided the script will default to **full**. - -Eg: -```shell -sh startServices.sh example -``` - -Once the services are started (depending on the profile), the following ports will be assigned on your local machine: -- Postgresql: 5432 -- PgAdmin: 8055 -- Kogito Data Index: 8180 -- Kogito Example Service: 8080 -- Kogito Management Console: 8280 -- Kogito Task Console: 8380 -- Keycloak: 8480 - -## Stopping and removing volume data - -To stop all services, simply run: - -```shell -docker compose stop -``` -or - -```shell -docker compose down -``` -to stop the services and remove the containers -docker-compose -f docker-compose-postgresql.yml stop - -For more details please check the Docker Compose documentation. - -```shell -docker-compose --help -``` diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/docker-compose.yml b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/docker-compose.yml deleted file mode 100644 index 90292e91c3..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/docker-compose.yml +++ /dev/null @@ -1,144 +0,0 @@ -version: '3' - -services: - postgres: - container_name: postgres - image: postgres:16.1-alpine3.19 - profiles: [ "infra", "example", "full" ] - ports: - - "5432:5432" - volumes: - - ./sql:/docker-entrypoint-initdb.d:Z - healthcheck: - test: [ "CMD", "pg_isready", "-q", "-d", "kogito", "-U", "kogito-user" ] - timeout: 45s - interval: 10s - retries: 50 - environment: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - - pgadmin: - container_name: pgadmin - image: dpage/pgadmin4:8.2 - profiles: [ "infra", "example", "full" ] - ports: - - 8055:80 - depends_on: - - postgres - volumes: - - ./pgadmin/servers.json:/pgadmin4/servers.json - - ./pgadmin/pgpass:/pgadmin4/pgpass - entrypoint: > - /bin/sh -c " - cp -f /pgadmin4/pgpass /var/lib/pgadmin/; - chmod 600 /var/lib/pgadmin/pgpass; - /entrypoint.sh - " - environment: - PGADMIN_DEFAULT_EMAIL: user@kogito.org - PGADMIN_DEFAULT_PASSWORD: pass - PGADMIN_CONFIG_SERVER_MODE: 'False' - PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False' - GUNICORN_ACCESS_LOGFILE: '/dev/null' - - data-index: - container_name: data-index - image: quay.io/kiegroup/kogito-data-index-postgresql-nightly:${KOGITO_VERSION} - profiles: [ "infra", "example", "full" ] - ports: - - "8180:8080" - depends_on: - postgres: - condition: service_healthy - environment: - QUARKUS_DATASOURCE_JDBC_URL: "jdbc:postgresql://postgres:5432/kogito" - QUARKUS_DATASOURCE_USERNAME: kogito-user - QUARKUS_DATASOURCE_PASSWORD: kogito-pass - QUARKUS_HTTP_CORS_ORIGINS: "/.*/" - KOGITO_DATA_INDEX_QUARKUS_PROFILE: "http-events-support" - extra_hosts: - - "${DOCKER_GATEWAY_HOST}:host-gateway" - - kogito-example-service: - container_name: kogito-example-service - image: dev.local/${USER}/kogito-example-service:1.0-SNAPSHOT - profiles: ["example", "full"] - ports: - - "8080:8080" - depends_on: - data-index: - condition: service_started - environment: - QUARKUS_HTTP_CORS_ORIGINS: "/.*/" - QUARKUS_DATASOURCE_JDBC_URL: "jdbc:postgresql://postgres:5432/kogito" - QUARKUS_DATASOURCE_REACTIVE_URL: "postgresql://postgres:5432/kogito" - QUARKUS_DATASOURCE_USERNAME: kogito-user - QUARKUS_DATASOURCE_PASSWORD: kogito-pass - QUARKUS_DATASOURCE_DB_KIND: postgresql - KOGITO_JOBS_SERVICE_URL: http://${DOCKER_GATEWAY_HOST}:8080 - KOGITO_SERVICE_URL: http://${DOCKER_GATEWAY_HOST}:8080 - KOGITO_DATAINDEX_HTTP_URL: http://${DOCKER_GATEWAY_HOST}:8180 - extra_hosts: - - "${DOCKER_GATEWAY_HOST}:host-gateway" - - keycloak: - container_name: keycloak - image: quay.io/keycloak/keycloak:legacy - profiles: ["full"] - ports: - - "8480:8080" - depends_on: - postgres: - condition: service_healthy - volumes: - - ./keycloak/kogito-realm.json:/tmp/kogito-realm.json - healthcheck: - test: [ "CMD", "curl", "-f", "http://localhost:8080/auth/realms/kogito" ] - interval: 2s - timeout: 1s - retries: 50 - environment: - DB_VENDOR: POSTGRES - DB_ADDR: postgres - DB_DATABASE: keycloak - DB_USER: kogito-user - DB_SCHEMA: public - DB_PASSWORD: kogito-pass - KEYCLOAK_USER: admin - KEYCLOAK_PASSWORD: admin - KEYCLOAK_IMPORT: /tmp/kogito-realm.json - - management-console: - container_name: management-console - image: quay.io/kiegroup/kogito-management-console:${KOGITO_VERSION} - profiles: ["full"] - ports: - - 8280:8080 - depends_on: - data-index: - condition: service_started - keycloak: - condition: service_healthy - volumes: - - ./svg/:/home/kogito/data/svg/ - environment: - KOGITO_DATAINDEX_HTTP_URL: http://${DOCKER_GATEWAY_HOST:-host.docker.internal}:8180/graphql - QUARKUS_HTTP_CORS_ORIGINS: "/.*/" - KOGITO_MANAGEMENT_CONSOLE_PROPS: -Dkogito.consoles.keycloak.config.url=http://localhost:8480/auth -Dkogito.consoles.keycloak.config.health-check-url=http://localhost:8480/auth/realms/kogito/.well-known/openid-configuration -Dkogito.svg.folder.path=/home/kogito/data/svg - - task-console: - container_name: task-console - image: quay.io/kiegroup/kogito-task-console:${KOGITO_VERSION} - profiles: ["full"] - ports: - - 8380:8080 - depends_on: - data-index: - condition: service_started - keycloak: - condition: service_healthy - environment: - KOGITO_DATAINDEX_HTTP_URL: http://${DOCKER_GATEWAY_HOST:-host.docker.internal}:8180/graphql - QUARKUS_HTTP_CORS_ORIGINS: "/.*/" - KOGITO_TASK_CONSOLE_PROPS: -Dkogito.consoles.keycloak.config.url=http://localhost:8480/auth -Dkogito.consoles.keycloak.config.health-check-url=http://localhost:8480/auth/realms/kogito/.well-known/openid-configuration \ No newline at end of file diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/keycloak/kogito-realm.json b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/keycloak/kogito-realm.json deleted file mode 100644 index fd3cdc0942..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/keycloak/kogito-realm.json +++ /dev/null @@ -1,2242 +0,0 @@ -{ - "realm": "kogito", - "notBefore": 0, - "revokeRefreshToken": false, - "refreshTokenMaxReuse": 0, - "accessTokenLifespan": 300, - "accessTokenLifespanForImplicitFlow": 900, - "ssoSessionIdleTimeout": 1800, - "ssoSessionMaxLifespan": 36000, - "ssoSessionIdleTimeoutRememberMe": 0, - "ssoSessionMaxLifespanRememberMe": 0, - "offlineSessionIdleTimeout": 2592000, - "offlineSessionMaxLifespanEnabled": false, - "offlineSessionMaxLifespan": 5184000, - "accessCodeLifespan": 60, - "accessCodeLifespanUserAction": 300, - "accessCodeLifespanLogin": 1800, - "actionTokenGeneratedByAdminLifespan": 43200, - "actionTokenGeneratedByUserLifespan": 300, - "enabled": true, - "sslRequired": "external", - "registrationAllowed": false, - "registrationEmailAsUsername": false, - "rememberMe": false, - "verifyEmail": false, - "loginWithEmailAllowed": true, - "duplicateEmailsAllowed": false, - "resetPasswordAllowed": false, - "editUsernameAllowed": false, - "bruteForceProtected": false, - "permanentLockout": false, - "maxFailureWaitSeconds": 900, - "minimumQuickLoginWaitSeconds": 60, - "waitIncrementSeconds": 60, - "quickLoginCheckMilliSeconds": 1000, - "maxDeltaTimeSeconds": 43200, - "failureFactor": 30, - "roles": { - "realm": [ - { - "name": "managers", - "composite": false, - "clientRole": false, - "containerId": "11d78bf6-6d10-4484-baba-a1388379d68b", - "attributes": {} - }, - { - "name": "uma_authorization", - "description": "${role_uma_authorization}", - "composite": false, - "clientRole": false, - "containerId": "11d78bf6-6d10-4484-baba-a1388379d68b", - "attributes": {} - }, - { - "name": "admin", - "composite": false, - "clientRole": false, - "containerId": "11d78bf6-6d10-4484-baba-a1388379d68b", - "attributes": {} - }, - { - "name": "user", - "composite": false, - "clientRole": false, - "containerId": "11d78bf6-6d10-4484-baba-a1388379d68b", - "attributes": {} - }, - { - "name": "HR", - "composite": false, - "clientRole": false, - "containerId": "11d78bf6-6d10-4484-baba-a1388379d68b", - "attributes": {} - }, - { - "name": "IT", - "composite": false, - "clientRole": false, - "containerId": "11d78bf6-6d10-4484-baba-a1388379d68b", - "attributes": {} - }, - { - "name": "offline_access", - "description": "${role_offline-access}", - "composite": false, - "clientRole": false, - "containerId": "11d78bf6-6d10-4484-baba-a1388379d68b", - "attributes": {} - } - ], - "client": { - "realm-management": [ - { - "name": "manage-identity-providers", - "description": "${role_manage-identity-providers}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "impersonation", - "description": "${role_impersonation}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "view-identity-providers", - "description": "${role_view-identity-providers}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "view-realm", - "description": "${role_view-realm}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "query-users", - "description": "${role_query-users}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "manage-clients", - "description": "${role_manage-clients}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "manage-events", - "description": "${role_manage-events}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "realm-admin", - "description": "${role_realm-admin}", - "composite": true, - "composites": { - "client": { - "realm-management": [ - "impersonation", - "manage-identity-providers", - "view-identity-providers", - "view-realm", - "query-users", - "manage-clients", - "manage-events", - "manage-realm", - "view-authorization", - "manage-authorization", - "view-users", - "create-client", - "query-clients", - "query-groups", - "manage-users", - "view-clients", - "view-events", - "query-realms" - ] - } - }, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "manage-realm", - "description": "${role_manage-realm}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "view-authorization", - "description": "${role_view-authorization}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "manage-authorization", - "description": "${role_manage-authorization}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "create-client", - "description": "${role_create-client}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "view-users", - "description": "${role_view-users}", - "composite": true, - "composites": { - "client": { - "realm-management": [ - "query-groups", - "query-users" - ] - } - }, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "query-clients", - "description": "${role_query-clients}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "query-groups", - "description": "${role_query-groups}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "manage-users", - "description": "${role_manage-users}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "view-clients", - "description": "${role_view-clients}", - "composite": true, - "composites": { - "client": { - "realm-management": [ - "query-clients" - ] - } - }, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "view-events", - "description": "${role_view-events}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - }, - { - "name": "query-realms", - "description": "${role_query-realms}", - "composite": false, - "clientRole": true, - "containerId": "376bd940-e50a-4495-80fc-9c6c07312748", - "attributes": {} - } - ], - "security-admin-console": [], - "admin-cli": [], - "kogito-service": [ - { - "name": "uma_protection", - "composite": false, - "clientRole": true, - "containerId": "0ac5df91-e044-4051-bd03-106a3a5fb9cc", - "attributes": {} - } - ], - "broker": [ - { - "name": "read-token", - "description": "${role_read-token}", - "composite": false, - "clientRole": true, - "containerId": "53d4fe53-a039-471e-886a-28eddc950e95", - "attributes": {} - } - ], - "account": [ - { - "name": "view-profile", - "description": "${role_view-profile}", - "composite": false, - "clientRole": true, - "containerId": "e55e1234-38fa-432d-8d90-39f5e024688d", - "attributes": {} - }, - { - "name": "manage-account", - "description": "${role_manage-account}", - "composite": true, - "composites": { - "client": { - "account": [ - "manage-account-links" - ] - } - }, - "clientRole": true, - "containerId": "e55e1234-38fa-432d-8d90-39f5e024688d", - "attributes": {} - }, - { - "name": "manage-account-links", - "description": "${role_manage-account-links}", - "composite": false, - "clientRole": true, - "containerId": "e55e1234-38fa-432d-8d90-39f5e024688d", - "attributes": {} - } - ] - } - }, - "groups": [], - "defaultRoles": [ - "uma_authorization", - "offline_access" - ], - "requiredCredentials": [ - "password" - ], - "otpPolicyType": "totp", - "otpPolicyAlgorithm": "HmacSHA1", - "otpPolicyInitialCounter": 0, - "otpPolicyDigits": 6, - "otpPolicyLookAheadWindow": 1, - "otpPolicyPeriod": 30, - "otpSupportedApplications": [ - "FreeOTP", - "Google Authenticator" - ], - "scopeMappings": [ - { - "clientScope": "offline_access", - "roles": [ - "offline_access" - ] - } - ], - "clients": [ - { - "clientId": "account", - "name": "${client_account}", - "baseUrl": "/auth/realms/kogito/account", - "surrogateAuthRequired": false, - "enabled": true, - "clientAuthenticatorType": "client-secret", - "secret": "0136c3ef-0dfd-4b13-a6d0-2c8b6358edec", - "defaultRoles": [ - "view-profile", - "manage-account" - ], - "redirectUris": [ - "/auth/realms/kogito/account/*" - ], - "webOrigins": [], - "notBefore": 0, - "bearerOnly": false, - "consentRequired": false, - "standardFlowEnabled": true, - "implicitFlowEnabled": false, - "directAccessGrantsEnabled": false, - "serviceAccountsEnabled": false, - "publicClient": false, - "frontchannelLogout": false, - "protocol": "openid-connect", - "attributes": {}, - "authenticationFlowBindingOverrides": {}, - "fullScopeAllowed": false, - "nodeReRegistrationTimeout": 0, - "defaultClientScopes": [ - "web-origins", - "role_list", - "profile", - "roles", - "email" - ], - "optionalClientScopes": [ - "address", - "phone", - "offline_access", - "microprofile-jwt" - ] - }, - { - "clientId": "admin-cli", - "name": "${client_admin-cli}", - "surrogateAuthRequired": false, - "enabled": true, - "clientAuthenticatorType": "client-secret", - "secret": "a951803a-79c7-46a6-8197-e32835286971", - "redirectUris": [], - "webOrigins": [], - "notBefore": 0, - "bearerOnly": false, - "consentRequired": false, - "standardFlowEnabled": false, - "implicitFlowEnabled": false, - "directAccessGrantsEnabled": true, - "serviceAccountsEnabled": false, - "publicClient": true, - "frontchannelLogout": false, - "protocol": "openid-connect", - "attributes": {}, - "authenticationFlowBindingOverrides": {}, - "fullScopeAllowed": false, - "nodeReRegistrationTimeout": 0, - "defaultClientScopes": [ - "web-origins", - "role_list", - "profile", - "roles", - "email" - ], - "optionalClientScopes": [ - "address", - "phone", - "offline_access", - "microprofile-jwt" - ] - }, - { - "clientId": "broker", - "name": "${client_broker}", - "surrogateAuthRequired": false, - "enabled": true, - "clientAuthenticatorType": "client-secret", - "secret": "e1f7edd7-e15c-43b4-8736-ff8204d16836", - "redirectUris": [], - "webOrigins": [], - "notBefore": 0, - "bearerOnly": false, - "consentRequired": false, - "standardFlowEnabled": true, - "implicitFlowEnabled": false, - "directAccessGrantsEnabled": false, - "serviceAccountsEnabled": false, - "publicClient": false, - "frontchannelLogout": false, - "protocol": "openid-connect", - "attributes": {}, - "authenticationFlowBindingOverrides": {}, - "fullScopeAllowed": false, - "nodeReRegistrationTimeout": 0, - "defaultClientScopes": [ - "web-origins", - "role_list", - "profile", - "roles", - "email" - ], - "optionalClientScopes": [ - "address", - "phone", - "offline_access", - "microprofile-jwt" - ] - }, - { - "clientId": "kogito-frontend", - "rootUrl": "http://localhost:8082", - "adminUrl": "http://localhost:8082", - "surrogateAuthRequired": false, - "enabled": true, - "clientAuthenticatorType": "client-secret", - "secret": "secret", - "redirectUris": [ - "http://localhost:8082/*" - ], - "webOrigins": [ - "http://localhost:8082" - ], - "notBefore": 0, - "bearerOnly": false, - "consentRequired": false, - "standardFlowEnabled": true, - "implicitFlowEnabled": false, - "directAccessGrantsEnabled": true, - "serviceAccountsEnabled": false, - "publicClient": false, - "frontchannelLogout": false, - "protocol": "openid-connect", - "attributes": { - "saml.assertion.signature": "false", - "saml.force.post.binding": "false", - "saml.multivalued.roles": "false", - "saml.encrypt": "false", - "saml.server.signature": "false", - "saml.server.signature.keyinfo.ext": "false", - "exclude.session.state.from.auth.response": "false", - "saml_force_name_id_format": "false", - "saml.client.signature": "false", - "tls.client.certificate.bound.access.tokens": "false", - "saml.authnstatement": "false", - "display.on.consent.screen": "false", - "saml.onetimeuse.condition": "false" - }, - "authenticationFlowBindingOverrides": {}, - "fullScopeAllowed": true, - "nodeReRegistrationTimeout": -1, - "defaultClientScopes": [ - "web-origins", - "role_list", - "profile", - "roles", - "email" - ], - "optionalClientScopes": [ - "address", - "phone", - "offline_access", - "microprofile-jwt" - ], - "access": { - "view": true, - "configure": true, - "manage": true - } - }, - { - "clientId": "kogito-app", - "rootUrl": "http://localhost:8080", - "adminUrl": "http://localhost:8080", - "surrogateAuthRequired": false, - "enabled": true, - "clientAuthenticatorType": "client-secret", - "secret": "secret", - "redirectUris": [ - "http://localhost:8080/*" - ], - "webOrigins": [ - "*" - ], - "notBefore": 0, - "bearerOnly": false, - "consentRequired": false, - "standardFlowEnabled": true, - "implicitFlowEnabled": false, - "directAccessGrantsEnabled": true, - "serviceAccountsEnabled": false, - "publicClient": false, - "frontchannelLogout": false, - "protocol": "openid-connect", - "attributes": { - "saml.assertion.signature": "false", - "saml.force.post.binding": "false", - "saml.multivalued.roles": "false", - "saml.encrypt": "false", - "saml.server.signature": "false", - "saml.server.signature.keyinfo.ext": "false", - "exclude.session.state.from.auth.response": "false", - "saml_force_name_id_format": "false", - "saml.client.signature": "false", - "tls.client.certificate.bound.access.tokens": "false", - "saml.authnstatement": "false", - "display.on.consent.screen": "false", - "saml.onetimeuse.condition": "false" - }, - "authenticationFlowBindingOverrides": {}, - "fullScopeAllowed": true, - "nodeReRegistrationTimeout": -1, - "defaultClientScopes": [ - "web-origins", - "role_list", - "profile", - "roles", - "email" - ], - "optionalClientScopes": [ - "address", - "phone", - "offline_access", - "microprofile-jwt" - ], - "access": { - "view": true, - "configure": true, - "manage": true - } - }, - { - "clientId": "kogito-service", - "rootUrl": "", - "surrogateAuthRequired": false, - "enabled": true, - "clientAuthenticatorType": "client-secret", - "secret": "secret", - "redirectUris": [ - "*" - ], - "webOrigins": [ - "*" - ], - "notBefore": 0, - "bearerOnly": false, - "consentRequired": false, - "standardFlowEnabled": true, - "implicitFlowEnabled": false, - "directAccessGrantsEnabled": true, - "serviceAccountsEnabled": true, - "authorizationServicesEnabled": true, - "publicClient": false, - "frontchannelLogout": false, - "protocol": "openid-connect", - "attributes": {}, - "authenticationFlowBindingOverrides": {}, - "fullScopeAllowed": true, - "nodeReRegistrationTimeout": -1, - "protocolMappers": [ - { - "name": "Client ID", - "protocol": "openid-connect", - "protocolMapper": "oidc-usersessionmodel-note-mapper", - "consentRequired": false, - "config": { - "user.session.note": "clientId", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "clientId", - "jsonType.label": "String" - } - }, - { - "name": "Client IP Address", - "protocol": "openid-connect", - "protocolMapper": "oidc-usersessionmodel-note-mapper", - "consentRequired": false, - "config": { - "user.session.note": "clientAddress", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "clientAddress", - "jsonType.label": "String" - } - }, - { - "name": "Client Host", - "protocol": "openid-connect", - "protocolMapper": "oidc-usersessionmodel-note-mapper", - "consentRequired": false, - "config": { - "user.session.note": "clientHost", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "clientHost", - "jsonType.label": "String" - } - } - ], - "defaultClientScopes": [ - "web-origins", - "role_list", - "profile", - "roles", - "email" - ], - "optionalClientScopes": [ - "address", - "phone", - "offline_access", - "microprofile-jwt" - ], - "authorizationSettings": { - "allowRemoteResourceManagement": true, - "policyEnforcementMode": "ENFORCING", - "resources": [ - { - "name": "User Resource", - "ownerManagedAccess": false, - "attributes": {}, - "_id": "df1b74a9-3f10-499d-a581-368de48e512b", - "uris": [ - "/api/users/*" - ] - }, - { - "name": "Administration Resource", - "ownerManagedAccess": false, - "attributes": {}, - "_id": "7124e2f1-e6dc-44b4-87ab-24b010090b97", - "uris": [ - "/api/admin/*" - ] - } - ], - "policies": [ - { - "name": "Any User Policy", - "description": "Any user granted with the user role can access something", - "type": "role", - "logic": "POSITIVE", - "decisionStrategy": "UNANIMOUS", - "config": { - "roles": "[{\"id\":\"user\",\"required\":false}]" - } - }, - { - "name": "Only Administrators", - "description": "Only administrators can access", - "type": "role", - "logic": "POSITIVE", - "decisionStrategy": "UNANIMOUS", - "config": { - "roles": "[{\"id\":\"admin\",\"required\":false}]" - } - }, - { - "name": "User Resource Permission", - "type": "resource", - "logic": "POSITIVE", - "decisionStrategy": "UNANIMOUS", - "config": { - "resources": "[\"User Resource\"]", - "applyPolicies": "[\"Any User Policy\"]" - } - }, - { - "name": "Administration Resource Permission", - "type": "resource", - "logic": "POSITIVE", - "decisionStrategy": "UNANIMOUS", - "config": { - "resources": "[\"Administration Resource\"]", - "applyPolicies": "[\"Only Administrators\"]" - } - } - ], - "scopes": [], - "decisionStrategy": "UNANIMOUS" - } - }, - { - "clientId": "kogito-console-react", - "rootUrl": "http://localhost:9000", - "adminUrl": "http://localhost:9000/", - "baseUrl": "http://localhost:9000/", - "surrogateAuthRequired": false, - "enabled": true, - "clientAuthenticatorType": "client-secret", - "secret": "**********", - "redirectUris": [ - "http://localhost:9000/*" - ], - "webOrigins": [ - "*" - ], - "notBefore": 0, - "bearerOnly": false, - "consentRequired": false, - "standardFlowEnabled": true, - "implicitFlowEnabled": false, - "directAccessGrantsEnabled": false, - "serviceAccountsEnabled": false, - "publicClient": true, - "frontchannelLogout": false, - "protocol": "openid-connect", - "attributes": { - "saml.assertion.signature": "false", - "saml.force.post.binding": "false", - "saml.multivalued.roles": "false", - "saml.encrypt": "false", - "saml.server.signature": "false", - "saml.server.signature.keyinfo.ext": "false", - "exclude.session.state.from.auth.response": "false", - "saml_force_name_id_format": "false", - "saml.client.signature": "false", - "tls.client.certificate.bound.access.tokens": "false", - "saml.authnstatement": "false", - "display.on.consent.screen": "false", - "saml.onetimeuse.condition": "false" - }, - "authenticationFlowBindingOverrides": {}, - "fullScopeAllowed": true, - "nodeReRegistrationTimeout": -1, - "defaultClientScopes": [ - "web-origins", - "role_list", - "profile", - "roles", - "email" - ], - "optionalClientScopes": [ - "address", - "phone", - "offline_access", - "microprofile-jwt" - ] - }, - { - "clientId": "kogito-console-quarkus", - "rootUrl": "http://localhost:8380", - "adminUrl": "http://localhost:8380/", - "baseUrl": "http://localhost:8380/", - "surrogateAuthRequired": false, - "enabled": true, - "clientAuthenticatorType": "client-secret", - "secret": "**********", - "redirectUris": [ - "http://localhost:8380/*", - "http://localhost:8280/*" - ], - "webOrigins": [ - "*" - ], - "notBefore": 0, - "bearerOnly": false, - "consentRequired": false, - "standardFlowEnabled": true, - "implicitFlowEnabled": false, - "directAccessGrantsEnabled": false, - "serviceAccountsEnabled": false, - "publicClient": true, - "frontchannelLogout": false, - "protocol": "openid-connect", - "attributes": { - "saml.assertion.signature": "false", - "saml.force.post.binding": "false", - "saml.multivalued.roles": "false", - "saml.encrypt": "false", - "saml.server.signature": "false", - "saml.server.signature.keyinfo.ext": "false", - "exclude.session.state.from.auth.response": "false", - "saml_force_name_id_format": "false", - "saml.client.signature": "false", - "tls.client.certificate.bound.access.tokens": "false", - "saml.authnstatement": "false", - "display.on.consent.screen": "false", - "saml.onetimeuse.condition": "false" - }, - "authenticationFlowBindingOverrides": {}, - "fullScopeAllowed": true, - "nodeReRegistrationTimeout": -1, - "protocolMappers": [ - { - "name": "groups", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-realm-role-mapper", - "consentRequired": false, - "config": { - "multivalued": "true", - "user.attribute": "foo", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "groups", - "jsonType.label": "String" - } - } - ], - "defaultClientScopes": [ - "web-origins", - "role_list", - "profile", - "roles", - "email" - ], - "optionalClientScopes": [ - "address", - "phone", - "offline_access", - "microprofile-jwt" - ] - }, - { - "clientId": "kogito-jobs-service", - "rootUrl": "http://localhost:8080", - "adminUrl": "http://localhost:8080", - "surrogateAuthRequired": false, - "enabled": true, - "clientAuthenticatorType": "client-secret", - "secret": "secret", - "redirectUris": [ - "http://localhost:8080/*" - ], - "webOrigins": [ - "http://localhost:8080" - ], - "notBefore": 0, - "bearerOnly": false, - "consentRequired": false, - "standardFlowEnabled": true, - "implicitFlowEnabled": false, - "directAccessGrantsEnabled": true, - "serviceAccountsEnabled": false, - "publicClient": false, - "frontchannelLogout": false, - "protocol": "openid-connect", - "attributes": { - "saml.assertion.signature": "false", - "saml.force.post.binding": "false", - "saml.multivalued.roles": "false", - "saml.encrypt": "false", - "saml.server.signature": "false", - "saml.server.signature.keyinfo.ext": "false", - "exclude.session.state.from.auth.response": "false", - "saml_force_name_id_format": "false", - "saml.client.signature": "false", - "tls.client.certificate.bound.access.tokens": "false", - "saml.authnstatement": "false", - "display.on.consent.screen": "false", - "saml.onetimeuse.condition": "false" - }, - "authenticationFlowBindingOverrides": {}, - "fullScopeAllowed": true, - "nodeReRegistrationTimeout": -1, - "defaultClientScopes": [ - "web-origins", - "role_list", - "profile", - "roles", - "email" - ], - "optionalClientScopes": [ - "address", - "phone", - "offline_access", - "microprofile-jwt" - ], - "access": { - "view": true, - "configure": true, - "manage": true - } - }, - { - "clientId": "realm-management", - "name": "${client_realm-management}", - "surrogateAuthRequired": false, - "enabled": true, - "clientAuthenticatorType": "client-secret", - "secret": "c41b709a-a012-4c69-89d7-4f926dba0619", - "redirectUris": [], - "webOrigins": [], - "notBefore": 0, - "bearerOnly": true, - "consentRequired": false, - "standardFlowEnabled": true, - "implicitFlowEnabled": false, - "directAccessGrantsEnabled": false, - "serviceAccountsEnabled": false, - "publicClient": false, - "frontchannelLogout": false, - "protocol": "openid-connect", - "attributes": {}, - "authenticationFlowBindingOverrides": {}, - "fullScopeAllowed": false, - "nodeReRegistrationTimeout": 0, - "defaultClientScopes": [ - "web-origins", - "role_list", - "profile", - "roles", - "email" - ], - "optionalClientScopes": [ - "address", - "phone", - "offline_access", - "microprofile-jwt" - ] - }, - { - "clientId": "security-admin-console", - "name": "${client_security-admin-console}", - "baseUrl": "/auth/admin/kogito/console/index.html", - "surrogateAuthRequired": false, - "enabled": true, - "clientAuthenticatorType": "client-secret", - "secret": "e571b211-2550-475d-b87f-116ff54091ee", - "redirectUris": [ - "/auth/admin/kogito/console/*" - ], - "webOrigins": [], - "notBefore": 0, - "bearerOnly": false, - "consentRequired": false, - "standardFlowEnabled": true, - "implicitFlowEnabled": false, - "directAccessGrantsEnabled": false, - "serviceAccountsEnabled": false, - "publicClient": true, - "frontchannelLogout": false, - "protocol": "openid-connect", - "attributes": {}, - "authenticationFlowBindingOverrides": {}, - "fullScopeAllowed": false, - "nodeReRegistrationTimeout": 0, - "protocolMappers": [ - { - "name": "locale", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-attribute-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "locale", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "locale", - "jsonType.label": "String" - } - } - ], - "defaultClientScopes": [ - "web-origins", - "role_list", - "profile", - "roles", - "email" - ], - "optionalClientScopes": [ - "address", - "phone", - "offline_access", - "microprofile-jwt" - ] - } - ], - "clientScopes": [ - { - "name": "address", - "description": "OpenID Connect built-in scope: address", - "protocol": "openid-connect", - "attributes": { - "include.in.token.scope": "true", - "display.on.consent.screen": "true", - "consent.screen.text": "${addressScopeConsentText}" - }, - "protocolMappers": [ - { - "name": "address", - "protocol": "openid-connect", - "protocolMapper": "oidc-address-mapper", - "consentRequired": false, - "config": { - "user.attribute.formatted": "formatted", - "user.attribute.country": "country", - "user.attribute.postal_code": "postal_code", - "userinfo.token.claim": "true", - "user.attribute.street": "street", - "id.token.claim": "true", - "user.attribute.region": "region", - "access.token.claim": "true", - "user.attribute.locality": "locality" - } - } - ] - }, - { - "name": "email", - "description": "OpenID Connect built-in scope: email", - "protocol": "openid-connect", - "attributes": { - "include.in.token.scope": "true", - "display.on.consent.screen": "true", - "consent.screen.text": "${emailScopeConsentText}" - }, - "protocolMappers": [ - { - "name": "email", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-property-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "email", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "email", - "jsonType.label": "String" - } - }, - { - "name": "email verified", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-property-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "emailVerified", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "email_verified", - "jsonType.label": "boolean" - } - } - ] - }, - { - "name": "microprofile-jwt", - "description": "Microprofile - JWT built-in scope", - "protocol": "openid-connect", - "attributes": { - "include.in.token.scope": "true", - "display.on.consent.screen": "false" - }, - "protocolMappers": [ - { - "name": "upn", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-property-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "username", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "upn", - "jsonType.label": "String" - } - }, - { - "name": "groups", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-realm-role-mapper", - "consentRequired": false, - "config": { - "multivalued": "true", - "user.attribute": "foo", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "groups", - "jsonType.label": "String" - } - } - ] - }, - { - "name": "offline_access", - "description": "OpenID Connect built-in scope: offline_access", - "protocol": "openid-connect", - "attributes": { - "consent.screen.text": "${offlineAccessScopeConsentText}", - "display.on.consent.screen": "true" - } - }, - { - "name": "phone", - "description": "OpenID Connect built-in scope: phone", - "protocol": "openid-connect", - "attributes": { - "include.in.token.scope": "true", - "display.on.consent.screen": "true", - "consent.screen.text": "${phoneScopeConsentText}" - }, - "protocolMappers": [ - { - "name": "phone number verified", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-attribute-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "phoneNumberVerified", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "phone_number_verified", - "jsonType.label": "boolean" - } - }, - { - "name": "phone number", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-attribute-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "phoneNumber", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "phone_number", - "jsonType.label": "String" - } - } - ] - }, - { - "name": "profile", - "description": "OpenID Connect built-in scope: profile", - "protocol": "openid-connect", - "attributes": { - "include.in.token.scope": "true", - "display.on.consent.screen": "true", - "consent.screen.text": "${profileScopeConsentText}" - }, - "protocolMappers": [ - { - "name": "nickname", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-attribute-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "nickname", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "nickname", - "jsonType.label": "String" - } - }, - { - "name": "zoneinfo", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-attribute-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "zoneinfo", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "zoneinfo", - "jsonType.label": "String" - } - }, - { - "name": "updated at", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-attribute-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "updatedAt", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "updated_at", - "jsonType.label": "String" - } - }, - { - "name": "birthdate", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-attribute-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "birthdate", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "birthdate", - "jsonType.label": "String" - } - }, - { - "name": "given name", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-property-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "firstName", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "given_name", - "jsonType.label": "String" - } - }, - { - "name": "full name", - "protocol": "openid-connect", - "protocolMapper": "oidc-full-name-mapper", - "consentRequired": false, - "config": { - "id.token.claim": "true", - "access.token.claim": "true", - "userinfo.token.claim": "true" - } - }, - { - "name": "middle name", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-attribute-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "middleName", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "middle_name", - "jsonType.label": "String" - } - }, - { - "name": "username", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-property-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "username", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "preferred_username", - "jsonType.label": "String" - } - }, - { - "name": "family name", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-property-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "lastName", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "family_name", - "jsonType.label": "String" - } - }, - { - "name": "gender", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-attribute-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "gender", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "gender", - "jsonType.label": "String" - } - }, - { - "name": "picture", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-attribute-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "picture", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "picture", - "jsonType.label": "String" - } - }, - { - "name": "locale", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-attribute-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "locale", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "locale", - "jsonType.label": "String" - } - }, - { - "name": "profile", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-attribute-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "profile", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "profile", - "jsonType.label": "String" - } - }, - { - "name": "website", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-attribute-mapper", - "consentRequired": false, - "config": { - "userinfo.token.claim": "true", - "user.attribute": "website", - "id.token.claim": "true", - "access.token.claim": "true", - "claim.name": "website", - "jsonType.label": "String" - } - } - ] - }, - { - "name": "role_list", - "description": "SAML role list", - "protocol": "saml", - "attributes": { - "consent.screen.text": "${samlRoleListScopeConsentText}", - "display.on.consent.screen": "true" - }, - "protocolMappers": [ - { - "name": "role list", - "protocol": "saml", - "protocolMapper": "saml-role-list-mapper", - "consentRequired": false, - "config": { - "single": "false", - "attribute.nameformat": "Basic", - "attribute.name": "Role" - } - } - ] - }, - { - "name": "roles", - "description": "OpenID Connect scope for add user roles to the access token", - "protocol": "openid-connect", - "attributes": { - "include.in.token.scope": "false", - "display.on.consent.screen": "true", - "consent.screen.text": "${rolesScopeConsentText}" - }, - "protocolMappers": [ - { - "name": "realm roles", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-realm-role-mapper", - "consentRequired": false, - "config": { - "user.attribute": "foo", - "access.token.claim": "true", - "claim.name": "realm_access.roles", - "jsonType.label": "String", - "multivalued": "true" - } - }, - { - "name": "audience resolve", - "protocol": "openid-connect", - "protocolMapper": "oidc-audience-resolve-mapper", - "consentRequired": false, - "config": {} - }, - { - "name": "client roles", - "protocol": "openid-connect", - "protocolMapper": "oidc-usermodel-client-role-mapper", - "consentRequired": false, - "config": { - "user.attribute": "foo", - "access.token.claim": "true", - "claim.name": "resource_access.${client_id}.roles", - "jsonType.label": "String", - "multivalued": "true" - } - } - ] - }, - { - "name": "web-origins", - "description": "OpenID Connect scope for add allowed web origins to the access token", - "protocol": "openid-connect", - "attributes": { - "include.in.token.scope": "false", - "display.on.consent.screen": "false", - "consent.screen.text": "" - }, - "protocolMappers": [ - { - "name": "allowed web origins", - "protocol": "openid-connect", - "protocolMapper": "oidc-allowed-origins-mapper", - "consentRequired": false, - "config": {} - } - ] - } - ], - "defaultDefaultClientScopes": [ - "role_list", - "profile", - "email", - "roles", - "web-origins" - ], - "defaultOptionalClientScopes": [ - "offline_access", - "address", - "phone", - "microprofile-jwt" - ], - "browserSecurityHeaders": { - "contentSecurityPolicyReportOnly": "", - "xContentTypeOptions": "nosniff", - "xRobotsTag": "none", - "xFrameOptions": "SAMEORIGIN", - "xXSSProtection": "1; mode=block", - "contentSecurityPolicy": "frame-src 'self'; frame-ancestors 'self'; object-src 'none';", - "strictTransportSecurity": "max-age=31536000; includeSubDomains" - }, - "smtpServer": {}, - "eventsEnabled": false, - "eventsListeners": [ - "jboss-logging" - ], - "enabledEventTypes": [], - "adminEventsEnabled": false, - "adminEventsDetailsEnabled": false, - "components": { - "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy": [ - { - "name": "Allowed Protocol Mapper Types", - "providerId": "allowed-protocol-mappers", - "subType": "anonymous", - "subComponents": {}, - "config": { - "allowed-protocol-mapper-types": [ - "oidc-full-name-mapper", - "saml-user-attribute-mapper", - "saml-user-property-mapper", - "oidc-address-mapper", - "saml-role-list-mapper", - "oidc-sha256-pairwise-sub-mapper", - "oidc-usermodel-attribute-mapper", - "oidc-usermodel-property-mapper" - ] - } - }, - { - "name": "Allowed Client Scopes", - "providerId": "allowed-client-templates", - "subType": "authenticated", - "subComponents": {}, - "config": { - "allow-default-scopes": [ - "true" - ] - } - }, - { - "name": "Allowed Client Scopes", - "providerId": "allowed-client-templates", - "subType": "anonymous", - "subComponents": {}, - "config": { - "allow-default-scopes": [ - "true" - ] - } - }, - { - "name": "Trusted Hosts", - "providerId": "trusted-hosts", - "subType": "anonymous", - "subComponents": {}, - "config": { - "host-sending-registration-request-must-match": [ - "true" - ], - "client-uris-must-match": [ - "true" - ] - } - }, - { - "name": "Full Scope Disabled", - "providerId": "scope", - "subType": "anonymous", - "subComponents": {}, - "config": {} - }, - { - "name": "Max Clients Limit", - "providerId": "max-clients", - "subType": "anonymous", - "subComponents": {}, - "config": { - "max-clients": [ - "200" - ] - } - }, - { - "name": "Consent Required", - "providerId": "consent-required", - "subType": "anonymous", - "subComponents": {}, - "config": {} - }, - { - "name": "Allowed Protocol Mapper Types", - "providerId": "allowed-protocol-mappers", - "subType": "authenticated", - "subComponents": {}, - "config": { - "allowed-protocol-mapper-types": [ - "saml-user-attribute-mapper", - "oidc-full-name-mapper", - "saml-role-list-mapper", - "saml-user-property-mapper", - "oidc-usermodel-attribute-mapper", - "oidc-address-mapper", - "oidc-usermodel-property-mapper", - "oidc-sha256-pairwise-sub-mapper" - ] - } - } - ], - "org.keycloak.keys.KeyProvider": [ - { - "name": "rsa-generated", - "providerId": "rsa-generated", - "subComponents": {}, - "config": { - "privateKey": [ - "MIIEowIBAAKCAQEAn5T13suF8mlS+pJXp0U1bto41nW55wpcs+Rps8ZVCRyJKWqzwSCYnI7lm0rB2wBpAAO4OPoj1zlmVoFmBPsDU9Xf7rjsJb5LIzIQDCZY44aSDZt6RR+gakPiQvlzHyW/RozYpngDJF7TsTD7rdRF1xQ4RprfBF8fwK/xsU7pxbeom5xDHZhz3fiw8s+7UdbmnazDHfAjU58aUrLGgVRfUsuoHjtsptYlOIXEifaeMetXZE+HhqLYRHQPDap5fbBJl773Trosn7N9nmzN4x1xxGj9So21WC5UboQs9sAIVgizc4omjZ5Y4RN9HLH7G4YwJctNntzmnJhDui9zAO+zSQIDAQABAoIBADi+F7rTtVoft0Cfnok8o6Y58/HVxHdxiMryUd95iy0FN4RBi48FTx6D9QKFz25Ws/8sU2n3D51srIXf1u24b1N0/f39RQKaqk7mcyxOylaEuBQcj5pah4ihgKd92UBfBKdKV5LBo6RgD3e2yhbiHr8+UlBQqzH7vOef6Bm6zIbfmi3N88swAJhP0YizRZFklsbmLsK6nkwyro00CHJvPVKSBbM+ad+/zIBsLw56MvNngB5TuFguUgoljd6M1T2z4utmZGlTUqrfE1onAVLJZoGnRohyIr7dJEg6YxWR70PxsgmkDKyeRvet9P1trO0n+OSprusfrC3cHJStabap1V0CgYEA1A/CtsqTnjdYYsB19eumZgdpzUgNc/YEAzZ/OWb8yTLoB2ncci+63A1rXHUXAqJFY7vtjn5mxv7SuASNbUrzq+6KfZvC1x9XEtnczqT/ypunNfxmIZuj8Nuu6vtURguZ8kPPwdkI8toTizRFeRE5ZDBvoQryiEVYugfHaHT5vzsCgYEAwKWODwquI0Lv9BuwdNVrBXQpkKh3ZfYOA7i9xvhxlM7xUu8OMCwwCPn3r7vrW5APjTqX4h330mJ44SLEs+7gbCUs4BbJBLA6g0ChlHa9PTkxp6tk2nDF/B34fxiZSRkE85L+d+at0Dc3hnlzLCJCzJawGpoPniPU9e4w0p4dN0sCgYAsGnMGjS8SUrRhJWHjGXVr9tK8TOXvXhULjgP7rj2Yoqu7Dvs4DFEyft/7RKbad2EzEtyfLA64CDtO5jN7rYDsGxpWcVSeZPg5BXJ0z8AbJTArfCjJiJMZ/rZsTIUEZFlKF2xYBolj6JLz+pUQTtK+0YwF1D8ItFN1rTR9twZSDQKBgQC6sPXNX+VH6LuPTjIf1x8CxwLs3EXxOpV0R9kp9GRl+HJnk6GlT30xhcThufQo5KAdllXQXIhoiuNoEoCbevhj9Vbax1oBQCNERSMRNEzKAx46xd9TzYwgeo7x5E3QR/3DaoVOfu+cY5ZcrF/PulgP2kxJS1mtQD5GIpGP2oinpwKBgGqiqTFPqRcelx76vBvTU+Jp1zM62T4AotbMrSQR/oUvqHe5Ytj/SbZx+wbbHAiyGgV700Mosyviik83YEAbR3kdOPjgYvAJJW2Y3jEMdQ7MwriXz8XLh5BGmYfVjkSOJXed9ua9WlYLKOJeXXv191BbDvrx5NXuJyVVU4vJx3YZ" - ], - "certificate": [ - "MIICnTCCAYUCBgFp4EYIrjANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQDDAdwcm90ZWFuMB4XDTE5MDQwMjIyNTYxOVoXDTI5MDQwMjIyNTc1OVowEjEQMA4GA1UEAwwHcHJvdGVhbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ+U9d7LhfJpUvqSV6dFNW7aONZ1uecKXLPkabPGVQkciSlqs8EgmJyO5ZtKwdsAaQADuDj6I9c5ZlaBZgT7A1PV3+647CW+SyMyEAwmWOOGkg2bekUfoGpD4kL5cx8lv0aM2KZ4AyRe07Ew+63URdcUOEaa3wRfH8Cv8bFO6cW3qJucQx2Yc934sPLPu1HW5p2swx3wI1OfGlKyxoFUX1LLqB47bKbWJTiFxIn2njHrV2RPh4ai2ER0Dw2qeX2wSZe+9066LJ+zfZ5szeMdccRo/UqNtVguVG6ELPbACFYIs3OKJo2eWOETfRyx+xuGMCXLTZ7c5pyYQ7ovcwDvs0kCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAVtmRKDb4OK5iSA46tagMBkp6L7WuPpCWuHGWwobEP+BecYsShW7zP3s12oA8SNSwbhvu0CRqgzxhuypgf3hKQFVU153Erv4hzkj+8S0s5LR/ZE7tDNY2lzJ3yQKXy3Md7EkuzzvOZ50MTrcSKAanWq/ZW1OTnrtGymj5zGJnTg7mMnJzEIGePxkvPu/QdchiPBLqxfZYm1jsFGY25djOC3N/KmVcRVmPRGuu6D8tBFHlKoPfZYPdbMvsvs24aupHKRcZ+ofTCpK+2Qo8c0pSSqeEYHGmuGqC6lC6ozxtxSABPO9Q1R1tZBU7Kg5HvXUwwmoVS3EGub46YbHqbmWMLg==" - ], - "priority": [ - "100" - ] - } - }, - { - "name": "hmac-generated", - "providerId": "hmac-generated", - "subComponents": {}, - "config": { - "kid": [ - "96afd00e-85cf-4d35-b18e-061d3813d8b2" - ], - "secret": [ - "qBFGKdUGf6xDgKphnRfoFzIzaFHJW4bYnZ9MinPFzN38X5_ctq-2u1q5RdZzeJukXvk2biHB8_s3DxWmmLZFsA" - ], - "priority": [ - "100" - ], - "algorithm": [ - "HS256" - ] - } - }, - { - "name": "aes-generated", - "providerId": "aes-generated", - "subComponents": {}, - "config": { - "kid": [ - "b04473d3-8395-4016-b455-19a9e951106b" - ], - "secret": [ - "x68mMOVdz3qKWzltzReV0g" - ], - "priority": [ - "100" - ] - } - } - ] - }, - "internationalizationEnabled": false, - "supportedLocales": [], - "authenticationFlows": [ - { - "alias": "Handle Existing Account", - "description": "Handle what to do if there is existing account with same email/username like authenticated identity provider", - "providerId": "basic-flow", - "topLevel": false, - "builtIn": true, - "authenticationExecutions": [ - { - "authenticator": "idp-confirm-link", - "requirement": "REQUIRED", - "priority": 10, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "idp-email-verification", - "requirement": "ALTERNATIVE", - "priority": 20, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "requirement": "ALTERNATIVE", - "priority": 30, - "flowAlias": "Verify Existing Account by Re-authentication", - "userSetupAllowed": false, - "autheticatorFlow": true - } - ] - }, - { - "alias": "Verify Existing Account by Re-authentication", - "description": "Reauthentication of existing account", - "providerId": "basic-flow", - "topLevel": false, - "builtIn": true, - "authenticationExecutions": [ - { - "authenticator": "idp-username-password-form", - "requirement": "REQUIRED", - "priority": 10, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "auth-otp-form", - "requirement": "OPTIONAL", - "priority": 20, - "userSetupAllowed": false, - "autheticatorFlow": false - } - ] - }, - { - "alias": "browser", - "description": "browser based authentication", - "providerId": "basic-flow", - "topLevel": true, - "builtIn": true, - "authenticationExecutions": [ - { - "authenticator": "auth-cookie", - "requirement": "ALTERNATIVE", - "priority": 10, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "auth-spnego", - "requirement": "DISABLED", - "priority": 20, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "identity-provider-redirector", - "requirement": "ALTERNATIVE", - "priority": 25, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "requirement": "ALTERNATIVE", - "priority": 30, - "flowAlias": "forms", - "userSetupAllowed": false, - "autheticatorFlow": true - } - ] - }, - { - "alias": "clients", - "description": "Base authentication for clients", - "providerId": "client-flow", - "topLevel": true, - "builtIn": true, - "authenticationExecutions": [ - { - "authenticator": "client-secret", - "requirement": "ALTERNATIVE", - "priority": 10, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "client-jwt", - "requirement": "ALTERNATIVE", - "priority": 20, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "client-secret-jwt", - "requirement": "ALTERNATIVE", - "priority": 30, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "client-x509", - "requirement": "ALTERNATIVE", - "priority": 40, - "userSetupAllowed": false, - "autheticatorFlow": false - } - ] - }, - { - "alias": "direct grant", - "description": "OpenID Connect Resource Owner Grant", - "providerId": "basic-flow", - "topLevel": true, - "builtIn": true, - "authenticationExecutions": [ - { - "authenticator": "direct-grant-validate-username", - "requirement": "REQUIRED", - "priority": 10, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "direct-grant-validate-password", - "requirement": "REQUIRED", - "priority": 20, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "direct-grant-validate-otp", - "requirement": "OPTIONAL", - "priority": 30, - "userSetupAllowed": false, - "autheticatorFlow": false - } - ] - }, - { - "alias": "docker auth", - "description": "Used by Docker clients to authenticate against the IDP", - "providerId": "basic-flow", - "topLevel": true, - "builtIn": true, - "authenticationExecutions": [ - { - "authenticator": "docker-http-basic-authenticator", - "requirement": "REQUIRED", - "priority": 10, - "userSetupAllowed": false, - "autheticatorFlow": false - } - ] - }, - { - "alias": "first broker login", - "description": "Actions taken after first broker login with identity provider account, which is not yet linked to any Keycloak account", - "providerId": "basic-flow", - "topLevel": true, - "builtIn": true, - "authenticationExecutions": [ - { - "authenticatorConfig": "review profile config", - "authenticator": "idp-review-profile", - "requirement": "REQUIRED", - "priority": 10, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticatorConfig": "create unique user config", - "authenticator": "idp-create-user-if-unique", - "requirement": "ALTERNATIVE", - "priority": 20, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "requirement": "ALTERNATIVE", - "priority": 30, - "flowAlias": "Handle Existing Account", - "userSetupAllowed": false, - "autheticatorFlow": true - } - ] - }, - { - "alias": "forms", - "description": "Username, password, otp and other auth forms.", - "providerId": "basic-flow", - "topLevel": false, - "builtIn": true, - "authenticationExecutions": [ - { - "authenticator": "auth-username-password-form", - "requirement": "REQUIRED", - "priority": 10, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "auth-otp-form", - "requirement": "OPTIONAL", - "priority": 20, - "userSetupAllowed": false, - "autheticatorFlow": false - } - ] - }, - { - "alias": "http challenge", - "description": "An authentication flow based on challenge-response HTTP Authentication Schemes", - "providerId": "basic-flow", - "topLevel": true, - "builtIn": true, - "authenticationExecutions": [ - { - "authenticator": "no-cookie-redirect", - "requirement": "REQUIRED", - "priority": 10, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "basic-auth", - "requirement": "REQUIRED", - "priority": 20, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "basic-auth-otp", - "requirement": "DISABLED", - "priority": 30, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "auth-spnego", - "requirement": "DISABLED", - "priority": 40, - "userSetupAllowed": false, - "autheticatorFlow": false - } - ] - }, - { - "alias": "registration", - "description": "registration flow", - "providerId": "basic-flow", - "topLevel": true, - "builtIn": true, - "authenticationExecutions": [ - { - "authenticator": "registration-page-form", - "requirement": "REQUIRED", - "priority": 10, - "flowAlias": "registration form", - "userSetupAllowed": false, - "autheticatorFlow": true - } - ] - }, - { - "alias": "registration form", - "description": "registration form", - "providerId": "form-flow", - "topLevel": false, - "builtIn": true, - "authenticationExecutions": [ - { - "authenticator": "registration-user-creation", - "requirement": "REQUIRED", - "priority": 20, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "registration-profile-action", - "requirement": "REQUIRED", - "priority": 40, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "registration-password-action", - "requirement": "REQUIRED", - "priority": 50, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "registration-recaptcha-action", - "requirement": "DISABLED", - "priority": 60, - "userSetupAllowed": false, - "autheticatorFlow": false - } - ] - }, - { - "alias": "reset credentials", - "description": "Reset credentials for a user if they forgot their password or something", - "providerId": "basic-flow", - "topLevel": true, - "builtIn": true, - "authenticationExecutions": [ - { - "authenticator": "reset-credentials-choose-user", - "requirement": "REQUIRED", - "priority": 10, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "reset-credential-email", - "requirement": "REQUIRED", - "priority": 20, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "reset-password", - "requirement": "REQUIRED", - "priority": 30, - "userSetupAllowed": false, - "autheticatorFlow": false - }, - { - "authenticator": "reset-otp", - "requirement": "OPTIONAL", - "priority": 40, - "userSetupAllowed": false, - "autheticatorFlow": false - } - ] - }, - { - "alias": "saml ecp", - "description": "SAML ECP Profile Authentication Flow", - "providerId": "basic-flow", - "topLevel": true, - "builtIn": true, - "authenticationExecutions": [ - { - "authenticator": "http-basic-authenticator", - "requirement": "REQUIRED", - "priority": 10, - "userSetupAllowed": false, - "autheticatorFlow": false - } - ] - } - ], - "authenticatorConfig": [ - { - "alias": "create unique user config", - "config": { - "require.password.update.after.registration": "false" - } - }, - { - "alias": "review profile config", - "config": { - "update.profile.on.first.login": "missing" - } - } - ], - "requiredActions": [ - { - "alias": "CONFIGURE_TOTP", - "name": "Configure OTP", - "providerId": "CONFIGURE_TOTP", - "enabled": true, - "defaultAction": false, - "priority": 10, - "config": {} - }, - { - "alias": "terms_and_conditions", - "name": "Terms and Conditions", - "providerId": "terms_and_conditions", - "enabled": false, - "defaultAction": false, - "priority": 20, - "config": {} - }, - { - "alias": "UPDATE_PASSWORD", - "name": "Update Password", - "providerId": "UPDATE_PASSWORD", - "enabled": true, - "defaultAction": false, - "priority": 30, - "config": {} - }, - { - "alias": "UPDATE_PROFILE", - "name": "Update Profile", - "providerId": "UPDATE_PROFILE", - "enabled": true, - "defaultAction": false, - "priority": 40, - "config": {} - }, - { - "alias": "VERIFY_EMAIL", - "name": "Verify Email", - "providerId": "VERIFY_EMAIL", - "enabled": true, - "defaultAction": false, - "priority": 50, - "config": {} - } - ], - "browserFlow": "browser", - "registrationFlow": "registration", - "directGrantFlow": "direct grant", - "resetCredentialsFlow": "reset credentials", - "clientAuthenticationFlow": "clients", - "dockerAuthenticationFlow": "docker auth", - "attributes": { - "_browser_header.xXSSProtection": "1; mode=block", - "_browser_header.xFrameOptions": "SAMEORIGIN", - "_browser_header.strictTransportSecurity": "max-age=31536000; includeSubDomains", - "permanentLockout": "false", - "quickLoginCheckMilliSeconds": "1000", - "_browser_header.xRobotsTag": "none", - "maxFailureWaitSeconds": "900", - "minimumQuickLoginWaitSeconds": "60", - "failureFactor": "30", - "actionTokenGeneratedByUserLifespan": "300", - "maxDeltaTimeSeconds": "43200", - "_browser_header.xContentTypeOptions": "nosniff", - "offlineSessionMaxLifespan": "5184000", - "actionTokenGeneratedByAdminLifespan": "43200", - "_browser_header.contentSecurityPolicyReportOnly": "", - "bruteForceProtected": "false", - "_browser_header.contentSecurityPolicy": "frame-src 'self'; frame-ancestors 'self'; object-src 'none';", - "waitIncrementSeconds": "60", - "offlineSessionMaxLifespanEnabled": "false" - }, - "users": [ - { - "username": "admin", - "enabled": true, - "totp": false, - "emailVerified": false, - "credentials": [ - { - "type": "password", - "hashedSaltedValue": "NICTtwsvSxJ5hL8hLAuleDUv9jwZcuXgxviMXvR++cciyPtiIEStEaJUyfA9DOir59awjPrHOumsclPVjNBplA==", - "salt": "T/2P5o5oxFJUEk68BRURRg==", - "hashIterations": 27500, - "counter": 0, - "algorithm": "pbkdf2-sha256", - "digits": 0, - "period": 0, - "createdDate": 1554245879354, - "config": {} - } - ], - "disableableCredentialTypes": [ - "password" - ], - "requiredActions": [], - "realmRoles": [ - "admin", - "managers", - "user", - "IT", - "HR" - ], - "notBefore": 0, - "groups": [] - }, - { - "username": "alice", - "enabled": true, - "totp": false, - "emailVerified": false, - "credentials": [ - { - "type": "password", - "hashedSaltedValue": "A3okqV2T/ybXTVEgKfosoSjP8Yc9IZbFP/SY4cEd6hag7TABQrQ6nUSuwagGt96l8cw1DTijO75PqX6uiTXMzw==", - "salt": "sl4mXx6T9FypPH/s9TngfQ==", - "hashIterations": 27500, - "counter": 0, - "algorithm": "pbkdf2-sha256", - "digits": 0, - "period": 0, - "createdDate": 1554245879116, - "config": {} - } - ], - "disableableCredentialTypes": [ - "password" - ], - "requiredActions": [], - "realmRoles": [ - "user", - "HR" - ], - "notBefore": 0, - "groups": [] - }, - { - "username": "jdoe", - "enabled": true, - "totp": false, - "emailVerified": false, - "credentials": [ - { - "type": "password", - "hashedSaltedValue": "JV3DUNLjqOadjbBOtC4rvacQI553CGaDGAzBS8MR5ReCr7SwF3E6CsW3T7/XO8ITZAsch8+A/6loeuCoVLLJrg==", - "salt": "uCbOH7HZtyDtMd0E9DG/nw==", - "hashIterations": 27500, - "counter": 0, - "algorithm": "pbkdf2-sha256", - "digits": 0, - "period": 0, - "createdDate": 1554245879227, - "config": {} - } - ], - "disableableCredentialTypes": [ - "password" - ], - "requiredActions": [], - "realmRoles": [ - "managers", - "user", - "IT" - ], - "notBefore": 0, - "groups": [] - } - ], - "keycloakVersion": "6.0.0", - "userManagedAccessAllowed": false -} diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/pgadmin/pgpass b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/pgadmin/pgpass deleted file mode 100644 index 11a6f7c601..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/pgadmin/pgpass +++ /dev/null @@ -1,3 +0,0 @@ -postgres:5432:kogito:kogito-user:kogito-pass -postgres:5432:keycloak:kogito-user:kogito-pass -postgres:5432:postgres:kogito-user:kogito-pass \ No newline at end of file diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/pgadmin/servers.json b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/pgadmin/servers.json deleted file mode 100644 index a112980d55..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/pgadmin/servers.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Servers": { - "1": { - "Name": "kogito", - "Group": "Servers", - "Host": "postgres", - "Port": 5432, - "MaintenanceDB": "kogito", - "Username": "kogito-user", - "SSLMode": "disable", - "PassFile": "/var/lib/pgadmin/pgpass" - } - } -} \ No newline at end of file diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/sql/init.sql b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/sql/init.sql deleted file mode 100644 index 92ea9b4e5c..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/sql/init.sql +++ /dev/null @@ -1,33 +0,0 @@ -CREATE ROLE "kogito-user" WITH - LOGIN - SUPERUSER - INHERIT - CREATEDB - CREATEROLE - NOREPLICATION - PASSWORD 'kogito-pass'; - -CREATE DATABASE kogito - WITH - OWNER = "kogito-user" - ENCODING = 'UTF8' - LC_COLLATE = 'en_US.utf8' - LC_CTYPE = 'en_US.utf8' - TABLESPACE = pg_default - CONNECTION LIMIT = -1; - -CREATE DATABASE keycloak - WITH - OWNER = "kogito-user" - ENCODING = 'UTF8' - LC_COLLATE = 'en_US.utf8' - LC_CTYPE = 'en_US.utf8' - TABLESPACE = pg_default - CONNECTION LIMIT = -1; - -GRANT ALL PRIVILEGES ON DATABASE postgres TO "kogito-user"; -GRANT ALL PRIVILEGES ON DATABASE kogito TO "kogito-user"; -GRANT ALL PRIVILEGES ON DATABASE kogito TO postgres; - -GRANT ALL PRIVILEGES ON DATABASE keycloak TO "kogito-user"; -GRANT ALL PRIVILEGES ON DATABASE keycloak TO postgres; \ No newline at end of file diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/startServices.sh b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/startServices.sh deleted file mode 100755 index 4aebd0e1b3..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docker-compose/startServices.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -PROFILE="full" - -echo "Script requires your Kogito Example to be compiled" - -PROJECT_VERSION=$(cd ../ && mvn help:evaluate -Dexpression=project.version -q -DforceStdout) - -echo "Project version: ${PROJECT_VERSION}" - -if [[ $PROJECT_VERSION == *SNAPSHOT ]]; -then - KOGITO_VERSION="latest" -else - KOGITO_VERSION=${PROJECT_VERSION%.*} -fi - -if [ -n "$1" ]; then - if [[ ("$1" == "full") || ("$1" == "infra") || ("$1" == "example")]]; - then - PROFILE="$1" - else - echo "Unknown docker profile '$1'. The supported profiles are:" - echo "* 'infra': Use this profile to start only the minimum infrastructure to run the example (postgresql, data-index & jobs-service)." - echo "* 'example': Use this profile to start the example infrastructure and the kogito-example service. Requires the example to be compiled using the 'container' profile (-Pcontainer)" - echo "* 'full' (default): Starts full example setup, including infrastructure (database, data-index & jobs-service), the kogito-example-service container and the runtime consoles (management-console, task-console & keycloak). Requires the example to be compiled using the 'container' profile (-Pcontainer)" - exit 1; - fi -fi - -echo "Kogito Image version: ${KOGITO_VERSION}" -echo "KOGITO_VERSION=${KOGITO_VERSION}" > ".env" -echo "COMPOSE_PROFILES='${PROFILE}'" >> ".env" - -if [ "$(uname)" == "Darwin" ]; then - echo "DOCKER_GATEWAY_HOST=kubernetes.docker.internal" >> ".env" -elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then - echo "DOCKER_GATEWAY_HOST=172.17.0.1" >> ".env" -fi - -if [ ! -d "./svg" ] -then - echo "$KOGITO_EXAMPLE_SVG_FOLDER does not exist. Have you compiled the project? mvn clean install -DskipTests" - exit 1 -fi - -docker compose up \ No newline at end of file diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g1_1_mc_list.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g1_1_mc_list.png deleted file mode 100644 index 4e5aa6274d..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g1_1_mc_list.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g1_2_mc_details.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g1_2_mc_details.png deleted file mode 100644 index f2b228f20d..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g1_2_mc_details.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g1_3_mc_details_executed_job.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g1_3_mc_details_executed_job.png deleted file mode 100644 index 1ab358819c..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g1_3_mc_details_executed_job.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_10_mc_details_completed.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_10_mc_details_completed.png deleted file mode 100644 index 610849f19e..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_10_mc_details_completed.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_1_mc_list.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_1_mc_list.png deleted file mode 100644 index 6526e8e7f2..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_1_mc_list.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_2_mc_details.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_2_mc_details.png deleted file mode 100644 index ec18201f08..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_2_mc_details.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_3_tc_inbox.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_3_tc_inbox.png deleted file mode 100644 index 0d612f76c8..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_3_tc_inbox.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_4_tc_hr_form.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_4_tc_hr_form.png deleted file mode 100644 index d89b41302d..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_4_tc_hr_form.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_5_tc_hr_form_notification.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_5_tc_hr_form_notification.png deleted file mode 100644 index 8dd81fc4a9..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_5_tc_hr_form_notification.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_6_mc_details.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_6_mc_details.png deleted file mode 100644 index 4970b8f837..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_6_mc_details.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_7_tc_inbox.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_7_tc_inbox.png deleted file mode 100644 index 03f63ff7b4..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_7_tc_inbox.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_8_tc_it_form.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_8_tc_it_form.png deleted file mode 100644 index 5e6872a09c..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_8_tc_it_form.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_9_tc_inbox_empty.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_9_tc_inbox_empty.png deleted file mode 100644 index 696433e93d..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/g2_9_tc_inbox_empty.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/generate_offer_assignments.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/generate_offer_assignments.png deleted file mode 100644 index 2e3f93529f..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/generate_offer_assignments.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/hiring_diagram.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/hiring_diagram.png deleted file mode 100644 index cb57a2dfb9..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/hiring_diagram.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/hr_interview_assignments.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/hr_interview_assignments.png deleted file mode 100644 index 63de050eb5..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/hr_interview_assignments.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/it_interview_assignments.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/it_interview_assignments.png deleted file mode 100644 index 077430569d..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/it_interview_assignments.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/mc_details_1.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/mc_details_1.png deleted file mode 100644 index 2c1c3b26ab..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/mc_details_1.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/mc_list.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/mc_list.png deleted file mode 100644 index 4fc32b05cc..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/mc_list.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/new_hiring_offer_dmn.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/new_hiring_offer_dmn.png deleted file mode 100644 index 451313a264..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/new_hiring_offer_dmn.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/new_hiring_offer_dmn_decision.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/new_hiring_offer_dmn_decision.png deleted file mode 100644 index f58d869d36..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/new_hiring_offer_dmn_decision.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/new_hiring_offer_dmn_types.png b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/new_hiring_offer_dmn_types.png deleted file mode 100644 index d028d331da..0000000000 Binary files a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/docs/images/new_hiring_offer_dmn_types.png and /dev/null differ diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/pom.xml b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/pom.xml deleted file mode 100644 index 24664247f3..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/pom.xml +++ /dev/null @@ -1,232 +0,0 @@ - - - - 4.0.0 - - org.kie.kogito.examples - kogito-quarkus-examples - 999-SNAPSHOT - - process-usertasks-timer-data-index-persistence-addon-quarkus - Kogito Example :: Process Usertasks with Timer Data Index persistence addon Quarkus - Kogito user tasks orchestration with security enabled on REST api using the Data Index Persistence addon - Quarkus - - 3.8.4 - quarkus-bom - io.quarkus - 3.8.4 - org.kie.kogito - kogito-bom - kogito-apps-bom - 999-SNAPSHOT - - - - - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} - pom - import - - - ${kogito.bom.group-id} - ${kogito.bom.artifact-id} - ${version.org.kie.kogito} - pom - import - - - ${kogito.bom.group-id} - ${kogito-apps.bom.artifact-id} - ${version.org.kie.kogito} - pom - import - - - - - - io.quarkus - quarkus-resteasy - - - io.quarkus - quarkus-resteasy-jackson - - - io.quarkus - quarkus-smallrye-openapi - - - io.quarkus - quarkus-smallrye-health - - - - org.jbpm - jbpm-with-drools-quarkus - - - - org.jbpm - jbpm-quarkus - - - - org.kie - kie-addons-quarkus-process-management - - - org.kie - kogito-addons-quarkus-jobs-management - - - org.kie - kie-addons-quarkus-process-svg - - - org.kie - kie-addons-quarkus-source-files - - - - - io.quarkus - quarkus-jdbc-postgresql - - - io.quarkus - quarkus-agroal - - - org.kie - kie-addons-quarkus-persistence-jdbc - - - - - org.kie - kogito-addons-quarkus-data-index-persistence-postgresql - - - - - org.kie - kogito-addons-quarkus-jobs - - - org.kie.kogito - jobs-service-postgresql-common - - - - - org.kie - kogito-addons-quarkus-data-audit-jpa - - - org.kie - kogito-addons-quarkus-data-audit - - - - - container - - container - - - - io.quarkus - quarkus-container-image-jib - - - - - development - - dev - - - - - ${project.artifactId} - - - maven-compiler-plugin - ${version.compiler.plugin} - - ${maven.compiler.release} - - - - ${quarkus.platform.group-id} - quarkus-maven-plugin - ${quarkus-plugin.version} - - - - build - - - - - - maven-antrun-plugin - - - package - - run - - - - - - - - - - - - - maven-failsafe-plugin - - - org.jboss.logmanager.LogManager - ${maven.home} - - - - - - integration-test - verify - - - - - - - diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/java/org/kie/kogito/hr/CandidateData.java b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/java/org/kie/kogito/hr/CandidateData.java deleted file mode 100644 index eae14184da..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/java/org/kie/kogito/hr/CandidateData.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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. - */ - -package org.kie.kogito.hr; - -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonIgnore; - -public class CandidateData { - - private String name; - - private String lastName; - - private String email; - - private Integer experience; - - private List skills; - - public CandidateData() { - } - - public CandidateData(String name, String lastName, String email, Integer experience, List skills) { - this.name = name; - this.lastName = lastName; - this.email = email; - this.experience = experience; - this.skills = skills; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public Integer getExperience() { - return experience; - } - - public void setExperience(Integer experience) { - this.experience = experience; - } - - public List getSkills() { - return skills; - } - - public void setSkills(List skills) { - this.skills = skills; - } - - @JsonIgnore - public String getFullName() { - return name + " " + lastName; - } -} diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/resources/META-INF/processSVG/hiring.svg b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/resources/META-INF/processSVG/hiring.svg deleted file mode 100644 index fba0500706..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/resources/META-INF/processSVG/hiring.svg +++ /dev/null @@ -1 +0,0 @@ -HR InterviewIT InterviewNew Hiring Send notification HR Interview avoided Application denied Generate base offer Log OfferSend Offer to Candidate \ No newline at end of file diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index 8556bab48e..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - Kogito quickstart - - - - - - - - - - - - - - -
-
-
-
-

Welcome to Kogito

-

- Cloud-native business automation for building intelligent applications, backed by - battle-tested capabilities. -

- - Get Started - - - Latest updates - -
-
-
-
-
-
-
-

Quick Links

- -
-
-
- - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/resources/NewHiringOffer.dmn b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/resources/NewHiringOffer.dmn deleted file mode 100644 index 67b0eded68..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/resources/NewHiringOffer.dmn +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - string - - - string - - - string - - - number - - - string - - - - - number - - - string - - "Software Engineer", "Senior Software Engineer", "Software Architect" - - - - - - - - - - - - - - - - - - count(CandidateData.skills) * 150 - - - - - - - - CandidateData.experience - - - - - "Software Engineer", "Senior Software Engineer", "Software Architect" - - - - - - - [0..5) - - - "Software Engineer" - - - 30000 + SalaryBonus - - - - - - - - [5..10) - - - "Senior Software Engineer" - - - 40000 + SalaryBonus - - - - - - - - >=10 - - - "Software Architect" - - - 50000 + SalaryBonus - - - - - - - - - - Offer - - - - - - - - - - 50 - 120 - 926 - - - 926 - - - 50 - 175 - 104 - 437 - 140 - - - 926 - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/resources/application.properties b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/resources/application.properties deleted file mode 100644 index 9abe455ea1..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/resources/application.properties +++ /dev/null @@ -1,49 +0,0 @@ -# Packaging -#quarkus.package.type=fast-jar - -#https://quarkus.io/guides/openapi-swaggerui -quarkus.http.cors=true -quarkus.smallrye-openapi.path=/docs/openapi.json -quarkus.swagger-ui.always-include=true -quarkus.kogito.data-index.graphql.ui.always-include=true -quarkus.http.test-port=0 - -# Kogito-service -kogito.service.url=http://localhost:8080 - -#Job-service -kogito.jobs-service.url=http://localhost:8080 - -# to be reachable from the container running job-service -kogito.dataindex.http.url=http://localhost:8180 -kogito.dataindex.ws.url=ws://localhost:8180 - -# run create tables scripts -quarkus.flyway.migrate-at-start=true -quarkus.flyway.baseline-on-migrate=true -quarkus.flyway.baseline-version=0.0 -quarkus.flyway.locations=classpath:/db/migration,classpath:/db/jobs-service,classpath:/db/data-audit/postgresql -quarkus.flyway.table=FLYWAY_RUNTIME_SERVICE - -kogito.persistence.type=jdbc -quarkus.datasource.db-kind=postgresql -%prod.quarkus.datasource.username=kogito-user -%prod.quarkus.datasource.password=kogito-pass -%prod.quarkus.datasource.jdbc.url=${QUARKUS_DATASOURCE_JDBC_URL:jdbc:postgresql://localhost:5432/kogito} -%prod.quarkus.datasource.reactive.url=${QUARKUS_DATASOURCE_REACTIVE_URL:postgresql://localhost:5432/kogito} - -quarkus.native.native-image-xmx=8g - -# profile to pack this example into a container, to use it execute activate the maven container profile, -Pcontainer -%container.quarkus.container-image.build=true -%container.quarkus.container-image.push=false -%container.quarkus.container-image.group=${USER} -%container.quarkus.container-image.registry=dev.local -%container.quarkus.container-image.tag=1.0-SNAPSHOT -%container.quarkus.container-image.name=kogito-example-service - -%dev.quarkus.kogito.devservices.enabled=true -%dev.kogito.users.jdoe.groups=admin,HR,IT - -# Disabling OIDC -quarkus.oidc.enabled=false \ No newline at end of file diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/resources/hiring.bpmn b/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/resources/hiring.bpmn deleted file mode 100644 index 3c043c24cf..0000000000 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/resources/hiring.bpmn +++ /dev/null @@ -1,691 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _B11455DE-F77A-4251-A85B-4C66636E3CD9 - _7DDA574A-C220-4FEF-9784-22EF8052EDEC - System.out.println("###################################"); -System.out.println("To: " + candidateData.getEmail()); -System.out.println("Subject: Congratulations you made it!"); -System.out.println("Dear " + candidateData.getFullName() + ", we are happy to tell you that you've successfuly went trhough the hiring process. You'll find the fina Offer details in attached."); -System.out.println("Job Category: " + offer.getCategory()); -System.out.println("Base salary: " + offer.getSalary()); -System.out.println("###################################"); - - - - - - - - _9C33F5EA-89C7-4ED1-B3C2-CF18DE439AF5 - _ACEE7578-B7D2-4EDF-B104-9ECF3DD8A383 - System.out.println("###################################"); -System.out.println("Generated offer for candidate: " + candidateData.getFullName()); -System.out.println("Job Category: " + offer.getCategory()); -System.out.println("Base salary: " + offer.getSalary()); -System.out.println("###################################"); - - - _7DDA574A-C220-4FEF-9784-22EF8052EDEC - - - - - - - - _59F9A0E6-7F9C-43A9-8920-5B40A91169E6 - _9C33F5EA-89C7-4ED1-B3C2-CF18DE439AF5 - - - - - - - - - _F4D56F6C-4CFE-4D5C-BF5E-67261F68EF1A_fileNameInputX - _F4D56F6C-4CFE-4D5C-BF5E-67261F68EF1A_namespaceInputX - _F4D56F6C-4CFE-4D5C-BF5E-67261F68EF1A_decisionInputX - _F4D56F6C-4CFE-4D5C-BF5E-67261F68EF1A_modelInputX - _F4D56F6C-4CFE-4D5C-BF5E-67261F68EF1A_CandidateDataInputX - - - _F4D56F6C-4CFE-4D5C-BF5E-67261F68EF1A_OfferOutputX - - - - _F4D56F6C-4CFE-4D5C-BF5E-67261F68EF1A_fileNameInputX - - - - - - - _F4D56F6C-4CFE-4D5C-BF5E-67261F68EF1A_namespaceInputX - - - - - - - _F4D56F6C-4CFE-4D5C-BF5E-67261F68EF1A_decisionInputX - - - - - - - _F4D56F6C-4CFE-4D5C-BF5E-67261F68EF1A_modelInputX - - - - - - - candidateData - _F4D56F6C-4CFE-4D5C-BF5E-67261F68EF1A_CandidateDataInputX - - - _F4D56F6C-4CFE-4D5C-BF5E-67261F68EF1A_OfferOutputX - offer - - - - _527D3164-4989-4D2C-B80B-9BA9D4C8FB89 - - - - - - - - _94172225-E124-4F14-98DA-C3D62C11254A - _527D3164-4989-4D2C-B80B-9BA9D4C8FB89 - System.out.println("###################################"); -System.out.println("Candidate " + candidateData.getFullName() + " don't meet the requirements for the position but we'll keep it on records for the future!"); -System.out.println("###################################"); - - - - _5334FFDC-1FCB-47E6-8085-36DC9A3D17B9 - _B7FC63DD-C08F-4CB3-A51A-79C1B8B18E6E - _C6E61C53-FD35-4347-B69E-30AA93AE4404 - _94172225-E124-4F14-98DA-C3D62C11254A - - - _5162ABF0-DD2E-4BDC-9A46-DDCFCB010287 - _59F9A0E6-7F9C-43A9-8920-5B40A91169E6 - _C6E61C53-FD35-4347-B69E-30AA93AE4404 - - - _C62F7EFB-A009-450A-81C7-57D36F0DF766 - _B11455DE-F77A-4251-A85B-4C66636E3CD9 - _B7FC63DD-C08F-4CB3-A51A-79C1B8B18E6E - - - - - - - - _7B41F971-C74D-4036-8A5E-EFF81C37986A - _5334FFDC-1FCB-47E6-8085-36DC9A3D17B9 - System.out.println("###################################"); -System.out.println("HR Interview have been avoided after reasonable time"); -System.out.println("###################################"); - - - - - - - - - _8863B46B-9B0F-40B9-AAB1-A7503CF9AA0A - _5162ABF0-DD2E-4BDC-9A46-DDCFCB010287 - System.out.println("New Hiring has been created for candidate: " + candidateData.getFullName()); - -kcontext.setVariable("hr_approval", false); -kcontext.setVariable("it_approval", false); - - - - - - - - _A76C6603-0406-423C-940B-3403948DCA1F - _C62F7EFB-A009-450A-81C7-57D36F0DF766 - - - - - - - - - _8962C15F-55EC-46F7-B926-5D5A1FD8D35E_TaskNameInputX - _8962C15F-55EC-46F7-B926-5D5A1FD8D35E_candidateInputX - _8962C15F-55EC-46F7-B926-5D5A1FD8D35E_offerInputX - _8962C15F-55EC-46F7-B926-5D5A1FD8D35E_approveInputX - _8962C15F-55EC-46F7-B926-5D5A1FD8D35E_SkippableInputX - - - _8962C15F-55EC-46F7-B926-5D5A1FD8D35E_approveOutputX - - - - _8962C15F-55EC-46F7-B926-5D5A1FD8D35E_TaskNameInputX - - - - - - - candidateData - _8962C15F-55EC-46F7-B926-5D5A1FD8D35E_candidateInputX - - - offer - _8962C15F-55EC-46F7-B926-5D5A1FD8D35E_offerInputX - - - it_approval - _8962C15F-55EC-46F7-B926-5D5A1FD8D35E_approveInputX - - - _8962C15F-55EC-46F7-B926-5D5A1FD8D35E_SkippableInputX - - - - - - - _8962C15F-55EC-46F7-B926-5D5A1FD8D35E_approveOutputX - it_approval - - - - jdoe - - - - - - - - - - _ACEE7578-B7D2-4EDF-B104-9ECF3DD8A383 - _A76C6603-0406-423C-940B-3403948DCA1F - - - - - - - - - - _B8C4F63C-81AD-4291-9C1B-84967277EEF6_TaskNameInputX - _B8C4F63C-81AD-4291-9C1B-84967277EEF6_candidateInputX - _B8C4F63C-81AD-4291-9C1B-84967277EEF6_offerInputX - _B8C4F63C-81AD-4291-9C1B-84967277EEF6_approveInputX - _B8C4F63C-81AD-4291-9C1B-84967277EEF6_SkippableInputX - - - _B8C4F63C-81AD-4291-9C1B-84967277EEF6_approveOutputX - _B8C4F63C-81AD-4291-9C1B-84967277EEF6_offerOutputX - - - - _B8C4F63C-81AD-4291-9C1B-84967277EEF6_TaskNameInputX - - - - - - - candidateData - _B8C4F63C-81AD-4291-9C1B-84967277EEF6_candidateInputX - - - offer - _B8C4F63C-81AD-4291-9C1B-84967277EEF6_offerInputX - - - hr_approval - _B8C4F63C-81AD-4291-9C1B-84967277EEF6_approveInputX - - - _B8C4F63C-81AD-4291-9C1B-84967277EEF6_SkippableInputX - - - - - - - _B8C4F63C-81AD-4291-9C1B-84967277EEF6_approveOutputX - hr_approval - - - _B8C4F63C-81AD-4291-9C1B-84967277EEF6_offerOutputX - offer - - - - jdoe - - - - - _8863B46B-9B0F-40B9-AAB1-A7503CF9AA0A - - - _7B41F971-C74D-4036-8A5E-EFF81C37986A - - PT180S - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _0IqVEG0AEDySCYWhrcdpgA - _0IqVEG0AEDySCYWhrcdpgA - - \ No newline at end of file diff --git a/kogito-quarkus-examples/process-usertasks-timer-quarkus-with-console/README.md b/kogito-quarkus-examples/process-usertasks-timer-quarkus-with-console/README.md index 6ad8af5e3b..defb90fcf9 100644 --- a/kogito-quarkus-examples/process-usertasks-timer-quarkus-with-console/README.md +++ b/kogito-quarkus-examples/process-usertasks-timer-quarkus-with-console/README.md @@ -120,6 +120,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ##### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/README.md b/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/README.md index 31aee80af1..f50a0c6a3c 100644 --- a/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/README.md +++ b/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/README.md @@ -39,7 +39,7 @@ When using native image compilation, you will also need: To start a Keycloak Server you can use Docker and just run the following command: ``` -docker run -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -e KEYCLOAK_IMPORT=/tmp/kogito-realm.json -v /kogito-usertasks-with-security-oidc-quarkus/config/kogito-realm.json:/tmp/kogito-realm.json -p 8281:8080 quay.io/keycloak/keycloak:legacy +docker run -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -e KEYCLOAK_IMPORT=/tmp/kogito-realm.json -v /process-usertasks-with-security-oidc-quarkus/config/kogito-realm.json:/tmp/kogito-realm.json -p 8281:8080 quay.io/keycloak/keycloak:legacy ``` You should be able to access your Keycloak Server at [localhost:8281/auth](http://localhost:8281). @@ -74,6 +74,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/src/main/docker/Dockerfile.jvm index d65e7f37cc..5a3eb28c77 100644 --- a/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-usertasks-with-security-oidc-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/src/main/docker/Dockerfile.native index b508cbb1d3..b097bd97ea 100644 --- a/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/src/main/docker/Dockerfile.native @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native -t quarkus/kogito-infinispan-persistence-quarkus . +# docker build -f src/main/docker/Dockerfile.native -t quarkus/process-usertasks-with-security-oidc-quarkus . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/kogito-infinispan-persistence-quarkus +# docker run -i --rm -p 8080:8080 quarkus/process-usertasks-with-security-oidc-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-usertasks-with-security-quarkus/README.md b/kogito-quarkus-examples/process-usertasks-with-security-quarkus/README.md index fce12e858f..bc5f77fb8e 100644 --- a/kogito-quarkus-examples/process-usertasks-with-security-quarkus/README.md +++ b/kogito-quarkus-examples/process-usertasks-with-security-quarkus/README.md @@ -54,6 +54,11 @@ java -jar target\quarkus-app\quarkus-run.jar ``` ### Package and Run using Local Native Image +Note that the following configuration property needs to be added to `application.properties` in order to enable automatic registration of `META-INF/services` entries required by the workflow engine: +``` +quarkus.native.auto-service-loader-registration=true +``` + Note that this requires GRAALVM_HOME to point to a valid GraalVM installation ```sh diff --git a/kogito-quarkus-examples/process-usertasks-with-security-quarkus/src/main/docker/Dockerfile.jvm b/kogito-quarkus-examples/process-usertasks-with-security-quarkus/src/main/docker/Dockerfile.jvm index 7b0a73f916..f1693e4189 100644 --- a/kogito-quarkus-examples/process-usertasks-with-security-quarkus/src/main/docker/Dockerfile.jvm +++ b/kogito-quarkus-examples/process-usertasks-with-security-quarkus/src/main/docker/Dockerfile.jvm @@ -14,7 +14,7 @@ # docker run -i --rm -p 8080:8080 quarkus/process-usertasks-with-security-quarkus-jvm # ### -FROM fabric8/java-alpine-openjdk11-jre +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/openjdk-17:1.18 ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV AB_ENABLED=jmx_exporter diff --git a/kogito-quarkus-examples/process-usertasks-with-security-quarkus/src/main/docker/Dockerfile.native b/kogito-quarkus-examples/process-usertasks-with-security-quarkus/src/main/docker/Dockerfile.native index b508cbb1d3..c930960827 100644 --- a/kogito-quarkus-examples/process-usertasks-with-security-quarkus/src/main/docker/Dockerfile.native +++ b/kogito-quarkus-examples/process-usertasks-with-security-quarkus/src/main/docker/Dockerfile.native @@ -7,14 +7,14 @@ # # Then, build the image with: # -# docker build -f src/main/docker/Dockerfile.native -t quarkus/kogito-infinispan-persistence-quarkus . +# docker build -f src/main/docker/Dockerfile.native -t quarkus/process-usertasks-with-security-quarkus . # # Then run the container using: # -# docker run -i --rm -p 8080:8080 quarkus/kogito-infinispan-persistence-quarkus +# docker run -i --rm -p 8080:8080 quarkus/process-usertasks-with-security-quarkus # ### -FROM registry.access.redhat.com/ubi8/ubi-minimal +FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/ubi-minimal:9.4 WORKDIR /work/ COPY target/*-runner /work/application RUN chmod 775 /work diff --git a/kogito-quarkus-examples/process-usertasks-with-security-quarkus/src/main/resources/META-INF/resources/index.html b/kogito-quarkus-examples/process-usertasks-with-security-quarkus/src/main/resources/META-INF/resources/index.html deleted file mode 100644 index cc6e2fe97c..0000000000 --- a/kogito-quarkus-examples/process-usertasks-with-security-quarkus/src/main/resources/META-INF/resources/index.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - kogito-infinispan-persistence-quarkus - 1.0-SNAPSHOT - - - - - - -
-
-

Congratulations, you have created a new Quarkus application.

- -

Why do you see this?

- -

This page is served by Quarkus. The source is in - src/main/resources/META-INF/resources/index.html.

- -

What can I do from here?

- -

If not already done, run the application in dev mode using: mvn compile quarkus:dev. -

-
    -
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • -
  • Your static assets are located in src/main/resources/META-INF/resources.
  • -
  • Configure your application in src/main/resources/application.properties. -
  • -
- -

How do I get rid of this page?

-

Just delete the src/main/resources/META-INF/resources/index.html file.

-
-
-
-

Application

-
    -
  • GroupId: org.acme
  • -
  • ArtifactId: kogito-infinispan-persistence-quarkus
  • -
  • Version: 1.0-SNAPSHOT
  • -
  • Quarkus Version: 0.19.1
  • -
-
- -
-
- - - - \ No newline at end of file diff --git a/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/README.md b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/README.md new file mode 100644 index 0000000000..677340d850 --- /dev/null +++ b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/README.md @@ -0,0 +1,135 @@ + +# Rules with Legacy API + Quarkus + Test Scenario example + +## Description + +A simple rule service to validate `Hello` fact and testing it using Scenario Simulation. + +An injectable KieRuntimeBuilder is generated, so you can create Drools v7 KieBase and KieSession out of it. + +## Installing and Running + +### Prerequisites + +You will need: + - Java 17+ installed + - Environment variable JAVA_HOME set accordingly + - Maven 3.9.6+ installed + +When using native image compilation, you will also need: + - [GraalVM 21.1.0](https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-21.1.0) 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 + +```sh +mvn clean compile quarkus:dev +``` + +### Package and Run in JVM mode + +```sh +mvn clean package +java -jar target/quarkus-app/quarkus-run.jar +``` + +or on windows + +```sh +mvn clean package +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 +mvn clean package -Pnative +``` + +To run the generated native executable, generated in `target/`, execute + +```sh +./target/rules-legacy-quarkus-example-runner +``` + +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). + +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. + +## 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. + +### POST /find-approved + +Returns approved Hello from the given fact: + +```sh +curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"approved":false, "greeting":"foo"}' http://localhost:8080/find-approved +``` +or on windows + +```sh +curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d "{\"approved\":false, \"greeting\":\"foo\"}" http://localhost:8080/find-approved +``` + +As response the modified Hello is returned. + +Example response: + +```json +{"greeting":"foo","approved":true} +``` + +Returns denied Hello from the given fact: + +```sh +curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"approved":false, "greeting":"bar"}' http://localhost:8080/find-approved +``` +or on windows + +```sh +curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d "{\"approved\":false, \"greeting\":\"bar\"}" http://localhost:8080/find-approved +``` + +As response the modified Hello is returned. + +Example response: + +```json +{"greeting":"bar","approved":false} +``` +# Test Scenario usage + +Test Scenario + rules project created inside Business central should work, with the following requirements: +1. use the pom as defined in the current project + +## Caveat +Requires `org.drools:drools-xml-support` dependency +For the moment being, "globals" are unsupported \ No newline at end of file diff --git a/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/pom.xml b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/pom.xml new file mode 100644 index 0000000000..a34dd57970 --- /dev/null +++ b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/pom.xml @@ -0,0 +1,134 @@ + + + + 4.0.0 + + org.kie.kogito.examples + kogito-quarkus-examples + 999-SNAPSHOT + + rules-legacy-scesim-quarkus-example + Kogito Example :: Rules Legacy API HELLO - Quarkus :: Test Scenario + + 3.8.4 + quarkus-bom + io.quarkus + 3.8.4 + org.kie.kogito + kogito-bom + 999-SNAPSHOT + 999-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 + + + org.drools + drools-xml-support + ${version.org.kie.kogito} + test + + + + + + org.drools + drools-quarkus-rules + + + io.quarkus + quarkus-resteasy-jackson + + + io.quarkus + quarkus-resteasy + + + io.quarkus + quarkus-arc + + + io.quarkus + quarkus-smallrye-openapi + + + org.kie.kogito + kogito-drools + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + io.quarkus + quarkus-smallrye-health + + + + org.kie.kogito + kogito-scenario-simulation + test + + + org.drools + drools-xml-support + test + + + + ${project.artifactId} + + + ${quarkus.platform.group-id} + quarkus-maven-plugin + ${quarkus-plugin.version} + + + + build + + + + + + + diff --git a/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/main/java/org/kie/kogito/legacy/Hello.java b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/main/java/org/kie/kogito/legacy/Hello.java new file mode 100644 index 0000000000..96fa6be094 --- /dev/null +++ b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/main/java/org/kie/kogito/legacy/Hello.java @@ -0,0 +1,55 @@ +/* + * 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. + */ +package org.kie.kogito.legacy; + +public class Hello implements java.io.Serializable { + + static final long serialVersionUID = 1L; + + @org.kie.api.definition.type.Label("Greeting") + private java.lang.String greeting; + + @org.kie.api.definition.type.Label(value = "Approved") + private java.lang.Boolean approved; + + public Hello() { + } + + public java.lang.String getGreeting() { + return this.greeting; + } + + public void setGreeting(java.lang.String greeting) { + this.greeting = greeting; + } + + public java.lang.Boolean getApproved() { + return this.approved; + } + + public void setApproved(java.lang.Boolean approved) { + this.approved = approved; + } + + public Hello(java.lang.String greeting, java.lang.Boolean approved) { + this.greeting = greeting; + this.approved = approved; + } + +} \ No newline at end of file diff --git a/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/main/java/org/kie/kogito/legacy/HelloEndpoint.java b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/main/java/org/kie/kogito/legacy/HelloEndpoint.java new file mode 100644 index 0000000000..ef9c200cca --- /dev/null +++ b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/main/java/org/kie/kogito/legacy/HelloEndpoint.java @@ -0,0 +1,48 @@ +/* + * 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. + */ +package org.kie.kogito.legacy; + +import org.kie.api.runtime.KieRuntimeBuilder; +import org.kie.api.runtime.KieSession; + +import jakarta.inject.Inject; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.core.MediaType; + +@Path("/find-approved") +public class HelloEndpoint { + + @Inject + KieRuntimeBuilder kieRuntimeBuilder; + + @POST() + @Produces(MediaType.APPLICATION_JSON) + @Consumes(MediaType.APPLICATION_JSON) + public Hello executeQuery(Hello hello) { + KieSession session = kieRuntimeBuilder.newKieSession(); + + session.insert(hello); + session.fireAllRules(); + + return hello; + } +} diff --git a/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/main/resources/META-INF/kmodule.xml b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/main/resources/META-INF/kmodule.xml new file mode 100644 index 0000000000..31b0987760 --- /dev/null +++ b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/main/resources/META-INF/kmodule.xml @@ -0,0 +1,19 @@ + + \ No newline at end of file diff --git a/kogito-quarkus-examples/process-monitoring-quarkus/Dockerfile b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/main/resources/application.properties similarity index 64% rename from kogito-quarkus-examples/process-monitoring-quarkus/Dockerfile rename to kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/main/resources/application.properties index 6bff9a5109..a76c2a39bb 100644 --- a/kogito-quarkus-examples/process-monitoring-quarkus/Dockerfile +++ b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/main/resources/application.properties @@ -17,15 +17,7 @@ # under the License. # -FROM quay.io/kiegroup/kogito-runtime-jvm:latest +# Packaging +# quarkus.package.type=fast-jar -ENV RUNTIME_TYPE quarkus - -COPY target/quarkus-app/lib/ $KOGITO_HOME/bin/lib/ -COPY target/quarkus-app/*.jar $KOGITO_HOME/bin -COPY target/quarkus-app/app/ $KOGITO_HOME/bin/app/ -COPY target/quarkus-app/quarkus/ $KOGITO_HOME/bin/quarkus/ - -# For the legacy quarkus application jar use the commands below -# COPY target/*-runner.jar $KOGITO_HOME/bin -# COPY target/lib $KOGITO_HOME/bin/lib +quarkus.swagger-ui.always-include=true \ No newline at end of file diff --git a/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/main/resources/org/kie/kogito/legacy/HelloRule.drl b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/main/resources/org/kie/kogito/legacy/HelloRule.drl new file mode 100644 index 0000000000..af997ef75b --- /dev/null +++ b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/main/resources/org/kie/kogito/legacy/HelloRule.drl @@ -0,0 +1,35 @@ +/* + * 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. + */ +package org.kie.kogito.legacy; + +import org.kie.kogito.legacy.Hello; + +rule HelloApprove when + $l: Hello( greeting.equals("foo") ) +then + System.out.println("HelloApprove"); + modify($l) { setApproved(true) }; +end + +rule HelloDeny when + $l: Hello( greeting != "foo" ) +then + System.out.println("HelloDeny"); + modify($l) { setApproved(false) }; +end \ No newline at end of file diff --git a/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/test/java/org/kie/kogito/legacy/NativeRestQueryTestIT.java b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/test/java/org/kie/kogito/legacy/NativeRestQueryTestIT.java new file mode 100644 index 0000000000..fa549686f3 --- /dev/null +++ b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/test/java/org/kie/kogito/legacy/NativeRestQueryTestIT.java @@ -0,0 +1,27 @@ +/* + * 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. + */ +package org.kie.kogito.legacy; + +import io.quarkus.test.junit.QuarkusIntegrationTest; + +@QuarkusIntegrationTest +public class NativeRestQueryTestIT extends RestQueryTest { + + // Execute the same tests but in native mode. +} \ No newline at end of file diff --git a/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/test/java/org/kie/kogito/legacy/RestQueryTest.java b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/test/java/org/kie/kogito/legacy/RestQueryTest.java new file mode 100644 index 0000000000..d77ae64504 --- /dev/null +++ b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/test/java/org/kie/kogito/legacy/RestQueryTest.java @@ -0,0 +1,89 @@ +/* + * 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. + */ +package org.kie.kogito.legacy; + +import org.junit.jupiter.api.Test; + +import io.quarkus.test.junit.QuarkusTest; +import io.restassured.http.ContentType; +import io.restassured.response.Response; +import io.restassured.response.ResponseBody; +import io.restassured.response.ValidatableResponse; + +import static io.restassured.RestAssured.given; +import static org.hamcrest.Matchers.is; + +@QuarkusTest +public class RestQueryTest { + + private static final String JSON_APPROVED_PAYLOAD = + "{\n" + + " \"approved\":false,\n" + + " \"greeting\":\"foo\"\n" + + "}"; + private static final String JSON_DENIED_PAYLOAD = + "{\n" + + " \"approved\":false,\n" + + " \"greeting\":\"bar\"\n" + + "}"; + + @Test + public void testApproved() { + Response response = given() + .body(JSON_APPROVED_PAYLOAD) + .contentType(ContentType.JSON) + .when() + .post("/find-approved"); + + ResponseBody body = response.getBody(); + + // To check for sub string presence get the Response body as a String. + // Do a String.contains + String bodyAsString = body.asString(); + System.out.println(bodyAsString); + + ValidatableResponse validatableResponse = response + .then() + .statusCode(200); + validatableResponse + .body("approved", is(true)); + } + + @Test + public void testDenied() { + Response response = given() + .body(JSON_DENIED_PAYLOAD) + .contentType(ContentType.JSON) + .when() + .post("/find-approved"); + + ResponseBody body = response.getBody(); + + // To check for sub string presence get the Response body as a String. + // Do a String.contains + String bodyAsString = body.asString(); + System.out.println(bodyAsString); + + ValidatableResponse validatableResponse = response + .then() + .statusCode(200); + validatableResponse + .body("approved", is(false)); + } +} diff --git a/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/test/java/testscenario/ScenarioJunitActivatorTest.java b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/test/java/testscenario/ScenarioJunitActivatorTest.java new file mode 100644 index 0000000000..57d2ebc6cf --- /dev/null +++ b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/test/java/testscenario/ScenarioJunitActivatorTest.java @@ -0,0 +1,29 @@ +/* + * 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. + */ +package testscenario; + +import io.quarkus.test.junit.QuarkusTest; + +/** + * Do not remove this file + */ +@QuarkusTest +@org.junit.runner.RunWith(org.drools.scenariosimulation.backend.runner.ScenarioJunitActivator.class) +public class ScenarioJunitActivatorTest { +} \ No newline at end of file diff --git a/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/test/resources/application.properties b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/test/resources/application.properties new file mode 100644 index 0000000000..0841afd173 --- /dev/null +++ b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/test/resources/application.properties @@ -0,0 +1,25 @@ +# +# 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. +# + +# Quarkus +quarkus.http.test-port=0 + +quarkus.log.level=INFO +quarkus.log.category."org.kie.kogito".level=DEBUG +quarkus.log.category."org.drools".level=DEBUG \ No newline at end of file diff --git a/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/test/resources/org/kie/kogito/legacy/HelloScesim.scesim b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/test/resources/org/kie/kogito/legacy/HelloScesim.scesim new file mode 100644 index 0000000000..ba452b174f --- /dev/null +++ b/kogito-quarkus-examples/rules-legacy-scesim-quarkus-example/src/test/resources/org/kie/kogito/legacy/HelloScesim.scesim @@ -0,0 +1,292 @@ + + + + + + + + + + Index + OTHER + + + # + java.lang.Integer + + java.lang.Integer + # + NOT_EXPRESSION + 70.0 + + + + + Description + OTHER + + + Scenario description + java.lang.String + + java.lang.String + Scenario description + NOT_EXPRESSION + 300.0 + + + + + Hello + + + greeting + + + + 1|1 + GIVEN + + + 1|1 + org.kie.kogito.legacy.Hello + + java.lang.String + Hello + greeting + NOT_EXPRESSION + 337.66666666666663 + + + + + Hello + + + greeting + + + + 1|2 + EXPECT + + + 1|1 + org.kie.kogito.legacy.Hello + + java.lang.String + Hello + greeting + NOT_EXPRESSION + 337.66666666666663 + + + + + Hello + + + approved + + + + 1715763614877 + EXPECT + + + 1|1 + org.kie.kogito.legacy.Hello + + java.lang.Boolean + Hello + approved + NOT_EXPRESSION + 337.66666666666663 + + + + + + + + + Scenario description + java.lang.String + + + Description + OTHER + + Approved + + + + # + java.lang.Integer + + + Index + OTHER + + 1 + + + + 1|1 + org.kie.kogito.legacy.Hello + + + 1|1 + GIVEN + + foo + + + + 1|1 + org.kie.kogito.legacy.Hello + + + 1|2 + EXPECT + + foo + + + + 1|1 + org.kie.kogito.legacy.Hello + + + 1715763614877 + EXPECT + + true + + + + + + + + Scenario description + java.lang.String + + + Description + OTHER + + Denied + + + + # + java.lang.Integer + + + Index + OTHER + + 2 + + + + 1|1 + org.kie.kogito.legacy.Hello + + + 1|1 + GIVEN + + bar + + + + 1|1 + org.kie.kogito.legacy.Hello + + + 1|2 + EXPECT + + bar + + + + 1|1 + org.kie.kogito.legacy.Hello + + + 1715763614877 + EXPECT + + false + + + + + + + + + + + + 1|1 + GIVEN + + + Empty + java.lang.Void + + java.lang.Void + INSTANCE 1 + PROPERTY 1 + NOT_EXPRESSION + 114.0 + + + + + + + + + Empty + java.lang.Void + + + 1|1 + GIVEN + + + + + + + + RULE + false + false + + + + + \ No newline at end of file diff --git a/kogito-springboot-examples/dmn-pmml-springboot-example/src/test/resources/KiePMMLRegressionTest.scesim b/kogito-springboot-examples/dmn-pmml-springboot-example/src/test/resources/KiePMMLRegressionTest.scesim index ce32e9a1d0..f394b4fb2a 100644 --- a/kogito-springboot-examples/dmn-pmml-springboot-example/src/test/resources/KiePMMLRegressionTest.scesim +++ b/kogito-springboot-examples/dmn-pmml-springboot-example/src/test/resources/KiePMMLRegressionTest.scesim @@ -440,7 +440,7 @@ - src/main/resources/KiePMMLRegression.dmn + ../../main/resources/KiePMMLRegression.dmn DMN https://kiegroup.org/dmn/_51A1FD67-8A67-4332-9889-B718BE8B7456 TestRegressionDMN diff --git a/kogito-springboot-examples/dmn-springboot-example/src/test/resources/TrafficViolationTest.scesim b/kogito-springboot-examples/dmn-springboot-example/src/test/resources/TrafficViolationTest.scesim index ff5d6a2b3e..3a9a5d98f5 100644 --- a/kogito-springboot-examples/dmn-springboot-example/src/test/resources/TrafficViolationTest.scesim +++ b/kogito-springboot-examples/dmn-springboot-example/src/test/resources/TrafficViolationTest.scesim @@ -753,7 +753,7 @@ - src/main/resources/Traffic Violation.dmn + ../../main/resources/Traffic Violation.dmn DMN https://github.com/kiegroup/drools/kie-dmn/_A4BCA8B8-CF08-433F-93B2-A2598F19ECFF Traffic Violation diff --git a/kogito-springboot-examples/pom.xml b/kogito-springboot-examples/pom.xml index 7755fbd52e..3becc1edd0 100644 --- a/kogito-springboot-examples/pom.xml +++ b/kogito-springboot-examples/pom.xml @@ -88,6 +88,7 @@ process-usertasks-with-security-oidc-springboot process-usertasks-with-security-springboot rules-legacy-springboot-example + rules-legacy-scesim-springboot-example ruleunit-event-driven-springboot ruleunit-springboot-example diff --git a/kogito-springboot-examples/process-kafka-multi-springboot/README.md b/kogito-springboot-examples/process-kafka-multi-springboot/README.md index 0d2adfcbc8..a9272de1a7 100644 --- a/kogito-springboot-examples/process-kafka-multi-springboot/README.md +++ b/kogito-springboot-examples/process-kafka-multi-springboot/README.md @@ -137,11 +137,11 @@ Content (cloud event format) ```json { - "specversion": "0.3", + "specversion": "1.0", "id": "21627e26-31eb-43e7-8343-92a696fd96b1", "source": "", - "type": "travellers", - "time": "2022-02-24T13:25:16+0000", + "type": "travellers", + "time": "2022-02-24T13:25:16Z", "data": { "firstName" : "Jan", "lastName" : "Kowalski", @@ -153,7 +153,7 @@ Content (cloud event format) One liner ```json -{"specversion": "0.3","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16+0000","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}} +{"specversion": "1.0","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}} ``` this will then trigger the successful processing of the traveller and put another message on `processedtravellers` topic. @@ -169,11 +169,11 @@ With the following content (Cloud Event Format) ```json { - "specversion": "0.3", + "specversion": "1.0", "id": "31627e26-31eb-43e7-8343-92a696fd96b1", "source": "", "type": "travellers", - "time": "2022-02-24T13:25:16+0000", + "time": "2022-02-24T13:25:16Z", "data": { "firstName" : "John", "lastName" : "Doe", @@ -186,7 +186,7 @@ With the following content (Cloud Event Format) One Liner ```json -{"specversion": "0.3","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16+0000","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}} +{"specversion": "1.0","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}} ``` this will result in message being send to `cancelledtravelers` topic. diff --git a/kogito-springboot-examples/process-kafka-quickstart-springboot/README.md b/kogito-springboot-examples/process-kafka-quickstart-springboot/README.md index 576a919211..894885e0f4 100644 --- a/kogito-springboot-examples/process-kafka-quickstart-springboot/README.md +++ b/kogito-springboot-examples/process-kafka-quickstart-springboot/README.md @@ -130,11 +130,11 @@ Content (cloud event format) ```json { - "specversion": "0.3", + "specversion": "1.0", "id": "21627e26-31eb-43e7-8343-92a696fd96b1", "source": "", "type": "travellers", - "time": "2022-02-24T13:25:16+0000", + "time": "2022-02-24T13:25:16Z", "data": { "firstName" : "Jan", "lastName" : "Kowalski", @@ -146,7 +146,7 @@ Content (cloud event format) One liner ```json -{"specversion": "0.3","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16+0000","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}} +{"specversion": "1.0","id": "21627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "Jan", "lastName" : "Kowalski", "email" : "jan.kowalski@example.com", "nationality" : "Polish"}} ``` this will then trigger the successful processing of the traveller and put another message on `processedtravellers` topic. @@ -162,11 +162,11 @@ With the following content (Cloud Event Format) ```json { - "specversion": "0.3", + "specversion": "1.0", "id": "31627e26-31eb-43e7-8343-92a696fd96b1", "source": "", "type": "travellers", - "time": "2022-02-24T13:25:16+0000", + "time": "2022-02-24T13:25:16Z", "data": { "firstName" : "John", "lastName" : "Doe", @@ -179,7 +179,7 @@ With the following content (Cloud Event Format) One Liner ```json -{"specversion": "0.3","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16+0000","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}} +{"specversion": "1.0","id": "31627e26-31eb-43e7-8343-92a696fd96b1","source": "","type": "travellers", "time": "2022-02-24T13:25:16Z","data": { "firstName" : "John", "lastName" : "Doe", "email" : "john.doe@example.com", "nationality" : "American"}} ``` this will not result in message being send to `processedtravelers` topic. diff --git a/kogito-springboot-examples/rules-legacy-scesim-springboot-example/README.md b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/README.md new file mode 100644 index 0000000000..1d3b145fa5 --- /dev/null +++ b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/README.md @@ -0,0 +1,107 @@ + +# RuleUnit + Spring Boot + Test Scenario example + +## Description + +A simple rule service to validate `Hello` fact and testing it using Scenario Simulation. + +An injectable KieRuntimeBuilder is generated, so you can create Drools v7 KieBase and KieSession out of it. + +## Installing and Running + +### Prerequisites + +You will need: + - Java 11+ installed + - Environment variable JAVA_HOME set accordingly + - Maven 3.8.6+ installed + +### Compile and Run + +```sh +mvn clean compile spring-boot:run +``` + +### Package and Run + +```sh +mvn clean package +java -jar target/ruleunit-springboot-example.jar +``` + +## 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/v3/api-docs) - 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. + +## Example Usage + +Once the service is up and running, you can use the following examples to interact with the service. + +### POST /find-approved + +Returns approved Hello from the given fact: + +```sh +curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"approved":false, "greeting":"foo"}' http://localhost:8080/find-approved +``` +or on windows + +```sh +curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d "{\"approved\":false, \"greeting\":\"foo\"}" http://localhost:8080/find-approved +``` + +As response the modified Hello is returned. + +Example response: + +```json +{"greeting":"foo","approved":true} +``` + +Returns denied Hello from the given fact: + +```sh +curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"approved":false, "greeting":"bar"}' http://localhost:8080/find-approved +``` +or on windows + +```sh +curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d "{\"approved\":false, \"greeting\":\"bar\"}" http://localhost:8080/find-approved +``` + +As response the modified Hello is returned. + +Example response: + +```json +{"greeting":"bar","approved":false} +``` +# Test Scenario usage + +Test Scenario + rules project created inside Business central should work, with the following requirements: +1. use the pom as defined in the current project +2. set the `kogito.sources.keep` variable to `true` + +## Caveat +Requires `org.drools:drools-xml-support` dependency +For the moment being, "globals" are unsupported \ No newline at end of file diff --git a/kogito-springboot-examples/rules-legacy-scesim-springboot-example/pom.xml b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/pom.xml new file mode 100644 index 0000000000..3141269de3 --- /dev/null +++ b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/pom.xml @@ -0,0 +1,116 @@ + + + + 4.0.0 + + + org.kie.kogito.examples + kogito-springboot-examples + 999-SNAPSHOT + + rules-legacy-scesim-springboot-example + Kogito Example :: Rules Legacy API HELLO - Spring Boot :: Test Scenario + + + 999-SNAPSHOT + 999-SNAPSHOT + true + + + + + + org.kie.kogito + kogito-spring-boot-bom + ${kogito.bom.version} + pom + import + + + org.drools + drools-xml-support + ${version.org.kie.kogito} + test + + + + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.drools + drools-rules-spring-boot-starter + + + + + org.springframework.boot + spring-boot-starter-test + test + + + io.rest-assured + rest-assured + test + + + + org.kie.kogito + kogito-scenario-simulation + test + + + org.drools + drools-xml-support + test + + + + + ${project.artifactId} + + + org.kie.kogito + kogito-maven-plugin + ${version.org.kie.kogito} + true + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + diff --git a/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/java/org/kie/kogito/legacy/Hello.java b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/java/org/kie/kogito/legacy/Hello.java new file mode 100644 index 0000000000..96fa6be094 --- /dev/null +++ b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/java/org/kie/kogito/legacy/Hello.java @@ -0,0 +1,55 @@ +/* + * 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. + */ +package org.kie.kogito.legacy; + +public class Hello implements java.io.Serializable { + + static final long serialVersionUID = 1L; + + @org.kie.api.definition.type.Label("Greeting") + private java.lang.String greeting; + + @org.kie.api.definition.type.Label(value = "Approved") + private java.lang.Boolean approved; + + public Hello() { + } + + public java.lang.String getGreeting() { + return this.greeting; + } + + public void setGreeting(java.lang.String greeting) { + this.greeting = greeting; + } + + public java.lang.Boolean getApproved() { + return this.approved; + } + + public void setApproved(java.lang.Boolean approved) { + this.approved = approved; + } + + public Hello(java.lang.String greeting, java.lang.Boolean approved) { + this.greeting = greeting; + this.approved = approved; + } + +} \ No newline at end of file diff --git a/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/java/org/kie/kogito/legacy/HelloEndpoint.java b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/java/org/kie/kogito/legacy/HelloEndpoint.java new file mode 100644 index 0000000000..d46dadb289 --- /dev/null +++ b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/java/org/kie/kogito/legacy/HelloEndpoint.java @@ -0,0 +1,48 @@ +/* + * 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. + */ +package org.kie.kogito.legacy; + +import org.kie.api.runtime.KieRuntimeBuilder; +import org.kie.api.runtime.KieSession; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("/find-approved") +public class HelloEndpoint { + + private final KieRuntimeBuilder kieRuntimeBuilder; + + public HelloEndpoint(KieRuntimeBuilder kieRuntimeBuilder) { + this.kieRuntimeBuilder = kieRuntimeBuilder; + } + + @PostMapping(produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE) + public Hello executeQuery(@RequestBody(required = true) Hello hello) { + KieSession session = kieRuntimeBuilder.newKieSession(); + + session.insert(hello); + session.fireAllRules(); + + return hello; + } +} diff --git a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/java/org/kie/kogito/hr/Offer.java b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/java/org/kie/kogito/legacy/KogitoSpringbootApplication.java similarity index 65% rename from kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/java/org/kie/kogito/hr/Offer.java rename to kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/java/org/kie/kogito/legacy/KogitoSpringbootApplication.java index a377b480aa..d8e30b0e1f 100644 --- a/kogito-quarkus-examples/process-usertasks-timer-data-index-persistence-addon-quarkus/src/main/java/org/kie/kogito/hr/Offer.java +++ b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/java/org/kie/kogito/legacy/KogitoSpringbootApplication.java @@ -16,31 +16,15 @@ * specific language governing permissions and limitations * under the License. */ +package org.kie.kogito.legacy; -package org.kie.kogito.hr; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; -public class Offer { +@SpringBootApplication(scanBasePackages = { "org.kie.kogito.**", "org.drools.**" }) +public class KogitoSpringbootApplication { - private String category; - - private Integer salary; - - public Offer() { - } - - public String getCategory() { - return category; - } - - public void setCategory(String category) { - this.category = category; - } - - public Integer getSalary() { - return salary; - } - - public void setSalary(Integer salary) { - this.salary = salary; + public static void main(String[] args) { + SpringApplication.run(KogitoSpringbootApplication.class, args); } } diff --git a/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/resources/META-INF/kmodule.xml b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/resources/META-INF/kmodule.xml new file mode 100644 index 0000000000..9fe3cd73e0 --- /dev/null +++ b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/resources/META-INF/kmodule.xml @@ -0,0 +1,19 @@ + + \ No newline at end of file diff --git a/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/resources/application.properties b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/resources/application.properties new file mode 100644 index 0000000000..4e8da841ca --- /dev/null +++ b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/resources/application.properties @@ -0,0 +1,20 @@ +# +# 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. +# + +server.address=0.0.0.0 \ No newline at end of file diff --git a/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/resources/org/kie/kogito/legacy/HelloRule.drl b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/resources/org/kie/kogito/legacy/HelloRule.drl new file mode 100644 index 0000000000..af997ef75b --- /dev/null +++ b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/main/resources/org/kie/kogito/legacy/HelloRule.drl @@ -0,0 +1,35 @@ +/* + * 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. + */ +package org.kie.kogito.legacy; + +import org.kie.kogito.legacy.Hello; + +rule HelloApprove when + $l: Hello( greeting.equals("foo") ) +then + System.out.println("HelloApprove"); + modify($l) { setApproved(true) }; +end + +rule HelloDeny when + $l: Hello( greeting != "foo" ) +then + System.out.println("HelloDeny"); + modify($l) { setApproved(false) }; +end \ No newline at end of file diff --git a/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/test/java/org/kie/kogito/legacy/RestQueryTest.java b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/test/java/org/kie/kogito/legacy/RestQueryTest.java new file mode 100644 index 0000000000..fd590db5ea --- /dev/null +++ b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/test/java/org/kie/kogito/legacy/RestQueryTest.java @@ -0,0 +1,79 @@ +/* + * 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. + */ +package org.kie.kogito.legacy; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.boot.test.web.server.LocalServerPort; +import org.springframework.test.annotation.DirtiesContext; + +import io.restassured.RestAssured; +import io.restassured.http.ContentType; + +import static io.restassured.RestAssured.given; +import static org.hamcrest.core.Is.is; + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = KogitoSpringbootApplication.class) +@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) +public class RestQueryTest { + + @LocalServerPort + private int port; + + @BeforeEach + public void setUp() { + RestAssured.port = port; + } + + private static final String JSON_APPROVED_PAYLOAD = + "{\n" + + " \"approved\":false,\n" + + " \"greeting\":\"foo\"\n" + + "}"; + private static final String JSON_DENIED_PAYLOAD = + "{\n" + + " \"approved\":false,\n" + + " \"greeting\":\"bar\"\n" + + "}"; + + @Test + public void testApproved() { + given() + .body(JSON_APPROVED_PAYLOAD) + .contentType(ContentType.JSON) + .when() + .post("/find-approved") + .then() + .statusCode(200) + .body("approved", is(true)); + } + + @Test + public void testDenied() { + given() + .body(JSON_DENIED_PAYLOAD) + .contentType(ContentType.JSON) + .when() + .post("/find-approved") + .then() + .statusCode(200) + .body("approved", is(false)); + } +} diff --git a/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/test/java/testscenario/ScenarioJunitActivatorTest.java b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/test/java/testscenario/ScenarioJunitActivatorTest.java new file mode 100644 index 0000000000..13bd96d819 --- /dev/null +++ b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/test/java/testscenario/ScenarioJunitActivatorTest.java @@ -0,0 +1,26 @@ +/* + * 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. + */ +package testscenario; + +/** + * Do not remove this file + */ +@org.junit.runner.RunWith(org.drools.scenariosimulation.backend.runner.ScenarioJunitActivator.class) +public class ScenarioJunitActivatorTest { +} \ No newline at end of file diff --git a/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/test/resources/HelloScesim.scesim b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/test/resources/HelloScesim.scesim new file mode 100644 index 0000000000..ba452b174f --- /dev/null +++ b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/test/resources/HelloScesim.scesim @@ -0,0 +1,292 @@ + + + + + + + + + + Index + OTHER + + + # + java.lang.Integer + + java.lang.Integer + # + NOT_EXPRESSION + 70.0 + + + + + Description + OTHER + + + Scenario description + java.lang.String + + java.lang.String + Scenario description + NOT_EXPRESSION + 300.0 + + + + + Hello + + + greeting + + + + 1|1 + GIVEN + + + 1|1 + org.kie.kogito.legacy.Hello + + java.lang.String + Hello + greeting + NOT_EXPRESSION + 337.66666666666663 + + + + + Hello + + + greeting + + + + 1|2 + EXPECT + + + 1|1 + org.kie.kogito.legacy.Hello + + java.lang.String + Hello + greeting + NOT_EXPRESSION + 337.66666666666663 + + + + + Hello + + + approved + + + + 1715763614877 + EXPECT + + + 1|1 + org.kie.kogito.legacy.Hello + + java.lang.Boolean + Hello + approved + NOT_EXPRESSION + 337.66666666666663 + + + + + + + + + Scenario description + java.lang.String + + + Description + OTHER + + Approved + + + + # + java.lang.Integer + + + Index + OTHER + + 1 + + + + 1|1 + org.kie.kogito.legacy.Hello + + + 1|1 + GIVEN + + foo + + + + 1|1 + org.kie.kogito.legacy.Hello + + + 1|2 + EXPECT + + foo + + + + 1|1 + org.kie.kogito.legacy.Hello + + + 1715763614877 + EXPECT + + true + + + + + + + + Scenario description + java.lang.String + + + Description + OTHER + + Denied + + + + # + java.lang.Integer + + + Index + OTHER + + 2 + + + + 1|1 + org.kie.kogito.legacy.Hello + + + 1|1 + GIVEN + + bar + + + + 1|1 + org.kie.kogito.legacy.Hello + + + 1|2 + EXPECT + + bar + + + + 1|1 + org.kie.kogito.legacy.Hello + + + 1715763614877 + EXPECT + + false + + + + + + + + + + + + 1|1 + GIVEN + + + Empty + java.lang.Void + + java.lang.Void + INSTANCE 1 + PROPERTY 1 + NOT_EXPRESSION + 114.0 + + + + + + + + + Empty + java.lang.Void + + + 1|1 + GIVEN + + + + + + + + RULE + false + false + + + + + \ No newline at end of file diff --git a/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/test/resources/logback-test.xml b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/test/resources/logback-test.xml new file mode 100644 index 0000000000..4ca6ba0f5e --- /dev/null +++ b/kogito-springboot-examples/rules-legacy-scesim-springboot-example/src/test/resources/logback-test.xml @@ -0,0 +1,37 @@ + + + + + + + %date{HH:mm:ss.SSS} [%thread] %-5level %class{36}.%method:%line - %msg%n + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 6319e51697..4f796475d7 100755 --- a/pom.xml +++ b/pom.xml @@ -41,9 +41,10 @@ http://kogito.kie.org 2019 - JBoss by Red Hat - http://www.jboss.org/ + The Apache Software Foundation + https://apache.org/ + Apache Software License, Version 2.0 @@ -52,6 +53,46 @@ + + scm:git:https://github.com/apache/incubator-kie-kogito-examples.git + scm:git:https://github.com/apache/incubator-kie-kogito-examples.git + https://github.com/apache/incubator-kie-kogito-examples + + + + + The Apache KIE Team + dev@kie.apache.org + https://kie.apache.org + Apache Software Foundation + http://apache.org/ + + + + + + Development List + dev-subscribe@kie.apache.org + dev-unsubscribe@kie.apache.org + dev@kie.apache.org + https://lists.apache.org/list.html?dev@kie.apache.org + + + User List + users-subscribe@kie.apache.org + users-unsubscribe@kie.apache.org + users@kie.apache.org + https://lists.apache.org/list.html?users@kie.apache.org + + + Commits List + commits-subscribe@kie.apache.org + commits-unsubscribe@kie.apache.org + commits@kie.apache.org + https://lists.apache.org/list.html?commits@kie.apache.org + + + UTF-8 @@ -77,80 +118,18 @@ 3.4.1 - - - - apache-release-staging-repository - Apache Release Staging Repository - https://repository.apache.org/service/local/staging/deploy/maven2 - - - apache-snapshots-repository - Apache Snapshot Repository - https://repository.apache.org/content/repositories/snapshots/ - - - - + - apache-public-repository-group - Apache Public Repository Group - https://repository.apache.org/content/groups/public/ - default - true - never + false - - true - daily - + apache.snapshots + Apache Snapshot Repository + https://repository.apache.org/snapshots - - - - central - Central Repository - https://repo.maven.apache.org/maven2 - default - - false - - - - apache-public-repository-group - Apache Public Repository Group - https://repository.apache.org/content/groups/public/ - - true - - - true - - - - - - scm:git:https://github.com/apache/incubator-kie-kogito-examples.git - scm:git:git@github.com:apache/incubator-kie-kogito-examples.git - https://github.com/apache/incubator-kie-kogito-examples - - - - - All developers are listed in the KIE GitHub organization - https://github.com/orgs/kiegroup/people - - - default @@ -271,13 +250,6 @@
- - maven-deploy-plugin - ${version.deploy.plugin} - - 10 - - maven-compiler-plugin ${version.compiler.plugin} diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/README.md b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/README.md index 7e62500bd7..d275cea648 100644 --- a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/README.md +++ b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/README.md @@ -7,9 +7,11 @@ Collection of artifacts to test SonataFlow Use Cases TP2. 1. Minikube installed We recommend that you start Minikube with the following parameters, note that the `registry` addon must be enabled. +Additionally, the ingress addon is also enabled facilitate data-index querying by using an Ingress. Note that the Ingress provided is just en example to expose the data-index graphiql. +This is not mandatory, and in production environments you must provide your own setup if needed, or even use an OpenShift route, etc. ```shell -minikube start --cpus 4 --memory 10240 --addons registry --addons metrics-server --insecure-registry "10.0.0.0/24" --insecure-registry "localhost:5000" +minikube start --cpus 4 --memory 10240 --addons registry --addons metrics-server --addons ingress --insecure-registry "10.0.0.0/24" --insecure-registry "localhost:5000" ``` To verify that the registry addon was property added you can execute this command: @@ -24,6 +26,15 @@ minikube addons list | grep registry | registry-creds | minikube | disabled | 3rd party (UPMC Enterprises) | ``` +To verify that the ingress addon was property added you can execute this command: + +```shell +minikube addons list | grep ingress +``` + +``` +| ingress | minikube | enabled ✅ | Kubernetes | +``` 2. kubectl installed @@ -62,17 +73,16 @@ kubectl create namespace data-index-usecase 2. Deploy the Data Index Service: ```shell -kubectl kustomize infra/dataindex | kubectl apply -f - -n data-index-usecase +kubectl kustomize platforms/data_index_as_platform_service | kubectl apply -f - -n data-index-usecase ``` ``` -configmap/dataindex-properties-hg9ff8bff5 created -secret/postgres-secrets-22tkgc2dt7 created -service/data-index-service-postgresql created -service/postgres created persistentvolumeclaim/postgres-pvc created -deployment.apps/data-index-service-postgresql created deployment.apps/postgres created +service/postgres created +sonataflowplatform.sonataflow.org/sonataflow-platform created +ingress.networking.k8s.io/data-index-service-ingress created +secret/postgres-secrets created ``` This will deploy a Data Index for you in the `data-index-usecase` namespace. (If you don't use a namespace the `default` is used instead) @@ -93,14 +103,15 @@ postgres-7f78499688-j6282 1/1 Running 0 To access the Data Index, using Minikube you can run: ```shell -minikube service data-index-service-postgresql --url -n data-index-usecase +minikube ip ``` Example output: ``` -http://192.168.49.2:30352 +192.168.49.2 ``` -The output is the Data Index URL, so you can access the GraphiQL UI by using a url like this http://192.168.49.2:30352/grpahiql/ (host and por might be different in your installation.) + +Use the returned ip to access the data-index-service GraphiQL by using the Ingress with a url like this http://192.168.49.2/graphiql/ (that ip might be different in your installation.) For more information about Data Index and this deployment see [Data Index standalone service](https://sonataflow.org/serverlessworkflow/latest/data-index/data-index-service.html) in SonataFlow guides. @@ -130,19 +141,18 @@ kubectl create namespace usecase1 ``` 2. Deploy the Data Index Service: + ```shell -kubectl kustomize infra/dataindex | kubectl apply -f - -n usecase1 +kubectl kustomize platforms/data_index_as_platform_service | kubectl apply -f - -n usecase1 ``` ``` -configmap/dataindex-properties-hg9ff8bff5 created -secret/postgres-secrets-22tkgc2dt7 created -service/data-index-service-postgresql created -service/postgres created persistentvolumeclaim/postgres-pvc created -deployment.apps/data-index-service-postgresql created deployment.apps/postgres created - +service/postgres created +sonataflowplatform.sonataflow.org/sonataflow-platform created +ingress.networking.k8s.io/data-index-service-ingress created +secret/postgres-secrets created ``` Give some time for the data index to start, you can check that it's running by executing. @@ -164,7 +174,6 @@ postgres-7f78499688-lc8n6 1/1 Running 0 ``` ``` -configmap/greeting-props created sonataflow.sonataflow.org/greeting created ``` @@ -227,19 +236,18 @@ kubectl create namespace usecase2 ``` 2. Deploy the Data Index Service: +3. ```shell -kubectl kustomize infra/dataindex | kubectl apply -f - -n usecase2 +kubectl kustomize platforms/data_index_as_platform_service | kubectl apply -f - -n usecase2 ``` ``` -configmap/dataindex-properties-hg9ff8bff5 created -secret/postgres-secrets-22tkgc2dt7 created -service/data-index-service-postgresql created -service/postgres created persistentvolumeclaim/postgres-pvc created -deployment.apps/data-index-service-postgresql created deployment.apps/postgres created - +service/postgres created +sonataflowplatform.sonataflow.org/sonataflow-platform created +ingress.networking.k8s.io/data-index-service-ingress created +secret/postgres-secrets created ``` Give some time for the data index to start, you can check that it's running by executing. @@ -261,8 +269,6 @@ postgres-7f78499688-lc8n6 1/1 Running 0 ``` ``` -configmap/greeting-props created -configmap/helloworld-props created sonataflow.sonataflow.org/greeting created sonataflow.sonataflow.org/helloworld created ``` @@ -325,12 +331,12 @@ This procedure apply to all use cases with that deploys the Data Index Service. 1. Get the Data Index Url: ```shell -minikube service data-index-service-postgresql --url -n my_usecase +minikube ip ``` 2. Open the GrahiqlUI -Using the url returned in 1, open a browser window in the following url http://192.168.49.2:32409/graphiql/, note that IP and port will be different in your installation, and don't forget to add the last slash "/" to the url, otherwise the GraphiqlUI won't be opened. +Using the ip returned in 1, open a browser window in the following url http://192.168.49.2/graphiql/, note that IP will be different in your installation, and don't forget to add the last slash "/" to the url, otherwise the GraphiqlUI won't be opened. To see the process instances information you can execute this query: diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/02-dataindex.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/02-dataindex.yaml deleted file mode 100644 index 6e27336706..0000000000 --- a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/02-dataindex.yaml +++ /dev/null @@ -1,92 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app.kubernetes.io/name: data-index-service-postgresql - name: data-index-service-postgresql -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: data-index-service-postgresql - template: - metadata: - labels: - app.kubernetes.io/name: data-index-service-postgresql - spec: - containers: - - name: data-index-service-postgresql - image: quay.io/kiegroup/kogito-data-index-postgresql:latest - imagePullPolicy: Always - resources: - limits: - memory: "256Mi" - cpu: "500m" - ports: - - containerPort: 8080 - name: http - protocol: TCP - env: - - name: KOGITO_DATA_INDEX_QUARKUS_PROFILE - value: http-events-support - - name: KUBERNETES_NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - - name: QUARKUS_DATASOURCE_USERNAME - valueFrom: - secretKeyRef: - key: POSTGRES_USER - name: postgres-secrets - - name: QUARKUS_DATASOURCE_PASSWORD - valueFrom: - secretKeyRef: - key: POSTGRES_PASSWORD - name: postgres-secrets - volumeMounts: - - name: application-config - mountPath: "/home/kogito/config" - livenessProbe: - failureThreshold: 3 - httpGet: - path: /q/health/live - port: 8080 - scheme: HTTP - initialDelaySeconds: 0 - periodSeconds: 30 - successThreshold: 1 - timeoutSeconds: 10 - readinessProbe: - failureThreshold: 3 - httpGet: - path: /q/health/ready - port: 8080 - scheme: HTTP - initialDelaySeconds: 0 - periodSeconds: 30 - successThreshold: 1 - timeoutSeconds: 10 - volumes: - - name: application-config - configMap: - name: dataindex-properties - initContainers: - - name: init-postgres - image: registry.access.redhat.com/ubi9/ubi-minimal:latest - imagePullPolicy: IfNotPresent - command: ['sh', '-c', 'until (echo 1 > /dev/tcp/postgres.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local/5432) >/dev/null 2>&1; do echo "Waiting for postgres server"; sleep 3; done;'] ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app.kubernetes.io/name: data-index-service-postgresql - name: data-index-service-postgresql -spec: - ports: - - name: http - port: 80 - targetPort: 8080 - selector: - app.kubernetes.io/name: data-index-service-postgresql - type: NodePort \ No newline at end of file diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/application.properties b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/application.properties deleted file mode 100644 index ac88f78db8..0000000000 --- a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/application.properties +++ /dev/null @@ -1,10 +0,0 @@ -quarkus.http.port=8080 -quarkus.http.cors=true -quarkus.http.cors.origins=/.*/ - -quarkus.datasource.jdbc.url=jdbc:postgresql://postgres:5432/sonataflow?currentSchema=data-index-service -quarkus.hibernate-orm.database.generation=update -quarkus.flyway.migrate-at-start=true - -# Disable kafka client health check since the quarkus-http connector is being used instead. -quarkus.smallrye-health.check."io.quarkus.kafka.client.health.KafkaHealthCheck".enabled=false \ No newline at end of file diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/service_discovery/01-service-discovery-role.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/service_discovery/01-service-discovery-role.yaml deleted file mode 100644 index d337d25d30..0000000000 --- a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/service_discovery/01-service-discovery-role.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: service-discovery-role -rules: - - apiGroups: - - "" - resources: - - pods - - services - verbs: - - get - - list - - apiGroups: - - apps - resources: - - deployments - - statefulsets - verbs: - - get - - list - - apiGroups: - - networking.k8s.io - resources: - - ingresses - verbs: - - get - - list - # Knative - - apiGroups: - - serving.knative.dev - resources: - - services - verbs: - - get - - list diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/service_discovery/02-service-discovery-rolebinding.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/service_discovery/02-service-discovery-rolebinding.yaml deleted file mode 100644 index f96435a5f1..0000000000 --- a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/service_discovery/02-service-discovery-rolebinding.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: service-discovery-rolebinding -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: service-discovery-role -subjects: - - kind: ServiceAccount - name: default \ No newline at end of file diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/service_discovery/kustomization.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/service_discovery/kustomization.yaml deleted file mode 100644 index 13ad16a3e6..0000000000 --- a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/service_discovery/kustomization.yaml +++ /dev/null @@ -1,3 +0,0 @@ -resources: -- 01-service-discovery-role.yaml -- 02-service-discovery-rolebinding.yaml diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/01-postgres.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/platforms/data_index_as_platform_service/01-postgres.yaml similarity index 100% rename from serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/01-postgres.yaml rename to serverless-operator-examples/serverless-workflow-dataindex-use-cases/platforms/data_index_as_platform_service/01-postgres.yaml diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/platforms/data_index_as_platform_service/02-sonataflow_platform.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/platforms/data_index_as_platform_service/02-sonataflow_platform.yaml new file mode 100644 index 0000000000..4c9132ac89 --- /dev/null +++ b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/platforms/data_index_as_platform_service/02-sonataflow_platform.yaml @@ -0,0 +1,26 @@ +apiVersion: sonataflow.org/v1alpha08 +kind: SonataFlowPlatform +metadata: + name: sonataflow-platform +spec: + build: + config: + strategyOptions: + KanikoBuildCacheEnabled: "false" + services: + dataIndex: + enabled: true + persistence: + postgresql: + jdbcUrl: jdbc:postgresql://postgres:5432/sonataflow?currentSchema=data-index-service + secretRef: + name: postgres-secrets + userKey: POSTGRES_USER + passwordKey: POSTGRES_PASSWORD + podTemplate: + initContainers: + - name: init-postgres + image: registry.access.redhat.com/ubi9/ubi-minimal:latest + imagePullPolicy: IfNotPresent + command: [ 'sh', '-c', 'until (echo 1 > /dev/tcp/postgres.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local/5432) >/dev/null 2>&1; do echo "Waiting for postgres server"; sleep 3; done;' ] + diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/platforms/data_index_as_platform_service/03-data-index-service-ingress.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/platforms/data_index_as_platform_service/03-data-index-service-ingress.yaml new file mode 100644 index 0000000000..3083bbb096 --- /dev/null +++ b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/platforms/data_index_as_platform_service/03-data-index-service-ingress.yaml @@ -0,0 +1,17 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: data-index-service-ingress + annotations: + nginx.ingress.kubernetes.io/app-root: / +spec: + rules: + - http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: sonataflow-platform-data-index-service + port: + number: 80 \ No newline at end of file diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/kustomization.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/platforms/data_index_as_platform_service/kustomization.yaml similarity index 62% rename from serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/kustomization.yaml rename to serverless-operator-examples/serverless-workflow-dataindex-use-cases/platforms/data_index_as_platform_service/kustomization.yaml index d475d83f88..80f11e54d1 100644 --- a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/kustomization.yaml +++ b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/platforms/data_index_as_platform_service/kustomization.yaml @@ -1,6 +1,10 @@ resources: - 01-postgres.yaml -- 02-dataindex.yaml +- 02-sonataflow_platform.yaml +- 03-data-index-service-ingress.yaml + +generatorOptions: + disableNameSuffixHash: true secretGenerator: - name: postgres-secrets @@ -10,8 +14,5 @@ secretGenerator: - POSTGRES_DB=sonataflow - PGDATA=/var/lib/postgresql/data/mydata -configMapGenerator: - - name: dataindex-properties - files: - - application.properties - +sortOptions: + order: fifo diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/usecases/usecase1/kustomization.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/usecases/usecase1/kustomization.yaml index c88a2e06d7..cc0ad92026 100644 --- a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/usecases/usecase1/kustomization.yaml +++ b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/usecases/usecase1/kustomization.yaml @@ -1,3 +1,2 @@ resources: -- ../../infra/service_discovery - ../../workflows/sonataflow-greeting \ No newline at end of file diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/usecases/usecase2/kustomization.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/usecases/usecase2/kustomization.yaml index 6ea98cd8e5..0da35e0117 100644 --- a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/usecases/usecase2/kustomization.yaml +++ b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/usecases/usecase2/kustomization.yaml @@ -1,4 +1,3 @@ resources: -- ../../infra/service_discovery - ../../workflows/sonataflow-greeting - ../../workflows/sonataflow-helloworld diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-greeting/03-sonataflow_greeting.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-greeting/01-sonataflow_greeting.yaml similarity index 100% rename from serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-greeting/03-sonataflow_greeting.yaml rename to serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-greeting/01-sonataflow_greeting.yaml diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-greeting/02-configmap_greeting-props.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-greeting/02-configmap_greeting-props.yaml deleted file mode 100644 index bdc8cff3bb..0000000000 --- a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-greeting/02-configmap_greeting-props.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -data: - application.properties: | - # Data Index configuration - mp.messaging.outgoing.kogito-processinstances-events.url=http://data-index-service-postgresql/processes - - mp.messaging.outgoing.kogito-usertaskinstances-events.url=http://data-index-service-postgresql/tasks - - mp.messaging.outgoing.kogito-variables-events.url=http://data-index-service-postgresql/variables - - # Skip user tasks and variables events sending. - kogito.events.usertasks.enabled=false - kogito.events.variables.enabled=false - - quarkus.log.category."io.smallrye.reactive.messaging".level = DEBUG - quarkus.log.category."org.kie".level = DEBUG - quarkus.log.category."io.quarkus.reactivemessaging".level = DEBUG - quarkus.log.category."io.vertx".level = DEBUG -kind: ConfigMap -metadata: - labels: - app: greeting - name: greeting-props diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-greeting/kustomization.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-greeting/kustomization.yaml index 36b47a72e1..7825d2888c 100644 --- a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-greeting/kustomization.yaml +++ b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-greeting/kustomization.yaml @@ -1,3 +1,2 @@ resources: -- 02-configmap_greeting-props.yaml -- 03-sonataflow_greeting.yaml +- 01-sonataflow_greeting.yaml diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-helloworld/03-sonataflow_helloworld.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-helloworld/01-sonataflow_helloworld.yaml similarity index 100% rename from serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-helloworld/03-sonataflow_helloworld.yaml rename to serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-helloworld/01-sonataflow_helloworld.yaml diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-helloworld/02-configmap_helloworld-props.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-helloworld/02-configmap_helloworld-props.yaml deleted file mode 100644 index 5046c1ed91..0000000000 --- a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-helloworld/02-configmap_helloworld-props.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: v1 -data: - application.properties: | - # Data Index configuration - mp.messaging.outgoing.kogito-processinstances-events.url=http://data-index-service-postgresql/processes - - mp.messaging.outgoing.kogito-usertaskinstances-events.url=http://data-index-service-postgresql/tasks - - mp.messaging.outgoing.kogito-variables-events.url=http://data-index-service-postgresql/variables - - # Skip user tasks and variables events sending. - kogito.events.usertasks.enabled=false - kogito.events.variables.enabled=false - - quarkus.log.category."io.smallrye.reactive.messaging".level = DEBUG - quarkus.log.category."org.kie".level = DEBUG - quarkus.log.category."io.quarkus.reactivemessaging".level = DEBUG - quarkus.log.category."io.vertx".level = DEBUG -kind: ConfigMap -metadata: - labels: - app: helloworld - name: helloworld-props diff --git a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-helloworld/kustomization.yaml b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-helloworld/kustomization.yaml index 20cb06529e..a8e7e5c66e 100644 --- a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-helloworld/kustomization.yaml +++ b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-helloworld/kustomization.yaml @@ -1,3 +1,2 @@ resources: -- 02-configmap_helloworld-props.yaml -- 03-sonataflow_helloworld.yaml +- 01-sonataflow_helloworld.yaml diff --git a/serverless-workflow-examples/serverless-workflow-compensation-quarkus/pom.xml b/serverless-workflow-examples/serverless-workflow-compensation-quarkus/pom.xml index 3d033bd06c..48c0f89f81 100644 --- a/serverless-workflow-examples/serverless-workflow-compensation-quarkus/pom.xml +++ b/serverless-workflow-examples/serverless-workflow-compensation-quarkus/pom.xml @@ -47,7 +47,7 @@ 3.8.1 3.0.0-M7 17 - 0.1.3 + 0.2.2 diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregatorRoute.java b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregatorRoute.java index c58a40500d..14ca293698 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregatorRoute.java +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/java/org/acme/serverless/loanbroker/aggregator/QuotesAggregatorRoute.java @@ -54,7 +54,7 @@ public void configure() { .getTypeConverterRegistry() .addTypeConverter(CloudEvent.class, AggregationResponse.class, cloudEventsConverter); - + from("direct:aggregator") .routeId("quotes-aggregator") .aggregate(header(IntegrationConstants.KOGITO_FLOW_ID_HEADER), new QuotesAggregationStrategy()) diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/resources/application.properties b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/resources/application.properties index 4229056fd6..4d4ac24d33 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/resources/application.properties +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/src/main/resources/application.properties @@ -23,10 +23,13 @@ org.acme.serverless.loanbroker.aggregator.replyTo=${K_SINK:http://localhost:8080 quarkus.swagger-ui.always-include=true mp.openapi.extensions.smallrye.operationIdStrategy=METHOD +quarkus.kubernetes.name=loanbroker-aggregator +quarkus.kubernetes.deployment-target=kubernetes quarkus.kubernetes.deploy=false -quarkus.kubernetes.image-pull-policy=IfNotPresent +quarkus.kubernetes.image-pull-policy=if-not-present # profile to pack this example into a container, to use it execute activate the maven container profile, -Dcontainer -%container.quarkus.container-image.group=dev.local +%container.quarkus.container-image.registry=dev.local +%container.quarkus.container-image.group=${USER} %container.quarkus.container-image.name=loanbroker-aggregator %container.quarkus.container-image.build=true \ No newline at end of file diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/deploy.sh b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/deploy.sh index 5273539ea4..876af41cab 100755 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/deploy.sh +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/deploy.sh @@ -143,7 +143,7 @@ add_flow_url_to_ui() { expose_loanbroker_ui() { echo "Exposing UI, please run 'minikube tunnel -p knative' in a separate terminal" - kubectl expose deployment serverless-workflow-loanbroker-showcase-ui --name=loanbroker-ui-external --type=LoadBalancer --port=8080 -n ${NAMESPACE} + kubectl expose deployment loanbroker-ui --name=loanbroker-ui-external --type=LoadBalancer --port=8080 -n ${NAMESPACE} sleep 5 LOANBROKER_EXTERNAL_IP=$(kubectl get service loanbroker-ui-external -o=jsonpath --template="{.status.loadBalancer.ingress[0].ip}" -n loanbroker-example) echo "To access the loanbroker-example UI please use this url: http://$LOANBROKER_EXTERNAL_IP:8080" diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/kubernetes/kubernetes.yml b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/kubernetes/kubernetes.yml index 9b8f91c371..34fa981ec8 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/kubernetes/kubernetes.yml +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/kubernetes/kubernetes.yml @@ -232,6 +232,12 @@ metadata: namespace: loanbroker-example spec: template: + metadata: + annotations: + autoscaling.knative.dev/minScale: "1" + autoscaling.knative.dev/maxScale: "1" + labels: + app.kubernetes.io/name: event-display spec: containers: - # This corresponds to diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/main/kubernetes/knative.yml b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/main/kubernetes/knative.yml deleted file mode 100644 index eb699098c4..0000000000 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/main/kubernetes/knative.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: serving.knative.dev/v1 -kind: Service -metadata: - name: loanbroker-flow -spec: - template: - spec: - containers: - - name: loanbroker-flow - imagePullPolicy: IfNotPresent diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/main/resources/application.properties b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/main/resources/application.properties index 89219144b3..6f28b4ce8a 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/main/resources/application.properties +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/main/resources/application.properties @@ -17,36 +17,41 @@ # under the License. # -kogito.service.url=${KOGITO_SERVICE_CLUSTER_URL:http://localhost:8080} +kogito.service.url=${knative:services.v1.serving.knative.dev/loanbroker-example/loanbroker-flow} +%dev.kogito.service.url=http://localhost:8080 kogito.messaging.as-cloudevents=true kogito.addon.messaging.outgoing.cloudEventMode.kogito_outgoing_stream=structured -quarkus.http.cors.origins=* +quarkus.http.cors=true +quarkus.http.cors.origins=/.*/ quarkus.log.category."org.kie".level=DEBUG quarkus.log.category."org.kogito".level=DEBUG quarkus.log.category."org.acme".level=DEBUG quarkus.swagger-ui.always-include=true -quarkus.http.cors=true -quarkus.rest-client.credit_bureau_yaml.url=${CREDIT_BUREAU_URL:http://localhost:8181/} -quarkus.rest-client.aggregator_yaml.url=${AGGREGATOR_URL:http://localhost:8282/} + +# Use the Kogito service discovery mechanism to get the services url. +# For more information see: https://kiegroup.github.io/kogito-docs/serverlessworkflow/latest/cloud/kubernetes-service-discovery.html +quarkus.rest-client.credit_bureau_yaml.url=${knative:services.v1.serving.knative.dev/loanbroker-example/loanbroker-credit-bureau} +quarkus.rest-client.aggregator_yaml.url=${kubernetes:services.v1/loanbroker-example/loanbroker-aggregator} + +%dev.quarkus.rest-client.credit_bureau_yaml.url=http://localhost:8181 +%dev.quarkus.rest-client.aggregator_yaml.url=http://localhost:8282 mp.messaging.incoming.kogito_incoming_stream.path=/ mp.messaging.incoming.kogito_incoming_stream.connector=quarkus-http -quarkus.kubernetes.deploy=false quarkus.knative.name=loanbroker-flow quarkus.kubernetes.deployment-target=knative -quarkus.knative.image-pull-policy=IfNotPresent -# Use the Kogito service discovery mechanism to get the services url. -# For more information see: https://kiegroup.github.io/kogito-docs/serverlessworkflow/latest/cloud/kubernetes-service-discovery.html -quarkus.knative.env.vars.kogito_service_cluster_url=${knative:services.v1.serving.knative.dev/loanbroker-example/loanbroker-flow} -quarkus.knative.env.vars.credit_bureau_url=${knative:services.v1.serving.knative.dev/loanbroker-example/loanbroker-credit-bureau} -quarkus.knative.env.vars.aggregator_url=${kubernetes:services.v1/loanbroker-example/loanbroker-aggregator} +quarkus.knative.image-pull-policy=if-not-present + +quarkus.knative.min-scale=1 +quarkus.knative.max-scale=1 # Kogito persistence configurations for enabling the serverless workflow persistence -%persistence.quarkus.container-image.group=dev.local +%persistence.quarkus.container-image.registry=dev.local +%persistence.quarkus.container-image.group=${USER} %persistence.quarkus.container-image.name=loanbroker-flow %persistence.quarkus.container-image.build=true diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/resources/application.properties b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/resources/application.properties index 2cbd4686e6..e8953f6fe6 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/resources/application.properties +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-flow/src/test/resources/application.properties @@ -21,6 +21,6 @@ quarkus.http.test-port=0 # Act as a placeholder to avoid triggering Kubernetes Service Discovery during test runs # The actual URLs are set by the Quarkus Test Runner -quarkus.knative.env.vars.kogito_service_cluster_url=http://localhost:8080 -quarkus.knative.env.vars.credit_bureau_url=http://localhost:8080 -quarkus.knative.env.vars.aggregator_url=http://localhost:8080 +kogito.service.url=http://localhost:${quarkus.http.port} +quarkus.rest-client.credit_bureau_yaml.url=http://localhost:8181 +quarkus.rest-client.aggregator_yaml.url=http://localhost:8282 \ No newline at end of file diff --git a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/resources/application.properties b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/resources/application.properties index 63daa72507..98b287a932 100644 --- a/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/resources/application.properties +++ b/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-ui/src/main/resources/application.properties @@ -17,6 +17,9 @@ # under the License. # +quarkus.http.cors=true +quarkus.http.cors.origins=/.*/ + # on kubernetes, we can configure the workflow endpoint via an env var org.acme.loanbroker.ui.workflowURL=${WORKFLOW_URL:http://localhost:8080} quarkus.qute.content-types."js"=text/javascript @@ -27,11 +30,13 @@ quarkus.qute.suffixes=js,html %dev.quarkus.http.port=8383 # profile to pack this example into a container, to use it execute activate the maven container profile, -Dcontainer -%container.quarkus.container-image.group=dev.local +%container.quarkus.container-image.registry=dev.local +%container.quarkus.container-image.group=${USER} %container.quarkus.container-image.name=loanbroker-ui %container.quarkus.container-image.build=true +quarkus.kubernetes.name=loanbroker-ui quarkus.kubernetes.deploy=false quarkus.kubernetes.deployment-target=kubernetes -quarkus.kubernetes.image-pull-policy=IfNotPresent +quarkus.kubernetes.image-pull-policy=if-not-present quarkus.kubernetes.env.vars.workflow_url=http://loanbroker-flow.loanbroker-example.svc.cluster.local diff --git a/serverless-workflow-examples/serverless-workflow-subflows-event/README.md b/serverless-workflow-examples/serverless-workflow-subflows-event/README.md new file mode 100644 index 0000000000..9737f73215 --- /dev/null +++ b/serverless-workflow-examples/serverless-workflow-subflows-event/README.md @@ -0,0 +1,86 @@ +# serverless-workflow-subflow-events + +This example illustrate how to trigger workflows manually with additional parameters calculated by an initial workflow. +The workflow responsible for setting up the parameters is executed as the start state. +Then, all possible workflows that might be instantiated with those parameters are registered using `event` state. `exclusive` property is set to false ensuring that the process instance remains active till all possible workflows has been executed. + +## Execution steps. + +Execute main workflow + +``` +curl --location 'http://localhost:8080/master' \ +--header 'Content-Type: application/json' \ +--data '{ +}' +``` + +This will return the id and the two properties that are configured by `setup` workflow + +``` +{ + "id": "ad7e1081-3f05-431e-b246-d9471643fec2", + "workflowdata": { + "param1": "This is param1", + "param2": "This is param2" + } +} +``` + +We need to write down the id returned by the previous steps and invoke `workflowA` through a cloud event containing that id as `kogitoprocrefid` attibute. + +``` +curl --location 'http://localhost:8080/executeA' \ +--header 'Content-Type: application/json' \ +--data '{ + "id" : "1", + "specversion" : "1.0", + "type" : "executeA", + "source" : "manual", + "data" : { + "param4" : "Additional parameter" + }, + "kogitoprocrefid" : "ad7e1081-3f05-431e-b246-d9471643fec2" +}' +``` + +The execution of `workflowA` is registered in the quarkus log. + +``` +2024-05-14 12:09:10,306 INFO [org.kie.kog.ser.wor.dev.DevModeServerlessWorkflowLogger] (kogito-event-executor-1) Triggered node 'Start' for process 'workflowA' (8321fbd0-64ee-4e95-91d6-957983a92325) +2024-05-14 12:09:10,306 INFO [org.kie.kog.ser.wor.dev.DevModeServerlessWorkflowLogger] (kogito-event-executor-1) Triggered node 'doIt' for process 'workflowA' (8321fbd0-64ee-4e95-91d6-957983a92325) +2024-05-14 12:09:10,307 INFO [org.kie.kog.ser.wor.dev.DevModeServerlessWorkflowLogger] (kogito-event-executor-1) Property 'workflowdata.param3' changed value from: 'null', to: '"This is workflow A"' +2024-05-14 12:09:10,307 INFO [org.kie.kog.ser.wor.dev.DevModeServerlessWorkflowLogger] (kogito-event-executor-1) Triggered node 'End' for process 'workflowA' (8321fbd0-64ee-4e95-91d6-957983a92325) +``` + +The main workflow is still active, waiting for execution of workflow B. Lets execute it sending another cloud event. + +``` +curl --location 'http://localhost:8080/executeB' \ +--header 'Content-Type: application/json' \ +--data '{ + "id": "1", + "specversion": "1.0", + "type": "executeB", + "source": "manual", + "data": { + "param4": "Additional parameter" + }, + "kogitoprocrefid": "ad7e1081-3f05-431e-b246-d9471643fec2" +}' +``` + +We see in quarkus logs that workflow B is executed and that master workflow is completed, since there are not more waiting events + +``` +2024-05-14 12:09:10,334 INFO [org.kie.kog.ser.wor.dev.DevModeServerlessWorkflowLogger] (kogito-event-executor-1) Triggered node 'Start' for process 'workflowB' (5a49f40d-2e54-46fb-8317-b0be12fd9f05) +2024-05-14 12:09:10,334 INFO [org.kie.kog.ser.wor.dev.DevModeServerlessWorkflowLogger] (kogito-event-executor-1) Triggered node 'doIt' for process 'workflowB' (5a49f40d-2e54-46fb-8317-b0be12fd9f05) +2024-05-14 12:09:10,335 INFO [org.kie.kog.ser.wor.dev.DevModeServerlessWorkflowLogger] (kogito-event-executor-1) Property 'workflowdata.param3' changed value from: 'null', to: '"This is workflow B"' +2024-05-14 12:09:10,335 INFO [org.kie.kog.ser.wor.dev.DevModeServerlessWorkflowLogger] (kogito-event-executor-1) Triggered node 'End' for process 'workflowB' (5a49f40d-2e54-46fb-8317-b0be12fd9f05) +2024-05-14 12:09:10,335 INFO [org.kie.kog.ser.wor.dev.DevModeServerlessWorkflowLogger] (kogito-event-executor-1) Workflow 'workflowB' (5a49f40d-2e54-46fb-8317-b0be12fd9f05) completed +2024-05-14 12:09:10,336 INFO [org.jbp.pro.cor.eve.EventTypeFilter] (kogito-event-executor-1) This event is subscribed to a message ref processInstanceCompleted:5a49f40d-2e54-46fb-8317-b0be12fd9f05 WorkflowProcessInstance [Id=5a49f40d-2e54-46fb-8317-b0be12fd9f05,processId=workflowB,state=2] +2024-05-14 12:09:10,336 INFO [org.jbp.pro.cor.eve.EventTypeFilter] (kogito-event-executor-1) This event is subscribed to a message ref processInstanceCompleted:5a49f40d-2e54-46fb-8317-b0be12fd9f05 WorkflowProcessInstance [Id=5a49f40d-2e54-46fb-8317-b0be12fd9f05,processId=workflowB,state=2] +2024-05-14 12:09:10,339 INFO [org.kie.kog.ser.wor.dev.DevModeServerlessWorkflowLogger] (kogito-event-executor-1) Triggered node 'waitForEventsJoin' for process 'master' (0ee42b37-7106-4157-9d75-00842f1fea45) +2024-05-14 12:09:10,339 INFO [org.kie.kog.ser.wor.dev.DevModeServerlessWorkflowLogger] (kogito-event-executor-1) Triggered node 'End' for process 'master' (0ee42b37-7106-4157-9d75-00842f1fea45) +2024-05-14 12:09:10,340 INFO [org.kie.kog.ser.wor.dev.DevModeServerlessWorkflowLogger] (kogito-event-executor-1) Triggered node 'End' for process 'master' (0ee42b37-7106-4157-9d75-00842f1fea45) +``` diff --git a/serverless-workflow-examples/serverless-workflow-subflows-event/pom.xml b/serverless-workflow-examples/serverless-workflow-subflows-event/pom.xml new file mode 100644 index 0000000000..a2a10a222c --- /dev/null +++ b/serverless-workflow-examples/serverless-workflow-subflows-event/pom.xml @@ -0,0 +1,192 @@ + + + + 4.0.0 + + + org.kie.kogito.examples + serverless-workflow-examples-parent + 999-SNAPSHOT + ../serverless-workflow-examples-parent/pom.xml + + + serverless-workflow-subflows-event + 1.0-SNAPSHOT + + Kogito Example :: Serverless Workflow Subflows Event :: Quarkus + Kogito Serverless Workflow Subflows Event - Quarkus + + + 3.8.4 + quarkus-bom + io.quarkus + 3.8.4 + org.kie.kogito + kogito-bom + 999-SNAPSHOT + 999-SNAPSHOT + 17 + 3.8.1 + 3.0.0-M7 + ${version.surefire.plugin} + + + + + + ${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.apache.kie.sonataflow + sonataflow-quarkus + + + io.quarkus + quarkus-resteasy-jackson + + + io.quarkus + quarkus-arc + + + io.quarkus + quarkus-resteasy + + + io.quarkus + quarkus-smallrye-openapi + + + io.quarkus + quarkus-junit5 + test + + + io.rest-assured + rest-assured + test + + + org.awaitility + awaitility + test + + + + ${project.artifactId} + + + maven-compiler-plugin + ${version.compiler.plugin} + + ${maven.compiler.release} + + + + ${quarkus.platform.group-id} + quarkus-maven-plugin + ${quarkus-plugin.version} + + + + build + + + + + + maven-surefire-plugin + ${version.surefire.plugin} + + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + maven-failsafe-plugin + ${version.failsafe.plugin} + + + org.jboss.logmanager.LogManager + ${maven.home} + + + + + + integration-test + verify + + + + + + + + + container + + + container + + + + container + + + + io.quarkus + quarkus-container-image-jib + + + + + native + + + native + + + + native + + + + diff --git a/serverless-workflow-examples/serverless-workflow-subflows-event/src/main/resources/application.properties b/serverless-workflow-examples/serverless-workflow-subflows-event/src/main/resources/application.properties new file mode 100644 index 0000000000..cd71c3734d --- /dev/null +++ b/serverless-workflow-examples/serverless-workflow-subflows-event/src/main/resources/application.properties @@ -0,0 +1,32 @@ +# +# 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. + +mp.messaging.incoming.executeA.connector=quarkus-http +mp.messaging.incoming.executeA.path=/executeA + +mp.messaging.incoming.executeB.connector=quarkus-http +mp.messaging.incoming.executeB.path=/executeB + +# profile to pack this example into a container, to use it execute activate the maven container profile, -Dcontainer +%container.quarkus.container-image.build=true +%container.quarkus.container-image.push=false +%container.quarkus.container-image.group=${USER} +%container.quarkus.container-image.registry=dev.local +%container.quarkus.container-image.tag=1.0-SNAPSHOT + +quarkus.devservices.enabled=false diff --git a/serverless-workflow-examples/serverless-workflow-subflows-event/src/main/resources/master.sw.json b/serverless-workflow-examples/serverless-workflow-subflows-event/src/main/resources/master.sw.json new file mode 100644 index 0000000000..22a681ab5d --- /dev/null +++ b/serverless-workflow-examples/serverless-workflow-subflows-event/src/main/resources/master.sw.json @@ -0,0 +1,66 @@ +{ + "id": "master", + "version": "1.0", + "specVersion": "0.8", + "name": "master", + "start": "setup", + "events": [ + { + "name": "executeA", + "source": "", + "type": "executeA" + }, + { + "name": "executeB", + "source": "", + "type": "executeB" + } + ], + "states": [ + { + "name": "setup", + "type" : "operation", + "actions": [{ + "name": "setup", + "subFlowRef" : "setup" + }], + "transition": "waitForEvents" + }, + { + "name": "waitForEvents", + "type": "event", + "onEvents": [ + { + "eventRefs": [ + "executeA" + ], + "actions": [ + { + "name": "workflowA", + "subFlowRef": "workflowA", + "actionDataFilter" : { + "useResults": false + } + } + ] + }, + { + "eventRefs": [ + "executeB" + ], + "actions": [ + { + "name": "workflowB", + "subFlowRef": "workflowB", + "actionDataFilter" : { + "useResults": false + } + } + ] + } + ], + "exclusive": false, + "end" : true + } + ] +} \ No newline at end of file diff --git a/serverless-workflow-examples/serverless-workflow-subflows-event/src/main/resources/setup.sw.json b/serverless-workflow-examples/serverless-workflow-subflows-event/src/main/resources/setup.sw.json new file mode 100644 index 0000000000..7659e1f1bd --- /dev/null +++ b/serverless-workflow-examples/serverless-workflow-subflows-event/src/main/resources/setup.sw.json @@ -0,0 +1,18 @@ +{ + "id": "setup", + "version": "1.0", + "specVersion": "0.8", + "name": "setup", + "start": "doIt", + "states": [ + { + "name": "doIt", + "type": "inject", + "data" : { + "param1": "This is param1", + "param2": "This is param2" + }, + "end": true + } + ] +} \ No newline at end of file diff --git a/serverless-workflow-examples/serverless-workflow-subflows-event/src/main/resources/workflowA.sw.json b/serverless-workflow-examples/serverless-workflow-subflows-event/src/main/resources/workflowA.sw.json new file mode 100644 index 0000000000..4d626a9375 --- /dev/null +++ b/serverless-workflow-examples/serverless-workflow-subflows-event/src/main/resources/workflowA.sw.json @@ -0,0 +1,17 @@ +{ + "id": "workflowA", + "version": "1.0", + "specVersion": "0.8", + "name": "workflowB", + "start": "doIt", + "states": [ + { + "name": "doIt", + "type": "inject", + "data" : { + "param3": "This is workflow A" + }, + "end": true + } + ] +} \ No newline at end of file diff --git a/serverless-workflow-examples/serverless-workflow-subflows-event/src/main/resources/workflowB.sw.json b/serverless-workflow-examples/serverless-workflow-subflows-event/src/main/resources/workflowB.sw.json new file mode 100644 index 0000000000..43f7c19df4 --- /dev/null +++ b/serverless-workflow-examples/serverless-workflow-subflows-event/src/main/resources/workflowB.sw.json @@ -0,0 +1,17 @@ +{ + "id": "workflowB", + "version": "1.0", + "specVersion": "0.8", + "name": "workflowB", + "start": "doIt", + "states": [ + { + "name": "doIt", + "type": "inject", + "data" : { + "param3": "This is workflow B" + }, + "end": true + } + ] +} \ No newline at end of file diff --git a/serverless-workflow-examples/serverless-workflow-subflows-event/src/test/java/org/kie/kogito/examples/MasterWorkflowTest.java b/serverless-workflow-examples/serverless-workflow-subflows-event/src/test/java/org/kie/kogito/examples/MasterWorkflowTest.java new file mode 100644 index 0000000000..cdbd05335d --- /dev/null +++ b/serverless-workflow-examples/serverless-workflow-subflows-event/src/test/java/org/kie/kogito/examples/MasterWorkflowTest.java @@ -0,0 +1,99 @@ +/* + * 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. + */ +package org.kie.kogito.examples; + +import static io.restassured.RestAssured.given; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.awaitility.Awaitility.await; + +import java.io.IOException; +import java.net.URI; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.Optional; +import java.util.UUID; + +import org.junit.jupiter.api.Test; +import org.kie.kogito.event.CloudEventMarshaller; +import org.kie.kogito.event.cloudevents.CloudEventExtensionConstants; +import org.kie.kogito.event.impl.StringCloudEventMarshaller; +import org.kie.kogito.jackson.utils.ObjectMapperFactory; + +import io.cloudevents.CloudEvent; +import io.cloudevents.core.builder.CloudEventBuilder; +import io.quarkus.test.junit.QuarkusTest; +import io.restassured.http.ContentType; + + +@QuarkusTest +class MasterWorkflowTest { + private static final CloudEventMarshaller marshaller = new StringCloudEventMarshaller(ObjectMapperFactory.get()); + + @Test + void testPartialParallelRest() throws IOException { + String id = given() + .contentType(ContentType.JSON) + .accept(ContentType.JSON) + .body("{}").when() + .post("/master") + .then() + .statusCode(201).extract().path("id"); + sendEvent (id, "executeA"); + sendEvent (id, "executeB"); + waitForFinish("master", id, Duration.ofSeconds(10)); + } + + static void waitForFinish(String flowName, String id, Duration duration) { + await("dead").atMost(duration) + .with().pollInterval(1, SECONDS) + .untilAsserted(() -> given() + .contentType(ContentType.JSON) + .accept(ContentType.JSON) + .get("/" + flowName + "/{id}", id) + .then() + .statusCode(404)); + } + + private void sendEvent(String id, String eventType) throws IOException { + given() + .contentType(ContentType.JSON) + .when() + .body(marshaller.marshall(buildCloudEvent(id, eventType, marshaller))) + .post("/" + eventType) + .then() + .statusCode(202); + } + + static CloudEvent buildCloudEvent(String id, Optional businessKey, String type, CloudEventMarshaller marshaller) { + io.cloudevents.core.v1.CloudEventBuilder builder = CloudEventBuilder.v1() + .withId(UUID.randomUUID().toString()) + .withSource(URI.create("")) + .withType(type) + .withTime(OffsetDateTime.now()) + .withData(marshaller.cloudEventDataFactory().apply(Collections.singletonMap("param4", "Additional argument"))); + businessKey.ifPresentOrElse(key -> builder.withExtension(CloudEventExtensionConstants.BUSINESS_KEY, key), () -> builder.withExtension(CloudEventExtensionConstants.PROCESS_REFERENCE_ID, id)); + return builder.build(); + } + + static CloudEvent buildCloudEvent(String id, String type, CloudEventMarshaller marshaller) { + return buildCloudEvent(id, Optional.empty(), type, marshaller); + } + +} 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 7f3a169f80..ec5094b5ed 100644 --- a/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/pom.xml +++ b/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/pom.xml @@ -51,7 +51,7 @@ 5.1.3 3.6.0 - 0.2.0 + 0.2.2