Conditionals
Conditional logic is currently available in Interactor as an alpha feature.
Feature | If Condition | If Value | Case Condition | Case Value |
---|---|---|---|---|
Evaluation | Logical expression | Specific value | Multiple logical checks | Multiple value checks |
Complexity | Simple logic | Simple value matching | Complex logic branching | Value-based branching |
Use Case | Single decision path | Single value check | Multi-path branching | Multi-path branching |
IF - Condition
This evaluates a logical condition (true/false) to decide whether a specific set of actions should be executed.
• Typically used when you need to execute an action or path based on a logical expression.
Example:
• Condition: If (totalAmount > 1000)
• Action: Send a discount code to the customer.
IF - Value
This evaluates a specific value against a given condition to determine the next steps.
• Unlike a logical condition, it directly checks the equality or presence of a value.
Example:
• Condition: If (status == "Completed")
• Action: Notify the user.
Case - Condition
Similar to a switch-case construct in programming, it evaluates multiple logical conditions and executes the corresponding case that matches.
• Useful for handling multiple paths with complex logical comparisons.
Example:
• Case 1: If (orderType == "Express" AND shippingRegion == "Domestic")
• Action: Prioritize order for processing.
• Case 2: If (orderType == "Standard" AND shippingRegion == "International")
• Action: Notify the customer about extended delivery time.
Case - Value
• This works like a switch-case but evaluates specific values instead of logic conditions.
• Allows multiple predefined cases, where each case corresponds to a specific value match.
Example:
• Case 1: If (priority == "High")
• Action: Assign task to senior staff.
• Case 2: If (priority == "Low")
• Action: Assign task to junior staff.