beginnerEasy Start
Switch, End
This flow demonstrates the use of the Switch and End nodes. The example is illustrative (i.e., it has no business value). By changing the input data, you can easily discover the role of the Switch and its two different winning case strategies.
David Škarka
Template author
The primary goal of this rule flow is to demonstrate the practical application of the Switch node and the End node. It specifically highlights the two different evaluation strategies available for managing conditional logic and how the End node provides a visual and data-driven conclusion to a process.
This flow is for illustrative purposes and serves as a technical template rather than a business-specific logic set.
Solution Components
The flow consists of several specialized nodes that categorize and process input data to produce specific outputs.
The core logic is divided into two parallel demonstrations of the Switch node:
- Switch with the strategy: All Winning Cases (switchAllWinningCases):
- Behavior: This node evaluates every defined case against the input data. It executes and identifies all cases where conditions are met. If no conditions are met, it triggers the "Default" case.
- Switch with the strategy: First Winning Case (switchFirstWinningCase):
- Behavior: This node stops evaluation as soon as it finds the first case that meets the specified conditions. Like the previous strategy, it falls back to a "Default" case if no matches are found.
- assignAllWinningCases: Maps the results from the "All Winning" switch into the output.allWinningCases variable.
- assignFirstWinningCase: Maps the result from the "First Winning" switch into the output.firstWinningCase variable.
- Visual Indicators: Clearly marking the end of a specific logic branch or the entire flow.
- Data Insight: Providing a snapshot of the final data state for that specific branch during debugging or execution.
By interacting with this flow, users can learn to:
- Select Evaluation Strategies: Understand when to use "All Winning" (for multi-match scenarios) versus "First Winning" (for prioritized, mutually exclusive scenarios).
- Utilize Default Paths: Implement fallback logic when no conditions are satisfied.
- Visual Flow Management: Use the End node to organize complex flows and inspect data states at the conclusion of branches.
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.
financial servicessuggested
Risk Based Pricing
Discover a simple way to apply a suitable Risk Based Pricing matrix based on a type of client.
financial servicessuggested
Eligibility and Policy Rules
Discover a simple way to define and execute various sets of rules and get the final decision outcome.