Created
April 28, 2020 02:39
-
-
Save tsurdilo/d362c68eb224ce2cc543dd0c00f20696 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": "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