LogicalTriggerNodeEditor Documentation
Purpose
The LogicalTriggerNodeEditor is a feature designed to facilitate the creation and management of logical conditions within a workflow in the Vantage analytics and data platform. This component allows users to define conditions that will determine whether data passes through based on specified criteria (e.g., equality, greater than, etc.) and controls how these conditions are logically evaluated (using AND/OR logic).
Settings
Logic Mode
- Setting Name:
logicMode - Input Type: Dropdown (select)
- Functionality:
- This setting controls how conditions are evaluated.
- Options:
- "all": All defined conditions must be met for data to pass.
- "any": At least one condition must be met for data to pass.
- Effect: Changing this affects the logical behavior of the component; if set to "all," all conditions must match, whereas if set to "any," only one needs to match.
- Default Value:
"all"
Pass Mode
- Setting Name:
passMode - Input Type: Dropdown (select)
- Functionality:
- This setting specifies the mode of data passing through based on conditions.
- Options:
- "filter_rows": Only rows that match the defined conditions will pass through.
- "gate_all": If any row matches any condition, all rows are passed through; otherwise, nothing is passed.
- Effect: Influences the dataset that is output based on the conditions; it alters whether only matching rows are outputted or if all rows are outputted based on one condition match.
- Default Value:
"filter_rows"
Conditions
- Setting Name:
conditions - Input Type: Array of condition objects
- Functionality:
- This setting holds an array of conditions. Each condition contains three properties:
field,operator, andvalue. - Each condition can be manipulated (added, removed, updated) to build complex logical criteria.
- This setting holds an array of conditions. Each condition contains three properties:
- Default Value:
[](empty array)
Condition Properties:
-
Field:
- Setting Name:
field - Input Type: String (text or dropdown from upstream columns)
- Functionality: Specifies which column the condition applies to.
- Default Value:
""(empty string)
- Setting Name:
-
Operator:
- Setting Name:
operator - Input Type: Dropdown (select)
- Functionality: Specifies the comparison operator to use for the condition (e.g., equals, greater than).
- Default Value:
"equals"
- Setting Name:
-
Value:
- Setting Name:
value - Input Type: String
- Functionality: This is the value to compare against the specified field.
- For operators that do not require a value (e.g., is_empty, is_not_empty), this field is not displayed.
- Default Value:
""(empty string)
- Setting Name:
How It Works
- Fetching Upstream Columns: Upon component initialization, the editor fetches upstream column data from connected nodes, allowing users to select fields for conditions.
- Dynamic UI: Users can add or remove conditions dynamically. Each condition can be modified with desired field, operator, and value settings in a user-friendly interface.
- Conditions Validation: The logical relationship is formed by conditions that utilize selected operators to compare field values according to the defined logic mode (all/any).
- Real-time Updates: using state management, changes made to conditions or settings are reflected in real time without requiring page reloads, ensuring a smooth user experience.
Data Expectations
The LogicalTriggerNodeEditor expects:
- An array of nodes and edges, representing the workflow structure.
- The selected node must be supplied to understand the current context.
- A
workflowIdmust be provided to retrieve necessary data from the backend during column fetching.
Use Cases & Examples
Use Case 1: Filtering Sales Data
In a sales reporting workflow, users may want to filter rows where the sales_amount is greater than 100 and the region is North.
Use Case 2: Validating User Submissions
A workflow could be configured to ensure that any submitted forms must contain a username and the email must match a valid format using regex conditions.
Detailed Example Configuration
Use Case: Filtering Customer Feedback
- Objective: Filter customer feedback entries to find those that are positive comments from users in the
USAregion. - Configuration:
{
"logicMode": "all",
"passMode": "filter_rows",
"conditions": [
{
"field": "feedback",
"operator": "contains",
"value": "good"
},
{
"field": "country",
"operator": "equals",
"value": "USA"
}
]
}Explanation:
logicModeis set toall, meaning both conditions must be met.passModeis set tofilter_rows, allowing only the entries where feedback contains "good" and are from users in theUSAto pass through.- The conditions are built with fields
feedbackandcountry, using thecontainsandequalsoperators, respectively.
This configuration would effectively filter the data stream, allowing only those entries that indicate positive feedback from the USA region to be processed further in the workflow.