beginnerEasy Start

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.

DecisionRules

David Škarka

Template author

 This flow is designed as a functional demonstration of how different variable nodes operate within the system while performing a real-world currency conversion task.

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
The flow orchestrates the conversion process through several specialized nodes, each serving a distinct purpose in data handling and calculation:
  • 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.

Node Comparison Guidelines


Global VariablesDeclare NodeAssign Node
ConnectivityIsolated (no connections)Connected up/downstreamConnected up/downstream
Recommended usageDefining flow parameters (constants)Defining new flow variables and calculationsData transformations and calculations
ReferencingnodeName.varNamenodeName.varNamevarName (direct reference)
Using previous variables defined within a nodeNot allowedNot allowedAllowed
Check iconA checkmark inside a circle signifying "yes"Minus iconA minus inside a circle signifying "no"PROS IconA plus symbol representing positive aspects or benefits.CONS IconA minus symbol representing negative aspects or drawbacks.

More Templates

See Other Templates

financial servicessuggested

A/B Testing

Discover a simple way to assign a test group for performing A/B Testing on your decisions.

Explore
financial servicessuggested

Risk Based Pricing

Discover a simple way to apply a suitable Risk Based Pricing matrix based on a type of client.

Explore
financial servicessuggested

Eligibility and Policy Rules

Discover a simple way to define and execute various sets of rules and get the final decision outcome.

Explore