-
Notifications
You must be signed in to change notification settings - Fork 0
Conditional execution
An action or set of actions may or may not execute based on the result of an upstream decision. Scrall provides several ways to handle this situation.
For boolean decisions the familiar if-then-else construct is available in the form of a ? : style ternary operator much like it is in programming languages like C or Python. Consequently, “if”, “then” and “else” are not keywords in Scrall though it is still probably confusing to use those words in variable names. Additionally, boolean scalar variables can be set and named conveniently to explain what a true/false condition actually means. “Cabin going down”, for example. In many situations this solution better reflects the data flow semantics and is easier to read than an elaborate if-then-else construct.
Case/switch based decisions where an enumerated type value enables an action block are handled by the the same ? : syntax used for if-then-else since there’s actually little difference to the decision other than having more than two enabling choices.
Copyright 2020, 2021, 2022, 2023, 2025 © Leon Starr under MIT Open Source License
- Why they are problematic
- Instance attribute creation values
- Boolean values
- Special values
- Enumerated values
- Action block
- Statement
- Single line action
- Multiple dependent actions on a single line
- An action spread across multiple lines
- A conditional group of single line actions
- Comments
- Finding instances
- Attribute access
- Creation and deletion
- Subclass migration
- Creating a table from a class
- Creating a table with a definition
- Converting a table into a class
- Set operations on tables
- Set comparisons on tables
- Join
- Rename
- Extend
- Aggregation
- Rank
- Image
- Input values
- Signatures and name doubling
- Output values
- Execution order
- Sequential execution
- Conditional execution
- Signals
- Scrall has no for_each action
- Iteration