Created
June 13, 2023 06:54
-
-
Save fantonangeli/9ce405871a2fff8b557990e052130a84 to your computer and use it in GitHub Desktop.
Greeting workflow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "jsongreet", | |
"version": "1.0", | |
"specVersion": "0.8", | |
"name": "Greeting workflow", | |
"description": "JSON based greeting workflow", | |
"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": { | |
"transition": "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": { | |
"terminate": true | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment