### Start Kogito Example in Dev Mode Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-fault-tolerance/Readme.md Executes the Kogito application in development mode using Maven. This command is used to start the application and observe its behavior, including fault tolerance mechanisms. ```bash mvn quarkus:dev ``` -------------------------------- ### Clone KIE Examples Repository Source: https://github.com/kiegroup/kogito-examples/blob/main/README.md Clone the Apache KIE Examples repository to your local machine to start exploring the provided code examples. ```bash git clone git@github.com:apache/incubator-kie-kogito-examples.git ``` -------------------------------- ### Navigate to Serverless Workflow Example Source: https://github.com/kiegroup/kogito-examples/blob/main/README.md Change directory into the serverless-workflow-funqy example within the cloned KIE examples repository. ```bash cd ./incubator-kie-kogito-examples/serverless-workflow-examples/serverless-workflow-funqy ``` -------------------------------- ### Deploy Example on Minikube Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/README.md Deploys the serverless loan broker example. Run with 'deploy.sh true' to skip the build process. ```shell ./deploy.sh ``` -------------------------------- ### Start Workflow via HTTP Request Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-correlation-quarkus-mongodb/README.md Initiate a workflow by sending a POST request to the service endpoint. This example starts an account workflow for a specific user ID. ```sh curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' http://localhost:8080/account/12345 ``` -------------------------------- ### Install Knative Supporting Services Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-newsletter-subscription/README.md Applies Kubernetes resources for supporting services required for the example on Knative, including PostgreSQL, Jobs Service, and event-display. ```bash kubectl apply -f kubernetes/supporting-services.yml -n newsletter-showcase ``` -------------------------------- ### Deploy Example Workflows (Kogito) Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/README.md Apply the Kogito Kubernetes manifest to deploy the example workflows. This command should be executed after the Knative manifest. ```shell kubectl apply -f target/kubernetes/kogito.yml -n timeouts-showcase ``` -------------------------------- ### Install Dependencies Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-js/README.md Execute this command to install all project dependencies using Yarn. ```bash yarn install ``` -------------------------------- ### Deploy Example Workflows (Knative) Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/README.md Apply the Knative Kubernetes manifest to deploy the example workflows. This command should be executed before the Kogito manifest. ```shell kubectl apply -f target/kubernetes/knative.yml -n timeouts-showcase ``` -------------------------------- ### Start Minikube with Registry and Ingress Addons Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-operator-examples/serverless-workflow-dataindex-use-cases/README.md Start Minikube with specific configurations including CPUs, memory, and essential addons like registry, metrics-server, and ingress. Ensure insecure registries are configured if needed. ```shell minikube start --cpus 4 --memory 10240 --addons registry --addons metrics-server --addons ingress --insecure-registry "10.0.0.0/24" --insecure-registry "localhost:5000" ``` -------------------------------- ### Start Keycloak Server Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/currency-exchange-workflow/README.md Execute this script to start the Keycloak server. Ensure Keycloak is running on localhost:8281. ```sh cd serverless-workflow-oauth2-orchestration-quarkus/scripts ./startKeycloak.sh ``` -------------------------------- ### Start Minikube with Specific Configurations Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/README.md Starts a minikube instance with specified CPU, memory, and enables necessary addons like registry and metrics-server. Use insecure-registry for specific network configurations. ```shell minikube start --cpus 4 --memory 10g --addons registry --addons metrics-server --insecure-registry "10.0.0.0/24" --insecure-registry "localhost:5000" ``` -------------------------------- ### Start Minikube with Knative Profile Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/README.md Starts a Minikube instance with the Knative profile enabled. This is a prerequisite for deploying Knative services. ```shell minikube start -p knative ``` -------------------------------- ### Start Docker Compose Services Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-data-index-quarkus/README.md Start all necessary infrastructure services using Docker Compose. Ensure the project is compiled first. ```sh cd docker-compose && docker compose up ``` -------------------------------- ### Application Response Example Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-temperature-conversion/multiplication-service/README.md This is an example of the JSON response you can expect after successfully testing the multiplication service. ```json {"multiplication":{"leftElement":5.0,"rightElement":2.0,"product":10.0}} ``` -------------------------------- ### Start and Test Inventory Workflow Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-operator-examples/serverless-workflow-inventory/README.md This script retrieves the workflow address and sends a POST request to start the inventory workflow with a sample order. It then displays the response and logs the workflow's initial message. ```bash #!/bin/sh ADDRESS=$(kubectl get workflow -n my-workflows -o custom-columns="URL":.status.address.url --no-headers) curl -X POST $ADDRESS \ -H 'Content-Type:application/json' -H 'Accept:application/json' \ -d '{ "orderId": "order-123" }' ``` -------------------------------- ### Start Infrastructure Services with Shell Script Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-callback-quarkus/README.md For Linux and macOS users, this script starts the infrastructure services after the project has been compiled. Navigate to the docker-compose folder before running. ```sh cd docker compose && sh ./startServices.sh ``` -------------------------------- ### Start Docker Compose Services Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-data-index-persistence-addon-quarkus/README.md Starts the infrastructure services using Docker Compose. This command is for Linux and MacOS users and assumes the project has been compiled. ```bash cd docker-compose && ./startServices.sh ``` -------------------------------- ### Workflow Output Example Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-foreach-quarkus/README.md This is an example of the expected JSON output after the workflow has completed processing the input. ```json { "workflowdata": { "output": [ 2, 3, 4 ] } } ``` -------------------------------- ### Start Minikube Tunnel Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-custom-function-knative/README.md Start the Minikube tunnel to expose service URLs in your local environment. You may be prompted for your administrator password. ```shell # you will be asked for your admin password minikube tunnel --profile knative ``` -------------------------------- ### Build and Run Funqy Services Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-funqy/README.md Use this command to build and run the Funqy services module. The service will start on port 8082. ```sh cd sw-funqy-services mvn clean install quarkus:dev ``` -------------------------------- ### Build and Run in Production Mode Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-js/README.md Builds and optimizes the application for production. Use 'yarn start' to run the optimized application, typically at http://localhost:3000. ```bash yarn build yarn start ``` -------------------------------- ### Start Kafka Server with Docker Compose Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-events-quarkus/README.md Use this command to start a Kafka container on port 9092 using the provided docker-compose configuration. ```bash docker-compose up ``` -------------------------------- ### Install Data Index Services Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-newsletter-subscription/README.md Deploys the data index services necessary for indexing ProcessInstances and Jobs events within the Knative environment. ```bash kubectl apply -f kubernetes/data-index-services.yml -n newsletter-showcase ``` -------------------------------- ### Start Minikube Tunnel Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/README.md Starts the Minikube tunnel required for Knative services. Ensure this is run in a separate terminal. ```shell minikube tunnel -p knative ``` -------------------------------- ### Start Keycloak with Docker Compose Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/currency-exchange-workflow/README.md Alternatively, use docker-compose to start a Keycloak container on port 8281. Navigate to the docker-compose directory first. ```sh cd serverless-workflow-oauth2-orchestration-quarkus/docker-compose docker-compose up ``` -------------------------------- ### Create switch_state_timeouts Workflow Instance Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/README.md Use this cURL command to initiate a new instance of the switch_state_timeouts workflow. Ensure the base URL matches your installation. ```shell curl -X 'POST' \ 'http://timeouts-showcase-extended.timeouts-showcase.10.98.134.49.sslip.io/switch_state_timeouts' \ -H 'accept: */*' \ -H 'Content-Type: application/json' \ -d '{}' ``` -------------------------------- ### Compile and Run using Local Native Image Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-expression-quarkus/README.md Compile the application into a native executable using GraalVM. This requires GraalVM to be installed and configured. ```sh mvn clean package -Pnative ``` ```sh ./target/serverless-workflow-expression-quarkus-{version}-runner ``` -------------------------------- ### Start CloudEvent Sink Log Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-newsletter-subscription/README.md Launches a Docker container to display incoming CloudEvents, specifically the 'new subscription' event produced by the workflow. ```bash docker run --rm -it -p 8181:8080 gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/event_display ``` -------------------------------- ### Run in Development Mode Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/loanbroker-js/README.md Starts the Loan Broker JS application in development mode. The application will be accessible at http://localhost:3000. ```bash yarn dev ``` -------------------------------- ### Create Native Executable in Container Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/README.md Build a native executable within a container if GraalVM is not installed locally. ```shell mvn package -Pnative -Dquarkus.native.container-build=true ``` -------------------------------- ### Deploy Data Index Service Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-operator-examples/serverless-workflow-dataindex-use-cases/README.md Deploys the Data Index Service and its PostgreSQL backend using kustomize and kubectl. This setup is not for production. ```shell kubectl kustomize platforms/data_index_as_platform_service | kubectl apply -f - -n data-index-usecase ``` -------------------------------- ### Create Native Executable Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/README.md Build a native executable for the application. This process can be run in a container if GraalVM is not installed locally. ```shell ./mvnw package -Pnative ``` ```shell ./mvnw package -Pnative -Dquarkus.native.container-build=true ``` -------------------------------- ### Access Application URL Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/README.md The URL to access the AngularJS application after the example application has started. ```text http://localhost:8080/ ``` -------------------------------- ### Get Service URL for Workflow Timeouts Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/README.md Retrieves the URL to access the 'workflowtimeouts' service within the 'timeouts-showcase' namespace. The output is an example URL. ```shell minikube service workflowtimeouts -n timeouts-showcase --url # workflow_timeouts url output example http://192.168.49.2:31786 ``` -------------------------------- ### Create event_state_timeouts Workflow Instance Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/README.md Starts a new `event_state_timeouts` workflow instance using a POST request. The request includes an empty `workflowdata` object. ```shell curl -X 'POST' \ 'http://timeouts-showcase-embedded.default.10.98.134.49.sslip.io/event_state_timeouts' \ -H 'accept: */*' \ -H 'Content-Type: application/json' \ -d '{ "workflowdata": {} }' ``` -------------------------------- ### Get Service URL for Switch State Timeouts Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/README.md Retrieves the URL to access the 'switchstatetimeouts' service within the 'timeouts-showcase' namespace. The output is an example URL. ```shell minikube service switchstatetimeouts -n timeouts-showcase --url # switch_state_timeouts url output example http://192.168.49.2:31917 ``` -------------------------------- ### Get Service URL for Event State Timeouts Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/README.md Retrieves the URL to access the 'eventstatetimeouts' service within the 'timeouts-showcase' namespace. The output is an example URL. ```shell minikube service eventstatetimeouts -n timeouts-showcase --url # event_state_timeouts url output example http://192.168.49.2:31191 ``` -------------------------------- ### Get Service URL for Callback State Timeouts Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/README.md Retrieves the URL to access the 'callbackstatetimeouts' service within the 'timeouts-showcase' namespace. The output is an example URL. ```shell minikube service callbackstatetimeouts -n timeouts-showcase --url # callback_sate_timeouts url output example http://192.168.49.2:32750 ``` -------------------------------- ### Start Services with Standalone Data Index Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-data-index-quarkus/README.md Execute the startServices.sh script to launch all required services, including the standalone Data Index. Ensure the project is compiled first. ```sh cd docker compose && ./startServices.sh ``` -------------------------------- ### CloudEvent Structure with Correlation Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-correlation-quarkus-mongodb/README.md An example of a CloudEvent structure for starting a workflow, including the 'userid' as a correlation extension attribute. This event is published to the broker to initiate a workflow instance. ```json { "name": "newAccountEvent", "source": "", "type": "newAccountEventType", "correlation": [ { "contextAttributeName": "userid" } ] } ``` -------------------------------- ### RESTEasy JSON Serialization with Jackson Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-temperature-conversion/subtraction-service/src/main/resources/META-INF/resources/index.html This example demonstrates RESTEasy JSON serialization using Jackson. It allows listing, adding, and removing quark types from a list via REST endpoints. The provided endpoints are for GET, POST, and DELETE operations on the /resteasy-jackson/quarks/ resource. ```java [GET/POST/DELETE /resteasy-jackson/quarks/](/resteasy-jackson/quarks/) ``` -------------------------------- ### Build and Deploy to Minikube with Knative Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/README.md Build the service image and deploy it to Minikube using Knative. This involves setting up Knative, applying resources, and building the image into the Minikube registry. ```sh eval $(minikube docker-env) ``` ```sh mvn clean install -Pknative -Dnamespace= ``` ```sh kubectl apply -f target/kubernetes/*.yml ``` -------------------------------- ### Example CloudEvent Response Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-custom-function-knative/README.md This is an example of a successful response after submitting a CloudEvent. The `id` field will be unique for each submission. ```json {"id":"8dc00353-c1c6-45e9-845d-e9188d103f50","workflowdata":{"id":"response-of-org.acme.source_8dc00353-c1c6-45e9-845d-e9188d103f50","specversion":"1.0","source":"cloudEventFunction","type":"annotated"}} ``` -------------------------------- ### Delete Namespace Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/README.md Execute this command to remove the installed services and resources associated with the timeouts-showcase from your minikube installation. ```shell # Note: this command might take some seconds. kubectl delete namespace timeouts-showcase ``` -------------------------------- ### Troubleshoot Minikube Initialization Error Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/README.md These commands help resolve a common initialization error in minikube when using the knative quickstart plugin. It involves stopping and removing the knative profile, then reinstalling the plugin and the showcase. ```shell # stop the minikube minikube stop -p knative # remove the knative profile minikube delete -p knative # re-install the knative quickstart plugin kn-quickstart minikube # repeat the steps to install the showcase... ``` -------------------------------- ### Workflow Response Example Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-callback-events-over-http-quarkus/README.md Example of a successful response from the workflow service after processing the request. The 'id' field will be unique. ```json { "id":"f9a75f77-7269-4b18-93cd-2955e3406cd4", "workflowdata":{ "message":"New Event" } } ``` -------------------------------- ### Deploy Data Index Service with kubectl and kustomize Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-operator-examples/serverless-workflow-dataindex-use-cases/README.md Deploys the Data Index Service and its dependencies (like PostgreSQL) using kustomize overlays and applies them to the specified namespace. This command may take some time to complete. ```shell kubectl kustomize platforms/data_index_as_platform_service | kubectl apply -f - -n usecase2 ``` -------------------------------- ### Compile and Run gRPC Server Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-greeting-rpc-quarkus/serverless-workflow-greeting-server-rpc-quarkus/README.md Use this command to compile the project and run the gRPC server implementation. Ensure all prerequisites are met before execution. ```sh mvn compile exec:java -Dexec.mainClass="org.kie.kogito.examples.sw.greeting.GreeterService" ``` -------------------------------- ### Compile and Run using Local Native Image Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-dmn-quarkus/README.md Compile the project into a native executable using GraalVM. Ensure GRAALVM_HOME is set. ```sh mvn clean package -Pnative ``` ```sh ./target/serverless-workflow-dmn-quarkus-{version}-runner ``` -------------------------------- ### Start Workflow Curl Command Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-consuming-events-over-http-quarkus/README.md Use this curl command to send the 'start' event payload to the '/startevent' endpoint to initiate the workflow. ```sh curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"specversion":"1.0","id": "dad76364-1cf1-48ca-bf95-485a511f8707","source":"","type":"start","kogitobusinesskey": "cloud-event-test","time":"2023-01-17T15:35:29.967831-03:00","data":{"message":"Hello!"}}' http://localhost:8080/startevent ``` -------------------------------- ### Compile and Run using Local Native Image Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-greeting-quarkus/README.md Compile the application into a native executable using GraalVM. This requires GRAALVM_HOME to be set. ```sh mvn clean package -Pnative ``` ```sh ./target/sw-quarkus-greeting-{version}-runner ``` -------------------------------- ### Start Workflow Event Payload Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-consuming-events-over-http-quarkus/README.md This JSON payload is used to initiate the serverless workflow by sending a 'start' event to the '/startevent' endpoint. ```json { "specversion": "1.0", "id": "dad76364-1cf1-48ca-bf95-485a511f8707", "source": "", "type": "start", "kogitobusinesskey": "cloud-event-test", "time": "2023-01-17T15:35:29.967831-03:00", "data": { "message": "Hello!" } } ``` -------------------------------- ### Compile and Run using Local Native Image Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-oauth2-orchestration-quarkus/acme-financial-service/README.md Compile the application into a native executable using GraalVM. Ensure GRAALVM_HOME is set correctly. This provides faster startup times and lower memory consumption. ```sh mvn clean package -Pnative ``` ```sh ./target/acme-financial-service-{version}-runner ``` -------------------------------- ### Deploy Data Index Service for Use Case 1 Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-operator-examples/serverless-workflow-dataindex-use-cases/README.md Deploys the Data Index Service and PostgreSQL for Use Case 1. ```shell kubectl kustomize platforms/data_index_as_platform_service | kubectl apply -f - -n usecase1 ``` -------------------------------- ### Workflow Started Log Message Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-consuming-events-over-http-quarkus/README.md This log message indicates that a new instance of the 'start' workflow has been successfully initiated. The ID provided will be unique for each execution. ```shell Starting workflow 'start' (4a254d46-0cbf-41f8-8e27-15b3da625561) ``` -------------------------------- ### Response Example After Simulating Service Failure Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-saga-quarkus/README.md This is an example of the response received after a service failure is simulated. It shows the workflow data, including the error type for the order. ```json { "id": "13f00981-31c5-4776-a3f5-ee0595705c14", "workflowdata": { "orderId": "03e6cf79-3301-434b-b5e1-d6899b5639aa", "failService": "ShippingService", "stockResponse": { "type": "SUCCESS", "resourceId": "8cc0144b-87e0-47ed-8d8f-eedbe4b69abe" }, "paymentResponse": { "type": "SUCCESS", "resourceId": "a1068ef3-63cc-464e-820a-c049d1a5e3a6" }, "cancelPaymentResponse": { "type": "SUCCESS", "resourceId": "a1068ef3-63cc-464e-820a-c049d1a5e3a6" }, "cancelStockResponse": { "type": "SUCCESS", "resourceId": "8cc0144b-87e0-47ed-8d8f-eedbe4b69abe" }, "orderResponse": { "type": "ERROR", "resourceId": "03e6cf79-3301-434b-b5e1-d6899b5639aa" } } } ``` -------------------------------- ### Build and Run Native Image Tests Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-opentelemetry-jaeger-quarkus/README.md Use this command to build a native image and execute the full integration test suite against it. Requires GRAALVM_HOME to be set. ```sh mvn clean install -Pnative ``` -------------------------------- ### Configure Docker Environment for Minikube Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-timeouts-showcase-operator-devprofile/README.md Sets up the Docker environment for minikube to build images. This is a prerequisite for building the UI. ```shell eval $(minikube -p minikube docker-env) ``` -------------------------------- ### Example JSON Response for Traffic Violation Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-dmn-quarkus/README.md This is an example of the JSON response received after submitting a traffic violation request, including fine details and suspension decision. ```json {"workflowdata": { "Violation":{ "Type":"speed", "Speed Limit":100, "Actual Speed":120 }, "Driver":{ "Points":2 }, "Fine":{ "Points":3, "Amount":500 }, "Should the driver be suspended?":"No" } } ``` -------------------------------- ### Package and Run using Local Native Image Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-order-processing/README.md Compiles the application into a native executable using GraalVM and then runs it. This mode offers faster startup times and lower memory consumption. ```sh mvn clean package -Pnative ``` ```sh ./target/serverless-workflow-order-processing-runner ``` -------------------------------- ### Order Saga Workflow Response Example Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-saga-quarkus/README.md This is an example of a successful response from the Order Saga workflow. It details the status and resource IDs for stock, payment, shipping, and the final order. ```json { "id": "7238fc00-adb7-4d3f-acea-3c7ca2898ed6", "workflowdata": { "orderId": "03e6cf79-3301-434b-b5e1-d6899b5639aa", "failService": "none", "stockResponse": { "type": "SUCCESS", "resourceId": "48721a10-19bb-4951-b11d-6ffb8438452e" }, "paymentResponse": { "type": "SUCCESS", "resourceId": "638a83e8-d407-4761-8c9a-7c1affda7dd5" }, "shippingResponse": { "type": "SUCCESS", "resourceId": "1ceea89a-c6ba-4bc0-bf06-49f9560ffe43" }, "orderResponse": { "type": "SUCCESS", "resourceId": "03e6cf79-3301-434b-b5e1-d6899b5639aa" } } } ``` -------------------------------- ### Compile Application with Maven Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-newsletter-subscription/README.md Use this command to compile the entire application locally. It skips tests to speed up the build process. ```bash mvn clean install -DskipTests ``` -------------------------------- ### Deploy Workflow for Use Case 1 Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-operator-examples/serverless-workflow-dataindex-use-cases/README.md Applies the kustomization for the 'usecase1' to deploy the associated workflow. ```shell kubectl kustomize usecases/usecase1 | kubectl apply -f - -n usecase1 ``` -------------------------------- ### Response with Compensation Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-compensation-quarkus/README.md Example of a successful response when compensation is triggered. ```json { "id": "b1e8ce8d-2fc5-4d39-b3b3-6f7dddbb1515", "workflowdata": { "shouldCompensate": true, "compensated": "true" "compensating_more": "Real Betis Balompie" } } ``` -------------------------------- ### Deploy Workflows with kubectl and kustomize Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-operator-examples/serverless-workflow-dataindex-use-cases/README.md Deploys the specified Kogito workflows (e.g., greeting, helloworld) using kustomize and applies the configuration to the target namespace. Allow time for the SonataFlow operator to build and deploy. ```shell kubectl kustomize usecases/usecase2 | kubectl apply -f - -n usecase2 ``` -------------------------------- ### Response without Compensation Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-compensation-quarkus/README.md Example of a successful response when compensation is not triggered. ```json { "id": "c106c3f9-8a21-44c0-83df-1191b6a04672", "workflowdata": { "shouldCompensate": false, "compensated": false } } ``` -------------------------------- ### Run Dev Mode with Data Index Addon Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-data-index-quarkus/README.md Starts the application in dev mode with the Data Index functionality exposed as part of the runtime service. The Data Index GraphQL UI will be available at http://localhost:8080/q/graphql-ui/ ```sh mvn clean package quarkus:dev -Pdata-index-addon ``` -------------------------------- ### List Knowledge Database Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-answer-service/README.md Sends a GET request to retrieve the contents of the knowledge database. ```sh curl -X 'GET' 'http://localhost:8080/queries' -H 'accept: application/json' ``` -------------------------------- ### JSON Workflow Output Log Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-greeting-quarkus/README.md Example log output from the JSON workflow after a successful request. ```json {"id":"541a5363-1667-4f6d-a8b4-1299eba81eac","workflowdata":{"name":"John","language":"English","greeting":"Hello from JSON Workflow, "}} ``` -------------------------------- ### Run Native Executable Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-service-calls-quarkus/README.md Execute the native binary generated after the native image compilation. ```text ./target/serverless-workflow-service-calls-runner ``` -------------------------------- ### Delete Service with Knative CLI Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-timeouts-showcase-embedded/README.md Execute this command to remove the timeouts showcase service from your minikube installation. ```shell kn service delete timeouts-showcase-embedded ``` -------------------------------- ### Deploy Subscription Workflow on Knative Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-newsletter-subscription/README.md Applies the Kubernetes and Kogito configurations to deploy the subscription-flow service on Knative. ```bash kubectl apply -f subscription-flow/target/kubernetes/knative.yml -n newsletter-showcase ``` ```bash kubectl apply -f subscription-flow/target/kubernetes/kogito.yml -n newsletter-showcase ``` -------------------------------- ### Compile and Run using Local Native Image Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-functions-events-quarkus/README.md Compile the application into a native executable using GraalVM. This mode offers faster startup times and lower memory consumption. ```sh mvn clean package -Pnative ``` ```sh ./target/serverless-workflow-functions-quarkus-runner.jar ``` -------------------------------- ### Run Native Executable Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/README.md Execute the native binary generated after compiling with the native profile. ```sh ./target/query-service-{version}-runner ``` -------------------------------- ### Received Message Log Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-consuming-events-over-http-quarkus/README.md This log output shows the 'message' data received from the initial 'start' event. ```shell [ "Hello" ] ``` -------------------------------- ### Get Service URL from Minikube Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-operator-examples/serverless-workflow-dataindex-use-cases/README.md Obtains the external URL for a service exposed via NodePort on Minikube. ```shell minikube service greeting --url -n usecase1 ``` -------------------------------- ### Run Application in Dev Mode Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-loanbroker-showcase/aggregator/README.md Use this command to run the application in development mode, which enables live coding. Access the Dev UI at http://localhost:8080/q/dev/. ```shell ./mvnw compile quarkus:dev ``` -------------------------------- ### Workflow Service Response Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-custom-function-knative/README.md Example of a successful response from the workflow service after processing a request. The 'id' field will vary. ```json {"id":"87cf8275-782d-4e0b-a9be-a95f95c9c190","workflowdata":{"name":"Kogito","greeting":"Greetings from Serverless Workflow, Kogito"}} ``` -------------------------------- ### Run Native Executable Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-temperature-conversion/conversion-workflow/README.md Execute the native binary generated in the target directory after compilation. ```bash ./target/conversion-workflow-runner ``` -------------------------------- ### Get Service URL Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-timeouts-showcase-extended/README.md Execute this command to retrieve the URL for accessing the deployed service, specifically filtering for 'timeouts-showcase-extended'. ```shell kn service list -n timeouts-showcase | grep timeouts-showcase-extended ``` -------------------------------- ### Display Docker Compose Help Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-data-index-persistence-addon-quarkus/docker-compose/README.md Shows the help message for Docker Compose, listing all available commands and options. Useful for understanding its capabilities. ```bash docker-compose --help ``` -------------------------------- ### List Pending Queries Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-qas-service-showcase/query-service/README.md Submit a GET request to the query service endpoint to retrieve a list of all pending queries. ```sh curl -X 'GET' 'http://localhost:8283/query-service' -H 'accept: application/json' ``` -------------------------------- ### Create Knative Namespace Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-custom-function-knative/README.md Create a Kubernetes namespace named 'custom-functions'. This namespace is crucial for inter-service communication within the example. ```shell # The namespace name is very important to ensure all the services that compose the example can interact. kubectl create ns custom-functions ``` -------------------------------- ### Apply Subscription Service Deployment Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-newsletter-subscription/README.md Deploys the subscription service using its Knative YAML configuration. Ensure you are in the correct directory context. ```shell kubectl apply -f subscription-service/target/kubernetes/knative.yml -n newsletter-showcase ``` -------------------------------- ### Compile for Native Image Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-data-index-quarkus/README.md Compile the project into a native executable. Ensure GRAALVM_HOME is set correctly. ```sh mvn clean package -Dnative ``` -------------------------------- ### POST /order_saga_error_workflow Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-saga-quarkus/README.md Starts a new Order Saga with the provided data. The response indicates the success or failure of each step in the saga. ```APIDOC ## POST /order_saga_error_workflow ### Description Allows to start a new Order Saga with the given data. ### Method POST ### Endpoint /order_saga_error_workflow ### Parameters #### Request Body - **orderId** (string) - Required - The ID of the order. - **failService** (string) - Required - Specifies which service to fail, if any (e.g., "none", "stock", "payment", "shipping"). ### Request Example ```json { "orderId": "03e6cf79-3301-434b-b5e1-d6899b5639aa", "failService": "none" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the workflow instance. - **workflowdata** (object) - Contains the data and responses from each step of the workflow. - **orderId** (string) - The ID of the order. - **failService** (string) - The service that was designated to fail. - **stockResponse** (object) - The response from the stock service. - **type** (string) - The status of the stock reservation (e.g., "SUCCESS", "FAILURE"). - **resourceId** (string) - The ID of the reserved stock resource. - **paymentResponse** (object) - The response from the payment service. - **type** (string) - The status of the payment processing (e.g., "SUCCESS", "FAILURE"). - **resourceId** (string) - The ID of the payment transaction. - **shippingResponse** (object) - The response from the shipping service. - **type** (string) - The status of the shipping scheduling (e.g., "SUCCESS", "FAILURE"). - **resourceId** (string) - The ID of the shipping order. - **orderResponse** (object) - The final response for the order. - **type** (string) - The final status of the order (e.g., "SUCCESS", "FAILURE"). - **resourceId** (string) - The ID of the order. #### Response Example ```json { "id": "7238fc00-adb7-4d3f-acea-3c7ca2898ed6", "workflowdata": { "orderId": "03e6cf79-3301-434b-b5e1-d6899b5639aa", "failService": "none", "stockResponse": { "type": "SUCCESS", "resourceId": "48721a10-19bb-4951-b11d-6ffb8438452e" }, "paymentResponse": { "type": "SUCCESS", "resourceId": "638a83e8-d407-4761-8c9a-7c1affda7dd5" }, "shippingResponse": { "type": "SUCCESS", "resourceId": "1ceea89a-c6ba-4bc0-bf06-49f9560ffe43" }, "orderResponse": { "type": "SUCCESS", "resourceId": "03e6cf79-3301-434b-b5e1-d6899b5639aa" } } } ``` ``` -------------------------------- ### Run Subscription Workflow Locally Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-workflow-examples/serverless-workflow-newsletter-subscription/README.md Starts the Subscription Workflow application locally. This orchestrates the newsletter subscription use case. ```bash java -jar subscription-flow/target/quarkus-app/quarkus-run.jar ``` -------------------------------- ### Create Workflow Instance Source: https://github.com/kiegroup/kogito-examples/blob/main/serverless-operator-examples/serverless-workflow-dataindex-use-cases/README.md Sends a POST request to create a new instance of the 'greeting' workflow with specified JSON payload. ```shell curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"name": "John", "language": "English"}' http://192.168.49.2:32407/greeting ```