Skip to content

if-not-equal

if-not-equal - compare two values for inequality

state-name:
tool: if-not-equal
arguments:
left: <value1>
right: <value2>
goto:
true: <not-equal-state>
false: <equal-state>

The if-not-equal tool is the negated version of if-equal. It returns "true" if the values differ, or "false" if they are equal.

Both values are trimmed of whitespace before comparison. The comparison is case-sensitive.

ArgumentRequiredDefaultDescription
leftYes-First value to compare
rightYes-Second value to compare
CodeMeaning
0Success (outputs “true” or “false”)
1Missing required argument

The tool outputs "true" if the values differ, or "false" if they are equal.

check-changed:
tool: if-not-equal
arguments:
left: "{{ old_value }}"
right: "{{ new_value }}"
goto:
true: handle-change
false: no-change
check-status:
tool: if-not-equal
arguments:
left: "{{ status }}"
right: "completed"
goto:
true: do-work
false: already-done
ensure-not-production:
tool: if-not-equal
arguments:
left: "{{ environment }}"
right: "production"
goto:
true: allow-operation
false: block-production
verify-no-error:
tool: if-not-equal
arguments:
left: "{{ error_code }}"
right: "0"
goto:
true: handle-error
false: continue-success
not-default:
tool: if-not-equal
arguments:
left: "{{ config_value }}"
right: "default"
goto:
true: use-custom-config
false: use-default-config
watch-changes:
tool: bash
arguments:
command: cat state.txt
output: var(current_state)
next: detect-change
detect-change:
tool: if-not-equal
arguments:
left: "{{ current_state }}"
right: "{{ previous_state }}"
goto:
true: state-changed
false: no-change