Created
April 15, 2020 18:09
-
-
Save tsurdilo/a7c029dcba877cff75f919c96e3e078f to your computer and use it in GitHub Desktop.
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": "jsonservicecall", | |
"version": "1.0", | |
"name": "Service Call Workflow", | |
"description": "JSON based service call workflow", | |
"functions": [ | |
{ | |
"name": "countryInfoFunction", | |
"type": "service" | |
}, | |
{ | |
"name": "classifySmallMediumFunction", | |
"type": "service" | |
}, | |
{ | |
"name": "classifyLargeFunction", | |
"type": "service" | |
} | |
], | |
"states": [ | |
{ | |
"name": "GetCountryInfo", | |
"type": "OPERATION", | |
"start": { | |
"kind": "DEFAULT" | |
}, | |
"actionMode": "SEQUENTIAL", | |
"actions": [ | |
{ | |
"name": "getCountryInfo", | |
"functionRef": { | |
"refName": "countryInfoFunction" | |
} | |
} | |
], | |
"transition": { | |
"nextState": "ClassifyByPopulation" | |
} | |
}, | |
{ | |
"name": "ClassifyByPopulation", | |
"type": "SWITCH", | |
"choices": [ | |
{ | |
"path": "$.population", | |
"value": "20000000", | |
"operator": "LessThan", | |
"transition": { | |
"nextState": "ClassifyAsSmallOrMedium" | |
} | |
}, | |
{ | |
"path": "$.population", | |
"value": "20000000", | |
"operator": "GreaterThanEquals", | |
"transition": { | |
"nextState": "ClassifyAsLarge" | |
} | |
} | |
], | |
"default": { | |
"nextState": "ClassifyAsSmallOrMedium" | |
} | |
}, | |
{ | |
"name": "ClassifyAsSmallOrMedium", | |
"type": "OPERATION", | |
"actionMode": "SEQUENTIAL", | |
"actions": [ | |
{ | |
"name": "classifyIntoSmallOrMedium", | |
"functionRef": { | |
"refName": "classifySmallMediumFunction" | |
} | |
} | |
], | |
"end": { | |
"kind": "DEFAULT" | |
} | |
}, | |
{ | |
"name": "ClassifyAsLarge", | |
"type": "OPERATION", | |
"actionMode": "SEQUENTIAL", | |
"actions": [ | |
{ | |
"name": "classifyIntoLarge", | |
"functionRef": { | |
"refName": "classifyLargeFunction" | |
} | |
} | |
], | |
"end": { | |
"kind": "DEFAULT" | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment