Skip to content

Commit 6f64da4

Browse files
feat: support not_equal comparison (#4886)
1 parent ec3257c commit 6f64da4

6 files changed

Lines changed: 27 additions & 1 deletion

File tree

apps/application/flow/compare/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424
from .len_lt_compare import *
2525
from .lt_compare import *
2626
from .not_contain_compare import *
27+
from .not_equal_compare import *
2728
from .start_with import StartWithCompare
2829

2930
compare_handle_list = [GECompare(), GTCompare(), ContainCompare(), EqualCompare(), LTCompare(), LECompare(),
3031
LenLECompare(), LenGECompare(), LenEqualCompare(), LenGTCompare(), LenLTCompare(),
3132
IsNullCompare(),
32-
IsNotNullCompare(), NotContainCompare(), IsTrueCompare(), IsNotTrueCompare(), StartWithCompare(),
33+
IsNotNullCompare(), NotContainCompare(), NotEqualCompare(), IsTrueCompare(), IsNotTrueCompare(), StartWithCompare(),
3334
EndWithCompare()]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# coding=utf-8
2+
"""
3+
@project: maxkb
4+
@Author:wangliang181230
5+
@file: not_equal_compare.py
6+
@date:2026/3/17 9:41
7+
@desc:
8+
"""
9+
from typing import List
10+
11+
from application.flow.compare import Compare
12+
13+
14+
class NotEqualCompare(Compare):
15+
16+
def support(self, node_id, fields: List[str], source_value, compare, target_value):
17+
if compare == 'not_eq':
18+
return True
19+
20+
def compare(self, source_value, compare, target_value):
21+
return str(source_value) != str(target_value)

ui/src/locales/lang/en-US/workflow.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ You are a master of problem optimization, adept at accurately inferring user int
524524
contain: 'Contains',
525525
not_contain: 'Does not contain',
526526
eq: 'Equal to',
527+
not_eq: 'Not equal to',
527528
ge: 'Greater than or equal to',
528529
gt: 'Greater than',
529530
le: 'Less than or equal to',

ui/src/locales/lang/zh-CN/workflow.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ export default {
515515
contain: '包含',
516516
not_contain: '不包含',
517517
eq: '等于',
518+
not_eq: '不等于',
518519
ge: '大于等于',
519520
gt: '大于',
520521
le: '小于等于',

ui/src/locales/lang/zh-Hant/workflow.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ export default {
509509
contain: '包含',
510510
not_contain: '不包含',
511511
eq: '等於',
512+
not_eq: '不等於',
512513
ge: '大於等於',
513514
gt: '大於',
514515
le: '小於等於',

ui/src/workflow/common/data.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,7 @@ export const compareList = [
942942
{ value: 'contain', label: t('workflow.compare.contain') },
943943
{ value: 'not_contain', label: t('workflow.compare.not_contain') },
944944
{ value: 'eq', label: t('workflow.compare.eq') },
945+
{ value: 'not_eq', label: t('workflow.compare.not_eq') },
945946
{ value: 'ge', label: t('workflow.compare.ge') },
946947
{ value: 'gt', label: t('workflow.compare.gt') },
947948
{ value: 'le', label: t('workflow.compare.le') },

0 commit comments

Comments
 (0)