### Start Kogito Infrastructure Services Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-timer-quarkus/docker-compose/README.md Use this script to start the required infrastructure services for Kogito examples. It can start PostgreSQL by default or other configurations if specified. ```bash ./startServices.sh postgresql or just ./startServices.sh ``` -------------------------------- ### Start Infrastructure Services with Infinispan Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-timer-quarkus/README.md Execute this script to start all necessary services, including Infinispan, before running the Hiring example. Ensure the project is compiled with the infinispan profile first. ```bash ./startServices.sh infinispan ``` -------------------------------- ### Clone KIE Examples Repository Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/README.md Clone this repository to get started with the Apache KIE examples. This is the initial step to access all provided examples. ```bash git clone git@github.com:apache/incubator-kie-kogito-examples.git ``` -------------------------------- ### Navigate to Example Directory Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/README.md After cloning the repository, navigate to the specific example directory you wish to explore. This example shows navigation to a Kogito Quarkus process example. ```bash cd ./incubator-kie-kogito-examples/kogito-quarkus-examples/process-quarkus-example ``` -------------------------------- ### Compile and Run Hiring Example in Local Dev Mode with PostgreSQL Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-timer-quarkus/README.md Starts the Hiring example in Quarkus development mode with the PostgreSQL profile. This mode enables hot-reloading for business assets and Java code. ```bash mvn clean package quarkus:dev -Ppostgresql ``` -------------------------------- ### Example Response for GET /usertasks/instance Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-springboot-examples/process-monitoring-springboot/README.md This is an example JSON response when retrieving user tasks awaiting user action. ```JSON [ { "id": "bcbe9d60-4847-45f0-8069-e983f3f055e6", "userTaskId": "UserTask_1", "status": { "terminate": null, "name": "Reserved" }, "taskName": "Verify order", ... ] ``` -------------------------------- ### Compile and Run Hiring Example in Local Dev Mode Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-timer-quarkus/README.md Compile and start the Hiring example in Quarkus development mode. This mode allows for hot reloading of business assets and Java code without restarting the application. ```bash mvn clean package quarkus:dev -Pinfinispan ``` -------------------------------- ### Start Docker Compose Services with Profile Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-instance-migration-quarkus/docker-compose/README.md Start the Docker Compose services using the 'startServices.sh' script, specifying a profile like 'example'. Defaults to 'full' if no profile is provided. ```shell sh startServices.sh example ``` -------------------------------- ### Build and Run Example in Development Mode Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-instance-migration-quarkus/README.md Run the example in development mode, which embeds all necessary infrastructure services. This command also builds the application. ```shell mvn clean package quarkus:dev -Pdevelopment ``` -------------------------------- ### Compile Hiring Example with Infinispan Profile Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-timer-quarkus/README.md Compiles the Hiring example project with the Infinispan profile enabled. This is a prerequisite for running the example with Infinispan. ```bash mvn clean install -Pinfinispan ``` -------------------------------- ### Compile and Run DMN Quarkus Consumer Example Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/dmn-resource-jar-quarkus-example/README.md Compile the project and then run the Quarkus application in development mode. This requires a previous installation of 'dmn-quarkus-resource-jar'. ```bash mvn clean install cd ./dmn-quarkus-consumer-example mvn quarkus:dev ``` -------------------------------- ### Package and Run Hiring Example in JVM Mode Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-timer-quarkus/README.md Package the Hiring example and run it as a standard Java application. This is suitable for deployment in a JVM environment. ```bash mvn clean package -Pinfinispan java -jar target/quarkus-app/quarkus-run.jar ``` ```bash mvn clean package -Pinfinispan java -jar target\quarkus-app\quarkus-run.jar ``` -------------------------------- ### Compile Hiring Example with PostgreSQL Profile Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-timer-quarkus/README.md Compiles the Hiring example project with the PostgreSQL profile enabled. This is a prerequisite for running the example with PostgreSQL. ```bash mvn clean install -Ppostgresql ``` -------------------------------- ### Package and Run Hiring Example using Local Native Image with PostgreSQL Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-timer-quarkus/README.md Packages the Hiring example as a native executable using GraalVM and the PostgreSQL profile. Requires GRAALVM_HOME to be set. ```bash mvn clean package -Pnative -Ppostgresql ``` -------------------------------- ### Start User Task from Ready State Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-ws-humantask-lifecycle-quarkus/README.md Directly start a user task from the 'Ready' state. This is an alternative to claiming and then starting. ```shell curl -X POST "http://localhost:8080/usertasks/instance/${taskId}/transition?user=adam" \ -H "content-type: application/json" \ -d '{ "transitionId": "start" }' ``` -------------------------------- ### Package and Run Hiring Example in JVM Mode with PostgreSQL Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-timer-quarkus/README.md Packages the Hiring example for JVM execution and then runs it. This is a standard way to run a compiled Java application. ```bash mvn clean package -Ppostgresql java -jar target/quarkus-app/quarkus-run.jar ``` ```bash mvn clean package -Ppostgresql java -jar target\quarkus-app\quarkus-run.jar ``` -------------------------------- ### Package and Run Hiring Example using Local Native Image Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-timer-quarkus/README.md Compile the Hiring example into a native executable using GraalVM. This requires GRAALVM_HOME to be set correctly. The executable is generated in the `target/` directory. ```bash mvn clean package -Pnative -Pinfinispan ``` ```bash ./target/process-usertasks-timer-quarkus ``` -------------------------------- ### Start Kogito Services on Windows Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/kogito-travel-agency/extended/docker-compose/README.md Run this command after creating the .env file to start all required infrastructure services for the Kogito Travel Agency demo on Windows. ```bash docker compose up ``` -------------------------------- ### Example Response for Getting User Tasks Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-outbox-mongodb-quarkus/README.md Sample JSON response listing user tasks for an order item. ```json [ {"id":"62f1c985-d31c-4ead-9906-2fe8d05937f0","name":"Verify order"} ] ``` -------------------------------- ### Start a Simple Process Instance Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-instance-migration-quarkus/README.md Execute this curl command to start an instance of the 'Simple' process. Ensure the service is running. ```bash curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://localhost:8080/simple -d '{}' ``` -------------------------------- ### Start Kogito Services on Linux/MacOS Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/kogito-travel-agency/extended/docker-compose/README.md Execute this script to start all required infrastructure services for the Kogito Travel Agency demo on Linux and MacOS systems. ```bash ./startServices.sh ``` -------------------------------- ### Submit a Request to Start New Hiring Process (Harry Potter) Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-timer-quarkus/README.md Send a POST request to the Hiring service endpoint with candidate details to initiate a new hiring process. This example uses `curl` to send a JSON payload. ```json { "candidate": { "name": "Harry Potter", "email": "harrypotter@example.com", "salary": 30000, "skills": "Java, Kogito" } } ``` ```bash curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://localhost:8080/hiring -d @- << EOF { "candidate": { "name": "Harry Potter", "email": "harrypotter@example.com", "salary": 30000, "skills": "Java, Kogito" } } EOF ``` -------------------------------- ### Start Infrastructure Services Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-timer-quarkus/README.md Starts all required infrastructure services using a provided script. This script can be run with or without specifying the 'postgresql' profile. ```bash ./startServices.sh ``` ```bash ./startServices.sh postgresql ``` -------------------------------- ### Compile Kogito Example with Container Profile Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-instance-migration-quarkus/docker-compose/README.md Compile the Kogito example using the 'container' Maven profile to enable the Kogito Process Instance Migration Service. ```shell mvn clean package -Pcontainer ``` -------------------------------- ### Start Infrastructure Services with Docker Compose Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-instance-migration-quarkus/README.md Start all required infrastructure services, including PostgreSQL, PgAdmin, and the Kogito Process Instance Migration Service, using the provided docker-compose script. ```shell sh startServices.sh ``` -------------------------------- ### Start Application with Docker Compose Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-ws-humantask-lifecycle-quarkus/README.md Run this command to start the entire application using Docker Compose, including the built Docker image. The PROJECT_VERSION property is used to tag the image. ```sh PROJECT_VERSION=999-SNAPSHOT docker compose up ``` -------------------------------- ### Start Keycloak Server with Docker Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-springboot-examples/process-usertasks-with-security-oidc-springboot/README.md Starts a Keycloak server using Docker, importing a predefined realm for Kogito. Ensure the Keycloak server is accessible at localhost:8281/auth. ```sh docker run -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -e KEYCLOAK_IMPORT=/tmp/kogito-realm.json -v /kogito-usertasks-with-security-oidc-springboot/config/kogito-realm.json:/tmp/kogito-realm.json -p 8281:8080 quay.io/keycloak/keycloak:legacy ``` -------------------------------- ### Start Keycloak Server with Realm Import Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-with-security-oidc-quarkus/README.md Starts a Keycloak server using Docker, importing a custom realm configuration for user and role management. Ensure the path to `kogito-realm.json` is correctly specified. ```bash 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 ``` -------------------------------- ### Start Kafka Instance with Docker Compose Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/dmn-event-driven-quarkus/README.md Use the provided docker-compose.yml to start a local Kafka instance for testing purposes. Access the Kafka instance via Kafdrop at http://localhost:9000/. ```bash docker compose up -d ``` -------------------------------- ### Start Kogito Job Service with Infinispan Persistence Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-timer-quarkus/README.md Start the Infinispan server before running the Kogito Job Service with Infinispan persistence. Replace {version} with the actual Kogito version. ```sh java -Dquarkus.http.port=8085 -jar jobs-service-infinispan/target/jobs-service-infinispan-{version}-runner.jar ``` -------------------------------- ### Submit a New Request to Start New Hiring Process (Jon Snow) Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-timer-quarkus/README.md Initiate another hiring process using `curl` with a different candidate's details. This demonstrates starting multiple hiring processes. ```bash curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://localhost:8080/hiring -d @- << EOF { "candidate": { "name": "Jon Snow", "email": "jdoe@example.com", "salary": 30000, "skills": "Java, Kogito" } } EOF ``` -------------------------------- ### Example Response for Getting Order Items Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-outbox-mongodb-quarkus/README.md Sample JSON response containing order items. ```json [ { "id":"66c11e3e-c211-4cee-9a07-848b5e861bc5", "order": { "orderNumber":"12345", "shipped":false, "total":0.537941914075738 } } ] ``` -------------------------------- ### Run Native Executable Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/README.md Execute the generated native binary. Adjust port and host as needed, and use `-Dorg.acme.kogito.onboarding.local=true` for local development. ```bash ./target/onboarding-runner -Dquarkus.http.port=8080 -Dquarkus.http.host=localhost -Dorg.acme.kogito.onboarding.local=true ``` -------------------------------- ### Example Response for Getting All Orders Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-outbox-mongodb-quarkus/README.md Sample JSON response containing an array of active orders. ```json [ { "approver": "john", "id": "b5225020-4cf4-4e91-8f86-dc840589cc22", "order": { "orderNumber": "12345", "shipped": false, "total": 0.529655982561999 } }] ``` -------------------------------- ### Example Usage: POST /Scorecard Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/pmml-quarkus-example/README.md Send a POST request to the /Testscorecard/SimpleScorecard endpoint with JSON input to get a scorecard prediction. This demonstrates interacting with a PMML scorecard model. ```json { "input1":5.0, "input2":-10.0 } ``` ```sh curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"input1":5.0, "input2":-10.0}' http://localhost:8080/Testscorecard/SimpleScorecard ``` ```sh curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d "{"input1":5.0, "input2":-10.0}" http://localhost:8080/Testscorecard/SimpleScorecard ``` ```json { "score":-15.0 } ``` -------------------------------- ### Start Simple Process Instance Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-instance-migration-quarkus/README.md Initiates a new instance of the 'Simple' process. ```APIDOC ## POST /simple ### Description Starts a new instance of the 'Simple' process. ### Method POST ### Endpoint http://localhost:8080/simple ### Request Body - `{}` (object) - Empty JSON object. ### Request Example ```bash curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST http://localhost:8080/simple -d '{}' ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier of the newly created process instance. ### Response Example ```json { "id": "b97efe7d-dc9b-4da8-8b3e-6100f8d8b045" } ``` ``` -------------------------------- ### Example Usage: POST /Regression Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/pmml-quarkus-example/README.md Send a POST request to the /Testregression/LinReg endpoint with JSON input to get a regression prediction. This demonstrates interacting with a PMML regression model. ```json { "fld1":3.0, "fld2":2.0, "fld3":"y" } ``` ```sh curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"fld1":3.0, "fld2":2.0, "fld3":"y"}' http://localhost:8080/Testregression/LinReg ``` ```sh curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d "{"fld1":3.0, "fld2":2.0, "fld3":"y"}" http://localhost:8080/Testregression/LinReg ``` ```json { "fld4":52.5 } ``` -------------------------------- ### Interact with Regression Model Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-springboot-examples/pmml-springboot-example/README.md Send a POST request to the /Testregression/LinReg endpoint with JSON input to get a regression prediction. The example shows the input JSON and the cURL command for Linux/macOS. ```json { "fld1":3.0, "fld2":2.0, "fld3":"y" } ``` ```sh curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"fld1":3.0, "fld2":2.0, "fld3":"y"}' http://localhost:8080/Testregression/LinReg ``` -------------------------------- ### Interact with Mining Model Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-springboot-examples/pmml-springboot-example/README.md Send a POST request to the /Testminingmodel/PredicatesMining endpoint with JSON input to get a prediction from a mining model. The example shows the input JSON and the cURL command for Linux/macOS. ```json { "residenceState":"AP", "validLicense":true, "occupation":"ASTRONAUT", "categoricalY":"classA", "categoricalX":"red", "variable":6.6, "age":25.0 } ``` ```sh curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"residenceState":"AP", "validLicense":true, "occupation":"ASTRONAUT", "categoricalY":"classA", "categoricalX":"red", "variable":6.6, "age":25.0}' http://localhost:8080/Testminingmodel/PredicatesMining ``` -------------------------------- ### Interact with Scorecard Model Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-springboot-examples/pmml-springboot-example/README.md Send a POST request to the /Testscorecard/SimpleScorecard endpoint with JSON input to get a score from a scorecard model. The example shows the input JSON and the cURL command for Linux/macOS. ```json { "input1":5.0, "input2":-10.0 } ``` ```sh curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"input1":5.0, "input2":-10.0}' http://localhost:8080/Testscorecard/SimpleScorecard ``` -------------------------------- ### Build and Run Instructions Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-decisions-quarkus/README.md Instructions on how to compile, package, and run the Kogito Quarkus application in different modes (local dev, JVM, native). ```APIDOC ## Build and run ### Prerequisites You will need: - Java 17+ installed - Environment variable JAVA_HOME set accordingly - Maven 3.9.11+ installed When using native image compilation, you will also need: - GraalVM 19.3+ installed - Environment variable GRAALVM_HOME set accordingly - GraalVM native image needs as well native-image extension: https://www.graalvm.org/reference-manual/native-image/ - Note that GraalVM native image compilation typically requires other packages (glibc-devel, zlib-devel and gcc) to be installed too, please refer to GraalVM installation documentation for more details. ### Compile and Run in Local Dev Mode ```sh mvn clean compile quarkus:dev ``` NOTE: With dev mode of Quarkus you can take advantage of hot reload for business assets like processes, rules, decision tables and java code. No need to redeploy or restart your running application. ### 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 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 mvn clean package -Pnative ``` To run the generated native executable, generated in `target/`, execute ``` ./target/process-decision-quarkus-runner ``` ``` -------------------------------- ### Example Usage: POST /Tree Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/pmml-quarkus-example/README.md Send a POST request to the /Testtree/SampleMine endpoint with JSON input to get a decision tree prediction. This demonstrates interacting with a PMML decision tree model. ```json { "temperature":30.0, "humidity": 10.0 } ``` ```sh curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"temperature":30.0, "humidity":10.0}' http://localhost:8080/Testtree/SampleMine ``` ```sh curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d "{"temperature":30.0, "humidity":10.0}" http://localhost:8080/Testtree/SampleMine ``` ```json { "decision":"sunglasses" } ``` -------------------------------- ### Interact with Tree Model Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-springboot-examples/pmml-springboot-example/README.md Send a POST request to the /Testtree/SampleMine endpoint with JSON input to get a prediction from a decision tree model. The example shows the input JSON and the cURL command for Linux/macOS. ```json { "temperature":30.0, "humidity": 10.0 } ``` ```sh curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"temperature":30.0, "humidity":10.0}' http://localhost:8080/Testtree/SampleMine ``` -------------------------------- ### Package and Run DMN Quarkus Consumer Example using Native Image Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/dmn-resource-jar-quarkus-example/README.md Compile the application into a native executable using GraalVM. Ensure GRAALVM_HOME is set correctly. This command is for Linux/macOS. ```bash mvn clean package -Pnative ./dmn-quarkus-consumer-example/target/dmn-quarkus-consumer-example-runner ``` -------------------------------- ### Package and Run JAR Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-springboot-examples/dmn-listener-springboot/README.md Package the application into a JAR file and then run it. ```sh mvn clean package java -jar ./target/dmn-listener-springboot.jar ``` -------------------------------- ### Start Onboarding Process Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/README.md Send a POST request to the `/onboarding` endpoint with employee details to initiate the onboarding process. This interacts with HR and payroll services. ```sh curl -X POST -H 'Content-Type: application/json' -d '{"employee" : {"firstName" : "Mark", "lastName" : "Test", "personalId" : "xxx-yyy-zzz", "birthDate" : "1995-12-10T14:50:12.123+02:00", "address" : {"country" : "US", "city" : "Boston", "street" : "any street 3", "zipCode" : "10001"}}}' http://localhost:8080/onboarding ``` -------------------------------- ### Start First Line Approval Task Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/README.md Transition the first line approval user task to the 'start' state. This action is performed using the task ID and specifying the 'start' transition. ```shell curl -X POST 'http://localhost:8080/usertasks/instance/{taskid}/transition?group=managers&user=manager' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"transitionId": "start"}' ``` -------------------------------- ### Build and Deploy to Minikube Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/onboarding-example/payroll/README.md Build the service, create a Docker image, and deploy it to Minikube using the -Pminikube profile. Ensure Minikube Docker environment is enabled. ```shell # make sure that the docker env from minikube is enabled locally $ eval $(minikube -p minikube docker-env) # build the service, the image and deploy it on Minikube: $ mvn clean install -Pminikube ``` -------------------------------- ### Start Second Line Approval Task Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-usertasks-custom-lifecycle-quarkus/README.md Initiate the second line approval task by transitioning it to the 'start' state. This is done using the task ID and the 'start' transition, typically by a different user than the first approver. ```shell curl -X POST 'http://localhost:8080/usertasks/instance/{taskid}/transition?group=managers&user=admin' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{"transitionId": "start"}' ``` -------------------------------- ### Review Log Example Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-infinispan-persistence-quarkus/README.md This is an example of how the review log might look after completing a review task. ```text Review of the deal very good work for traveller Doe ``` -------------------------------- ### Get All Travel Requests Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/kogito-travel-agency/basic/README.md Retrieve a list of all active travel requests using this GET request. ```sh curl -X GET http://localhost:8080/travels ``` -------------------------------- ### Expose Onboarding Service URL on Minikube Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/onboarding-example/README.md Use this command to expose the onboarding-service via Node Port on Minikube, obtaining its URL for interaction. ```shell minikube service --url onboarding-service ``` -------------------------------- ### Example Response for /find-approved Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/rules-legacy-quarkus-example/README.md This is an example of the JSON response received after a successful POST request to the /find-approved endpoint. ```json [ { "id":"ABC10001", "applicant":{ "name":"John", "age":45 }, "amount":2000, "deposit":100, "approved":true } ] ``` -------------------------------- ### Build and Deploy to Kubernetes/Minikube Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-springboot-examples/onboarding-springboot/README.md Commands to build the service, create a Docker image, and deploy it to a Kubernetes cluster like Minikube. ```bash # make sure that the docker env from minikube is enabled locally $ eval $(minikube -p minikube docker-env) # build the service, the image and deploy it on Minikube: $ mvn clean install k8s:deploy -Pkubernetes ``` -------------------------------- ### Expose Service on Minikube Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-springboot-examples/onboarding-springboot/README.md Run this command to expose the 'onboarding-springboot' service via Node Port on Minikube. The output will provide a URL to access your service. ```shell minikube service --url onboarding-springboot ``` -------------------------------- ### Start Process Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-springboot-examples/process-business-calendar-springboot-example/README.md Initiates the credit card bill processing workflow. This endpoint starts a new instance of the 'BusinessCalendarCreditBill' process. ```APIDOC ## POST /BusinessCalendarCreditBill ### Description Starts the credit card bill processing workflow. ### Method POST ### Endpoint /BusinessCalendarCreditBill ### Request Body - **creditCardNumber** (string) - Optional - The credit card number. - **creditCardDetails** (object) - Required - Details of the credit card. - **cardNumber** (string) - Required - The card number. - **status** (string) - Required - The status of the card (e.g., "Bill Due"). ### Request Example { "creditCardNumber": null, "creditCardDetails": { "cardNumber": "434353433", "status": "Bill Due" } } ``` -------------------------------- ### Start Onboarding Employee Request Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-springboot-examples/onboarding-springboot/README.md Send a POST request to the /onboarding endpoint with employee details to initiate the onboarding process. This interacts with HR and payroll services. ```bash curl -X POST -H 'Content-Type: application/json' -d '{"employee" : {"firstName" : "Mark", "lastName" : "Test", "personalId" : "xxx-yy-zzz", "birthDate" : "1995-12-10T14:50:12.123+02:00", "address" : {"country" : "US", "city" : "Boston", "street" : "any street 3", "zipCode" : "10001"}}}' http://localhost:8080/onboarding ``` -------------------------------- ### Get User Tasks for Order Item Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/process-outbox-mongodb-quarkus/README.md Curl command to get user tasks awaiting action for a specific order item. ```shell curl -X GET http://localhost:8080/orderItems/66c11e3e-c211-4cee-9a07-848b5e861bc5/tasks?user=john ``` -------------------------------- ### POST /LoanEligibility Example Response Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/dmn-tracing-quarkus/README.md An example of the JSON response received after invoking the /LoanEligibility endpoint. This illustrates the structure of the eligibility assessment results. ```json { "Eligibility": "No", "Judgement": null, "Loan": { "duration": 0, "installment": 0 }, "SupremeDirector": "yes", "Bribe": 0, "Client": { "existing payments": 0, "salary": 0, "age": 0 }, "Is Enough?": 0, "Decide": null } ``` -------------------------------- ### Start Onboarding Process Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/onboarding-example/onboarding-quarkus/README.md Initiates the onboarding process for a new employee by sending their details to the service. The service then interacts with HR and payroll systems and returns the employee's information along with the onboarding status. Subsequent calls with the same employee ID will fail. ```APIDOC ## POST /onboarding ### Description Starts a new onboarding process for the given employee. ### Method POST ### Endpoint /onboarding ### Request Body - **employee** (object) - Required - Details of the employee to onboard. - **firstName** (string) - Required - The first name of the employee. - **lastName** (string) - Required - The last name of the employee. - **personalId** (string) - Required - The personal identification number of the employee. - **birthDate** (string) - Required - The birth date of the employee in ISO 8601 format. - **address** (object) - Required - The address of the employee. - **country** (string) - Required - The country of the address. - **city** (string) - Required - The city of the address. - **street** (string) - Required - The street of the address. - **zipCode** (string) - Required - The zip code of the address. ### Request Example ```sh curl -X POST -H 'Content-Type: application/json' -d '{"employee" : {"firstName" : "Mark", "lastName" : "Test", "personalId" : "xxx-yy-zzz", "birthDate" : "1995-12-10T14:50:12.123+02:00", "address" : {"country" : "US", "city" : "Boston", "street" : "any street 3", "zipCode" : "10001"}}}' http://localhost:8080/onboarding ``` ### Response #### Success Response (200) - **employee** (object) - All employee information, including newly generated details from HR and payroll services. - **status** (string) - The status of the onboarding request. ``` -------------------------------- ### Submit Request to Start New Timers Process (curl) Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-springboot-examples/process-timer-springboot/README.md Complete curl command to start a new timers process with a specified delay. ```bash curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"delay" : "PT30S"}' http://localhost:8080/timers ``` -------------------------------- ### Initialize Modal for Planning New Trip Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-quarkus-examples/kogito-travel-agency/extended/travels/src/main/resources/templates/index.html Sets up the 'show.bs.modal' event handler for the product modal, including form clearing and a click handler for the 'create' action. ```javascript function initModal() { $("#productModal").on('show.bs.modal', function (event) { var button = $(event.relatedTarget); var action = button.data('action'); var id = button.data('id'); var productAction = $("#productAction"); productAction.unbind(); var modal = $(this); modal.find('.modal-title').text("Plan new trip"); modal.find('#firstName').val(""); modal.find('#lastName').val(""); modal.find('#email').val(""); modal.find('#nationality').val(""); modal.find('#passportNumber').val(""); modal.find('#street').val(""); modal.find('#city').val(""); modal.find('#zipCode').val(""); modal.find('#country').val(""); modal.find('#destinationCountry').val(""); modal.find('#destinationCity').val(""); modal.find('#tripBegin').val(""); modal.find('#tripEnd').val(""); productAction.click(function () { var address = { street: $("#street").val(), city: $("#city").val(), zipCode: $("#zipCode").val(), country: $("#country").val() }; var traveller = { firstName: $("#firstName").val(), lastName: $("#lastName").val(), email: $("#email").val(), nationality: $("#nationality").val(), address: address, passportNumber: $("#passportNumber").val(), }; var trip = { country: $("#destinationCountry").val(), city: $("#destinationCity").val(), begin: $("#tripBegin").val() + 'T00:00:00.000+02:00', end: $("#tripEnd").val() + 'T00:00:00.000+02:00' }; var travelRequest = JSON.stringify({"traveller": traveller, "trip": trip}); create(travelRequest); $('#productModal').modal('toggle'); }); }) } ``` -------------------------------- ### Build and Run Custom Calendar Example (Maven) Source: https://github.com/apache/incubator-kie-kogito-examples/blob/main/kogito-springboot-examples/process-business-calendar-springboot-example/README.md Use these Maven commands to build and run the application with your custom business calendar implementation. This allows verification of your custom scheduling logic. ```sh mvn clean compile spring-boot:run ``` ```sh mvn clean package java -jar target/process-business-rules-springboot.jar ```