BrainGrid Controller
Workflow Builder
Conditions
Binary Condition

Binary Condition Setup

Binary Conditions are a powerful feature in the Workflow Management module that allow you to configure actions based on specific logical evaluations. This feature is useful for triggering different actions based on whether certain conditions are met, making your workflows more dynamic and responsive.

Overview

Binary Conditions involve creating logical tests that evaluate to either true or false. Depending on the result of this evaluation, you can configure different actions to occur. For example, you might want to send a notification if a user meets certain criteria or send an SMS if they do not.

Configuring Binary Conditions

Basic Binary Condition

To set up a basic binary condition:

  1. Title: Provide a descriptive title for your condition.
  2. Description: Describe what the condition does and when it should trigger.
  3. Logic Block: Define the logical expression that must evaluate to true for the condition to be met. For example, user === 'Ram'.
  4. If Block: Specify the action to take if the logic block evaluates to true, such as sending a notification.
  5. Else Block: Specify the action to take if the logic block evaluates to false, such as sending an SMS.

Example:

  • Title: User Notification Condition
  • Description: Send notification if user is "Ram"
  • Logic Block: user === 'Ram'
  • If Block: Send Notification
  • Else Block: Send SMS

Complex Binary Condition

Complex binary conditions involve more intricate logical expressions. You can combine multiple conditions using logical operators (AND, OR) to create more nuanced triggers.

  1. Title: Provide a descriptive title for your complex condition.
  2. Description: Describe the combined conditions and actions.
  3. Logic Block: Define the complex logical expression that must evaluate to true. For example, user === 'Ram' && status === 'active'.
  4. If Block: Specify the action to take if the complex logic evaluates to true, such as sending a notification.
  5. Else Block: Specify the action to take if the complex logic evaluates to false, such as sending an email.

Example:

  • Title: Complex User Notification Condition
  • Description: Send notification if user is "Ram" and status is "active"
  • Logic Block: user === 'Ram' && status === 'active'
  • If Block: Send Notification
  • Else Block: Send Email

Validating and Testing Binary Conditions

Once configured, it’s important to validate and test your binary conditions to ensure they function as expected:

  1. Review Configuration: Check the title, description, logic block, and actions (If and Else blocks) to ensure they are set correctly.
  2. Trigger Conditions: Test the binary condition by simulating scenarios where the logic block evaluates to true and false. Verify that the correct actions are executed based on these evaluations.

Testing Example:

  • If Block Activation: If the condition user === 'Ram' is true, verify that a notification is sent.
  • Else Block Activation: If the condition user === 'Ram' is false, verify that an SMS is sent.

By following these steps, you can effectively configure and test binary conditions to enhance the automation and responsiveness of your workflows.