Assign, Declare, Global Variables
This Decision Flow converts a specific amount from one currency to another using a provided exchange rate and a global rounding constant. The logic demonstrates the specific technical applications of Global Variables, Declare, and Assign nodes to manage data transformation and flow-level constants.
David Škarka
Template author
The primary objective of this flow is to convert a monetary amount from one currency to another using a provided exchange rate. It performs this calculation without additional validations to clearly showcase the mechanics of Global Variables, Declare, and Assign nodes.
Solution Components
Global Variables Node, globalVariable: Acts as an isolated configuration node. It defines constant-like values used across the flow, such as the decimals variable set to 2.
Declare Node, convertAmount: Used to define new flow variables based on upstream data. It performs the core calculation.
Assign Nodes:
assignOutput: Maps the input data and the calculated results into the final output schema.
assignOutputException: Standardizes exception handling by mapping default codes and descriptions to the output.
| Global Variables | Declare Node | Assign Node | |
| Connectivity | Isolated (no connections) | Connected up/downstream | Connected up/downstream |
| Recommended usage | Defining flow parameters (constants) | Defining new flow variables and calculations | Data transformations and calculations |
| Referencing | nodeName.varName | nodeName.varName | varName (direct reference) |
| Using previous variables defined within a node | Not allowed | Not allowed | Allowed |
More Templates
See Other Templates
A/B Testing
Discover a simple way to assign a test group for performing A/B Testing on your decisions.
Risk Based Pricing
Discover a simple way to apply a suitable Risk Based Pricing matrix based on a type of client.
Eligibility and Policy Rules
Discover a simple way to define and execute various sets of rules and get the final decision outcome.