Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rgolangh authored and masayag committed Jul 30, 2024
1 parent ead67db commit 651ce61
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/greeting/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.4.11
version: 0.4.12

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
12 changes: 12 additions & 0 deletions charts/greeting/templates/01-configmap_greeting-props.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
data:
application.properties: |2
quarkus.flyway.migrate-at-start=true
kind: ConfigMap
metadata:
creationTimestamp: null
labels:
app: greeting
sonataflow.org/workflow-app: greeting
name: greeting-props
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
data:
greeting.sw.input-schema.json: |
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"language": {
"title": "Language",
"description": "Language to greet",
"type": "string",
"enum": ["English", "Spanish"],
"default": "English"
}
}
}
kind: ConfigMap
metadata:
creationTimestamp: null
name: 01-greeting-resources-schemas
88 changes: 88 additions & 0 deletions charts/greeting/templates/03-sonataflow_greeting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
apiVersion: sonataflow.org/v1alpha08
kind: SonataFlow
metadata:
annotations:
sonataflow.org/description: YAML based greeting workflow
sonataflow.org/expressionLang: jsonpath
sonataflow.org/profile: prod
sonataflow.org/version: "1.0"
creationTimestamp: null
labels:
app: greeting
sonataflow.org/workflow-app: greeting
name: greeting
spec:
flow:
annotations:
- workflow-type/infrastructure
dataInputSchema:
failOnValidationErrors: true
schema: schemas/greeting.sw.input-schema.json
functions:
- name: greetFunction
operation: sysout
type: custom
start:
stateName: ChooseOnLanguage
states:
- dataConditions:
- condition: ${$.[?(@.language == 'English')]}
transition:
nextState: GreetInEnglish
- condition: ${$.[?(@.language == 'Spanish')]}
transition:
nextState: GreetInSpanish
defaultCondition:
transition:
nextState: GreetInEnglish
name: ChooseOnLanguage
type: switch
- data:
greeting: 'Hello from YAML Workflow, '
name: GreetInEnglish
transition:
nextState: GreetPerson
type: inject
- data:
greeting: 'Saludos desde YAML Workflow, '
name: GreetInSpanish
transition:
nextState: GreetPerson
type: inject
- actionMode: sequential
actions:
- actionDataFilter:
useResults: true
functionRef:
arguments:
message: $.greeting $.name
invoke: sync
refName: greetFunction
name: greetAction
end:
terminate: true
name: GreetPerson
type: operation
podTemplate:
container:
resources: {}
image: quay.io/orchestrator/serverless-workflow-greeting:67f743039643807ca6e6e7a284c22658856c92c7
resources:
configMaps:
- configMap:
name: 01-greeting-resources-schemas
workflowPath: schemas
persistence:
postgresql:
secretRef:
name: sonataflow-psql-postgresql
userKey: postgres-username
passwordKey: postgres-password
serviceRef:
name: sonataflow-psql-postgresql
port: 5432
databaseName: sonataflow
databaseSchema: greeting
status:
address: {}
lastTimeRecoverAttempt: null

0 comments on commit 651ce61

Please sign in to comment.