Skip to main content

If-then

Description

The If-then tool is a conditional tool that enables the execution of a particular flow or action based on a specified condition. It is used to perform specific actions when certain conditions are met. For instance, in the context of Object Detection in an image, the If-then tool can be employed to trigger a specific action or workflow if a particular object is detected. This tool allows for flexible and automated decision-making based on defined conditions, enhancing the efficiency and effectiveness of various processes.

Settings

info

Zene UI

See Tool Flow - If-then Tool on how to add an if-then tool to the tool flow.

tip

Zene UI

picture 6

Zene UI Condition Example
  1. Name
  2. OR Group
  3. Comparison Tools
  4. Comparison Values
  5. Comparison Operator
  6. Remove Condition button

Conditions

Conditions are the criteria that must be met for the If-then tool to execute a particular flow or action.

There are two logical operations similar to "OR" gate and "AND" gate (in the logic gate). In an "OR" group if a condition of one of the criteria passes the whole group passes. All the conditions in an OR group act as one entity. The special group OR group 0 or No group acts as an individual entity. Each entity is an input to an "AND" operation, where if one entity fails the overall condition will also fail.

Below are three (3) examples of use cases, three (3) tools were selected, the top two (2) conditions are in OR group 1, condition 3 and condition 4 OR group were not selected (No group).

picture 1

Conditions - Example 1

In example 1, the Condition 2 fails, but because Condition 1 and Condition 2 are in the same "OR" group and Condition 1 passes, OR group 1 also passes. There are three (3) entities for the "AND" input, Or group 1 and the two No group, all the entities pass so the overall condition passes.

picture 3

Conditions - Example 2

In example 2, only Condition 3 fails, because Condition 3 is its own entity for the "AND" operation input, the overall condition also fails.

picture 4

Conditions - Example 2

In example 3, Condition 1 and Condition 2 fail, they are in the same OR group so the whole OR group 1 fails. There are three (3) entities for the AND input, Or group 1 and the two No group. In this case, one of the entities fails so the overall condition fails.

Name

Each conditions can be given a name. The name is used to identify the condition.

OR Group

Each condition can be assigned to an OR group. Conditions in the same OR group are evaluated together. If any of the conditions in an OR group is met, that OR group is considered met or passes.

OR group 0 or No group is a special OR group. Conditions in this OR group are evaluated independently, similar to the "AND" gate in the logic gate.

Comparison Tools

Reference to a tool that will be used to get the comparison value. The comparison value will be the output of the tool, see Counter Values. Manual input is also possible.

Comparison Values

Each condition has two comparison values. The comparison values are the values that will be compared to determine whether the condition is met.

They can be either a constant value or a value from the Counter Values.

tip
Zene UI

The comparison values input will be enabled if the Tool is set to Manual Input. Otherwise, it will be disabled and the real time output of the Counter Tool will be displayed as the comparison value.

Comparison Operator

The comparison operator is used to compare the comparison values. The comparison operator can be one of the following:

  • > More than: The condition is met if the first comparison value is more than the second comparison value.
  • ≥ More than or equal: The condition is met if the first comparison value is more than or equal to the second comparison value.
  • = Equal: The condition is met if the first comparison value is equal to the second comparison value.
  • ≤ Less than or equal: The condition is met if the first comparison value is less than or equal to the second comparison value.
  • < Less than: The condition is met if the first comparison value is less than the second comparison value.

Input tools

An additional condition, if the selected input tools match with the current loop's input tool the condition will be met.

info

If the input tools are not specified, condition will be met for all input tools.

Days of the week

An additional condition, if the selected days of the week match with the current day the condition will be met.

Time of day

An additional condition, if the selected range of the time of day match with the current time the condition will be met.

info

If the time of day ranges are not specified, the condition will be met for all time of day.