Last active
December 14, 2020 21:09
-
-
Save ricardozanini/0632f34d3f1f75717d7c3eac165ce95f to your computer and use it in GitHub Desktop.
Fahrenheit to Celsius Conversion Workflow
This file contains hidden or 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": "fahrenheit_to_celsius", | |
"name": "Fahrenheit to Celsius Conversion Flow", | |
"version": "v1.0", | |
"functions": [ | |
{ | |
"name": "multiplication", | |
"resource": "/", | |
"type": "rest", | |
"metadata": { | |
"method": "POST" | |
} | |
}, | |
{ | |
"name": "subtraction", | |
"resource": "/", | |
"type": "rest", | |
"metadata": { | |
"method": "POST" | |
} | |
} | |
], | |
"states": [ | |
{ | |
"start": { | |
"kind": "default" | |
}, | |
"name": "SetConstants", | |
"type": "inject", | |
"data": { | |
"subtractValue": "32.0", | |
"multiplyValue": "0.5556" | |
}, | |
"transition": { | |
"nextState": "Computation" | |
} | |
}, | |
{ | |
"name": "Computation", | |
"actionMode": "sequential", | |
"type": "operation", | |
"actions": [ | |
{ | |
"name": "subtract32", | |
"functionRef": { | |
"refName": "subtraction", | |
"parameters": { | |
"leftElement": "$.fahrenheit", | |
"rightElement": "$.subtractValue" | |
} | |
} | |
}, | |
{ | |
"name": "multiplyByFiveNinth", | |
"functionRef": { | |
"refName": "multiplication", | |
"parameters": { | |
"leftElement": "$.subtraction.difference", | |
"rightElement": "$.multiplyValue" | |
} | |
} | |
} | |
], | |
"transition": { | |
"nextState": "FormatResult" | |
} | |
}, | |
{ | |
"name": "FormatResult", | |
"type": "inject", | |
"data": { | |
"celsius": "$.multiplication.product" | |
}, | |
"end": { | |
"kind": "terminate" | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment