This is an automated email from the ASF dual-hosted git repository.

dhanak pushed a commit to branch 1.44.x
in repository 
https://gitbox.apache.org/repos/asf/incubator-kie-kogito-examples.git


The following commit(s) were added to refs/heads/1.44.x by this push:
     new 95c73927f KOGITO-9971: Adding Data-index with operator use cases 
(#1839) (#1841)
95c73927f is described below

commit 95c73927fe280437380bd9e4c9e5b5b222d5d8bb
Author: nmirasch <[email protected]>
AuthorDate: Thu Feb 8 10:14:37 2024 +0100

    KOGITO-9971: Adding Data-index with operator use cases (#1839) (#1841)
    
    * KOGITO-9971: Adding Data-index with operator use cases
    
    * KOGITO-9971: Adding Data-index with operator use cases
    
    * Removing platform resources regarding they are provided by the default 
swf-builder
    
    (cherry picked from commit 330cb7ad87d9884210ee920b5d58867f62edbeb1)
---
 .../README.md                                      | 413 +++++++++++++++++++++
 .../infra/dataindex/01-postgres.yaml               |  72 ++++
 .../infra/dataindex/02-dataindex.yaml              |  92 +++++
 .../infra/dataindex/application.properties         |  10 +
 .../infra/dataindex/kustomization.yaml             |  17 +
 .../01-service-discovery-role.yaml                 |  36 ++
 .../02-service-discovery-rolebinding.yaml          |  11 +
 .../infra/service_discovery/kustomization.yaml     |   3 +
 .../usecases/usecase1/kustomization.yaml           |   3 +
 .../usecases/usecase2/kustomization.yaml           |   4 +
 .../02-configmap_greeting-props.yaml               |  23 ++
 .../03-sonataflow_greeting.yaml                    |  42 +++
 .../sonataflow-greeting/kustomization.yaml         |   3 +
 .../02-configmap_helloworld-props.yaml             |  23 ++
 .../03-sonataflow_helloworld.yaml                  |  21 ++
 .../sonataflow-helloworld/kustomization.yaml       |   3 +
 16 files changed, 776 insertions(+)

diff --git 
a/serverless-operator-examples/serverless-workflow-dataindex-use-cases/README.md
 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/README.md
new file mode 100644
index 000000000..7e62500bd
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/README.md
@@ -0,0 +1,413 @@
+# SonataFlow Data Index Use Cases 
+
+Collection of artifacts to test SonataFlow Use Cases TP2.
+
+## Prereqs for all the use cases
+
+1. Minikube installed
+
+We recommend that you start Minikube with the following parameters, note that 
the `registry` addon must be enabled.
+
+```shell
+minikube start --cpus 4 --memory 10240 --addons registry --addons 
metrics-server --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:
+
+```shell
+minikube addons list | grep registry
+```
+
+```
+| registry                    | minikube | enabled ✅   | Google                
         |
+| registry-aliases            | minikube | disabled     | 3rd party (unknown)  
          |
+| registry-creds              | minikube | disabled     | 3rd party (UPMC 
Enterprises)   |
+```
+
+
+2. kubectl installed
+
+3. SonataFlow operator installed if workflows are deployed
+
+To install the operator you can see [SonataFlow 
Installation](https://sonataflow.org/serverlessworkflow/latest/cloud/operator/install-serverless-operator.html).
+
+## Use cases
+
+This is the list of available use cases:
+
+| Use case                                                | Description        
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
              [...]
+|---------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 [...]
+| [Deploy Data Index Locally](#deploy-data-index-locally) | This use case 
deploys: <br/> * PostgreSQL Service<br/> * Data Index Service + postgresdb<br/> 
                                                                                
                                                                                
                                                                                
                                                                                
                   [...]
+| [Use case 1](#use-case-1)                               | This use case 
deploys: <br/> * PostgreSQL Service<br/> * Data Index Service + postgresdb<br/> 
*  The `greeting` workflow (no persistence) configured to register the process 
events on the Data Index Service.                                               
                                                                                
                                                                                
                    [...]
+| [Use case 2](#use-case-2)                               | This use case 
deploys: <br/> * PostgreSQL Service<br/> * Data Index Service + postgresdb<br/> 
*  The `greeting` workflow (no persistence) <br/> * The `helloworkflow` (no 
persistence)<br/> * Workflows are configured to register the process events on 
the Data Index Service.                                                         
                                                                                
                        [...]
+
+> **NOTE:** To facilitate the switch between use cases, it's strongly 
recommended to install each use case in a dedicated namespace.
+
+## Deploy Data Index locally
+
+Example of how to deploy Data Index on Kubernetes that uses a Postgresql DB.
+
+> **NOTE:** The workflow related use cases that needs a data index service 
already includes this step.
+
+### Procedure
+
+Open a terminal and run the following commands:
+
+1. Create the namespace:
+
+```shell
+kubectl create namespace data-index-usecase
+```
+
+2. Deploy the Data Index Service:
+
+```shell
+kubectl kustomize infra/dataindex | 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
+```
+
+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)
+Data Index will be backed by a Postgres Data Base deployment. **This setup is 
not intended for production environments** since this simple Postgres 
Deployment does not scale well. Please see the [Postgres 
Operator](https://github.com/zalando/postgres-operator) for more information.
+
+
+To check that the data index is running you can execute this command.
+
+```shell
+kubectl get pod -n data-index-usecase
+```
+
+```
+data-index-service-postgresql-5d76dc4468-69hm6   1/1     Running   0           
   2m11s
+postgres-7f78499688-j6282                        1/1     Running   0           
   2m11s
+```
+
+To access the Data Index, using Minikube you can run:
+
+```shell
+minikube service data-index-service-postgresql --url -n data-index-usecase 
+```
+
+Example output:
+```
+http://192.168.49.2:30352
+```
+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.)
+
+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.
+
+To execute queries see: [Querying Index Queries](#querying-data-index)
+
+3. Clean the use case:
+
+```shell
+kubectl delete namespace data-index-usecase
+```
+
+## Use case 1
+
+This use case is intended to represent an installation with:
+
+* A singleton Data Index Service with PostgreSQL persistence
+* The `greeting` workflow (no persistence), that is configured to register 
events to the Data Index Service.
+
+### Procedure
+
+Open a terminal and run the following commands:
+
+1. Create the namespace:
+
+```shell
+kubectl create namespace usecase1
+```
+
+2. Deploy the Data Index Service:
+```shell
+kubectl kustomize infra/dataindex | 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
+
+```
+
+Give some time for the data index to start, you can check that it's running by 
executing.
+
+```shell
+kubectl get pod -n usecase1
+```
+
+```
+NAME                                             READY   STATUS    RESTARTS    
   AGE
+data-index-service-postgresql-5d76dc4468-lb259   1/1     Running   0           
   2m11s
+postgres-7f78499688-lc8n6                        1/1     Running   0           
   2m11s
+```
+
+3. Deploy the workflow:
+
+```shell
+ kubectl kustomize usecases/usecase1 | kubectl apply -f - -n usecase1
+ ```
+
+```
+configmap/greeting-props created
+sonataflow.sonataflow.org/greeting created
+```
+
+Give some time for the sonataflow operator to build and deploy the workflow.
+To check that the workflow is ready you can use this command.
+
+```shell
+kubectl get workflow -n usecase1
+```
+
+```
+NAME       PROFILE   VERSION   URL   READY   REASON
+greeting             0.0.1           True    
+```
+
+4. Expose the workflow and get the url:
+
+```shell
+kubectl patch svc greeting -p '{"spec": {"type": "NodePort"}}' -n usecase1
+```
+
+```shell
+ minikube service greeting --url -n usecase1
+ ```
+
+5. Create a workflow instance:
+
+You must use the URLs calculated in step 4.
+
+```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
+```
+
+**To execute queries and see the workflows information see:** [Querying Index 
Queries](#querying-data-index)
+
+
+6. Clean the use case:
+
+```shell
+kubectl delete namespace usecase1
+```
+
+## Use case 2
+
+This use case is intended to represent an installation with:
+
+* A singleton Data Index Service with PostgreSQL persistence
+* The `greeting` workflow (no persistence)
+* The `helloworkflow` workflow (no persistence)
+* The workflows are configured to register the process events on the Data 
Index Service.
+
+### Procedure
+
+Open a terminal and run the following commands:
+
+1. Create the namespace:
+
+```shell
+kubectl create namespace usecase2
+```
+
+2. Deploy the Data Index Service:
+```shell
+kubectl kustomize infra/dataindex | 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
+
+```
+
+Give some time for the data index to start, you can check that it's running by 
executing.
+
+```shell
+kubectl get pod -n usecase2
+```
+
+```
+NAME                                             READY   STATUS    RESTARTS    
   AGE
+data-index-service-postgresql-5d76dc4468-lb259   1/1     Running   0           
   2m11s
+postgres-7f78499688-lc8n6                        1/1     Running   0           
   2m11s
+```
+
+3. Deploy the workflows:
+
+```shell
+ kubectl kustomize usecases/usecase2 | kubectl apply -f - -n usecase2
+ ```
+
+```
+configmap/greeting-props created
+configmap/helloworld-props created
+sonataflow.sonataflow.org/greeting created
+sonataflow.sonataflow.org/helloworld created
+```
+
+Give some time for the sonataflow operator to build and deploy the workflows.
+To check that the workflows are ready you can use this command.
+
+```shell
+kubectl get workflow -n usecase2
+```
+
+```
+NAME       PROFILE   VERSION   URL   READY   REASON
+greeting             0.0.1           True
+helloworld           0.0.1           True        
+```
+
+4. Expose the workflows and get the urls:
+
+```shell
+kubectl patch svc greeting helloworld  -p '{"spec": {"type": "NodePort"}}' -n 
usecase2
+```
+
+```shell
+ minikube service greeting --url -n usecase2
+ ```
+
+```shell
+ minikube service helloworld --url -n usecase2
+ ```
+
+5. Create a workflow instances:
+
+You must use the URLs calculated in step 4.
+
+```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
+```
+
+```shell
+curl -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' 
-d '{}'    http://192.168.49.2:32327/helloworld
+```
+
+**To execute queries and see the workflows information see:** [Querying Index 
Queries](#querying-data-index)
+
+6. Clean the use case:
+
+```shell
+kubectl delete namespace usecase2
+```
+
+## Querying Data Index
+
+You can use the public Data Index endpoint to play around with the GraphiQL 
interface.
+
+### Procedure
+
+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
+```
+
+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.
+
+
+To see the process instances information you can execute this query:
+
+```graphql
+{
+  ProcessInstances {
+    id,
+    processId,
+    processName,
+    variables,
+    state,
+    endpoint,
+    serviceUrl,
+    start,
+    end
+  }
+}
+```
+
+The results should be something like:
+
+
+```json
+{
+  "data": {
+    "ProcessInstances": [
+      {
+        "id": "3ed8bf63-85c9-425d-9099-49bfb63608cb",
+        "processId": "greeting",
+        "processName": "workflow",
+        "variables": 
"{\"workflowdata\":{\"name\":\"John\",\"greeting\":\"Hello from JSON Workflow, 
\",\"language\":\"English\"}}",
+        "state": "COMPLETED",
+        "endpoint": "/greeting",
+        "serviceUrl": "http://greeting";,
+        "start": "2023-09-13T06:59:24.319Z",
+        "end": "2023-09-13T06:59:24.400Z"
+      }
+    ]
+  }
+}
+```
+
+To see the jobs instances information, if any, you can execute this query:
+
+```graphql
+{
+  Jobs {
+    id,
+    processId,
+    processInstanceId,
+    status,
+    expirationTime,
+    retries,
+    endpoint,
+    callbackEndpoint
+  }
+}
+```
+
+The results should be something like:
+
+```json
+{
+  "data": {
+    "Jobs": [
+      {
+        "id": "55c7aadb-3dff-4b97-af8e-cc45014b1c0d",
+        "processId": "callbackstatetimeouts",
+        "processInstanceId": "299886b7-2b78-4965-a701-16783c4162d8",
+        "status": "EXECUTED",
+        "expirationTime": null,
+        "retries": 0,
+        "endpoint": "http://jobs-service-postgresql/jobs";,
+        "callbackEndpoint": 
"http://callbackstatetimeouts:80/management/jobs/callbackstatetimeouts/instances/299886b7-2b78-4965-a701-16783c4162d8/timers/-1";
+      }
+    ]
+  }
+}
+```
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/infra/dataindex/01-postgres.yaml
new file mode 100644
index 000000000..2221b70b3
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/01-postgres.yaml
@@ -0,0 +1,72 @@
+---
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  labels:
+    app.kubernetes.io/name: postgres
+  name: postgres-pvc
+spec:
+  accessModes:
+    - ReadWriteOnce
+  resources:
+    requests:
+      storage: 1Gi
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  labels:
+    app.kubernetes.io/name: postgres
+  name: postgres
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app.kubernetes.io/name: postgres
+  template:
+    metadata:
+      labels:
+        app.kubernetes.io/name: postgres
+    spec:
+      containers:
+        - name: postgres
+          image: postgres:13.2-alpine
+          imagePullPolicy: 'IfNotPresent'
+          ports:
+            - containerPort: 5432
+          volumeMounts:
+            - name: storage
+              mountPath: /var/lib/postgresql/data
+          envFrom:
+            - secretRef:
+                name: postgres-secrets
+          readinessProbe:
+            exec:
+              command: ["pg_isready"]
+            initialDelaySeconds: 15
+            timeoutSeconds: 2
+          livenessProbe:
+            exec:
+              command: ["pg_isready"]
+            initialDelaySeconds: 15
+            timeoutSeconds: 2
+          resources:
+            limits:
+              memory: "256Mi"
+              cpu: "500m"
+      volumes:
+      - name: storage
+        persistentVolumeClaim:
+          claimName: postgres-pvc
+---
+apiVersion: v1
+kind: Service
+metadata:
+  labels:
+    app.kubernetes.io/name: postgres
+  name: postgres
+spec:
+  selector:
+    app.kubernetes.io/name: postgres
+  ports:
+    - port: 5432
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
new file mode 100644
index 000000000..6e2733670
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/02-dataindex.yaml
@@ -0,0 +1,92 @@
+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
new file mode 100644
index 000000000..ac88f78db
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/application.properties
@@ -0,0 +1,10 @@
+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/dataindex/kustomization.yaml
 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/kustomization.yaml
new file mode 100644
index 000000000..d475d83f8
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/dataindex/kustomization.yaml
@@ -0,0 +1,17 @@
+resources:
+- 01-postgres.yaml
+- 02-dataindex.yaml
+
+secretGenerator:
+  - name: postgres-secrets
+    literals:
+      - POSTGRES_USER=sonataflow
+      - POSTGRES_PASSWORD=sonataflow
+      - POSTGRES_DB=sonataflow
+      - PGDATA=/var/lib/postgresql/data/mydata
+
+configMapGenerator:
+  - name: dataindex-properties
+    files:
+      - application.properties
+
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
new file mode 100644
index 000000000..d337d25d3
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/service_discovery/01-service-discovery-role.yaml
@@ -0,0 +1,36 @@
+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
new file mode 100644
index 000000000..f96435a5f
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/service_discovery/02-service-discovery-rolebinding.yaml
@@ -0,0 +1,11 @@
+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
new file mode 100644
index 000000000..13ad16a3e
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/infra/service_discovery/kustomization.yaml
@@ -0,0 +1,3 @@
+resources:
+- 01-service-discovery-role.yaml
+- 02-service-discovery-rolebinding.yaml
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
new file mode 100644
index 000000000..c88a2e06d
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/usecases/usecase1/kustomization.yaml
@@ -0,0 +1,3 @@
+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
new file mode 100644
index 000000000..6ea98cd8e
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/usecases/usecase2/kustomization.yaml
@@ -0,0 +1,4 @@
+resources:
+- ../../infra/service_discovery
+- ../../workflows/sonataflow-greeting
+- ../../workflows/sonataflow-helloworld
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
new file mode 100644
index 000000000..bdc8cff3b
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-greeting/02-configmap_greeting-props.yaml
@@ -0,0 +1,23 @@
+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/03-sonataflow_greeting.yaml
 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-greeting/03-sonataflow_greeting.yaml
new file mode 100644
index 000000000..f0236a743
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-greeting/03-sonataflow_greeting.yaml
@@ -0,0 +1,42 @@
+apiVersion: sonataflow.org/v1alpha08
+kind: SonataFlow
+metadata:
+  name: greeting
+  annotations:
+    sonataflow.org/description: Greeting example on k8s!
+    sonataflow.org/version: 0.0.1
+spec:
+  flow:
+    start: ChooseOnLanguage
+    functions:
+      - name: greetFunction
+        type: custom
+        operation: sysout
+    states:
+      - name: ChooseOnLanguage
+        type: switch
+        dataConditions:
+          - condition: "${ .language == \"English\" }"
+            transition: GreetInEnglish
+          - condition: "${ .language == \"Spanish\" }"
+            transition: GreetInSpanish
+        defaultCondition: GreetInEnglish
+      - name: GreetInEnglish
+        type: inject
+        data:
+          greeting: "Hello from JSON Workflow, "
+        transition: GreetPerson
+      - name: GreetInSpanish
+        type: inject
+        data:
+          greeting: "Saludos desde JSON Workflow, "
+        transition: GreetPerson
+      - name: GreetPerson
+        type: operation
+        actions:
+          - name: greetAction
+            functionRef:
+              refName: greetFunction
+              arguments:
+                message:  ".greeting+.name"
+        end: true
\ No newline at end of file
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
new file mode 100644
index 000000000..36b47a72e
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-greeting/kustomization.yaml
@@ -0,0 +1,3 @@
+resources:
+- 02-configmap_greeting-props.yaml
+- 03-sonataflow_greeting.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
new file mode 100644
index 000000000..5046c1ed9
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-helloworld/02-configmap_helloworld-props.yaml
@@ -0,0 +1,23 @@
+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/03-sonataflow_helloworld.yaml
 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-helloworld/03-sonataflow_helloworld.yaml
new file mode 100644
index 000000000..ed8dd5438
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-helloworld/03-sonataflow_helloworld.yaml
@@ -0,0 +1,21 @@
+apiVersion: sonataflow.org/v1alpha08
+kind: SonataFlow
+metadata:
+  name: helloworld
+  annotations:
+    sonataflow.org/description: Hello World Workflow
+    sonataflow.org/version: 0.0.1
+spec:
+  flow:
+    start: Inject Hello World
+    states:
+      - name: Inject Hello World
+        type: inject
+        data:
+          greeting: Hello World
+        transition: Inject Mantra
+      - name: Inject Mantra
+        type: inject
+        data:
+          mantra: Serverless Workflow is awesome!
+        end: true
\ No newline at end of file
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
new file mode 100644
index 000000000..20cb06529
--- /dev/null
+++ 
b/serverless-operator-examples/serverless-workflow-dataindex-use-cases/workflows/sonataflow-helloworld/kustomization.yaml
@@ -0,0 +1,3 @@
+resources:
+- 02-configmap_helloworld-props.yaml
+- 03-sonataflow_helloworld.yaml


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to