Skip to content

Instantly share code, notes, and snippets.

@tsurdilo
Created April 28, 2020 02:39
Show Gist options
  • Save tsurdilo/d362c68eb224ce2cc543dd0c00f20696 to your computer and use it in GitHub Desktop.
Save tsurdilo/d362c68eb224ce2cc543dd0c00f20696 to your computer and use it in GitHub Desktop.
{
"id": "decisionworkflow",
"name": "Decision Workflow",
"version": "1.0",
"functions": [
{
"name": "doapproval",
"type": "decision",
"metadata": {
"actorid": "workflow",
"taskname": "approval"
}
}
],
"states":[
{
"name":"MakeDecision",
"type":"OPERATION",
"start": {
"kind": "DEFAULT"
},
"actionMode":"SEQUENTIAL",
"actions":[
{
"functionRef": {
"refName": "doapproval"
}
}
],
"transition": {
"nextState": "EvalDecision"
}
},
{
"name": "EvalDecision",
"type": "SWITCH",
"choices": [
{
"path": "approvaldecision.result",
"value": "approved",
"operator": "Equals",
"transition": {
"nextState": "Approve"
}
},
{
"path": "approvaldecision.result",
"value": "denied",
"operator": "Equals",
"transition": {
"nextState": "Deny"
}
}
],
"default": {
"nextState": "Approve"
}
},
{
"name":"Approve",
"type":"RELAY",
"inject": {
"decision": "Approved"
},
"end": {
"kind": "DEFAULT"
}
},
{
"name":"Deny",
"type":"RELAY",
"inject": {
"decision": "Denied"
},
"end": {
"kind": "DEFAULT"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment