{"record":{"id":"3a38707e78f5dfcc","repo":"YunaiV/yudao-cloud","slug":"error-3a3870","errorCode":null,"errorMessage":"未知操作符: {}","messagePattern":"未知操作符: (.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":500,"severity":"error","filePath":"yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/definition/BpmConditionOpCodeEnum.java","lineNumber":35,"sourceCode":"    GT(\">\", \"大于\", \" var:getOrDefault(%s, null) > %s \"),\n    GE(\">=\", \"大于等于\", \" var:getOrDefault(%s, null) >= %s \"),\n    LT(\"<\", \"小于\", \" var:getOrDefault(%s, null) < %s \"),\n    LE(\"<=\", \"小于等于\", \" var:getOrDefault(%s, null) <= %s \"),\n\n    CONTAINS(\"contain\", \"包含\", \" var:contains(%s, %s) \"),\n    NOT_CONTAINS(\"!contain\", \"不包含\", \" !var:contains(%s, %s) \");\n\n    private final String code;\n    private final String des;\n    private final String symbol;\n\n    public static BpmConditionOpCodeEnum fromCode(String code) {\n        for (BpmConditionOpCodeEnum op : BpmConditionOpCodeEnum.values()) {\n            if (op.code.equalsIgnoreCase(code)) {\n                return op;\n            }\n        }\n        throw new IllegalArgumentException(\"未知操作符: \" + code);\n    }\n\n}\n","sourceCodeStart":17,"sourceCodeEnd":39,"githubUrl":"https://github.com/YunaiV/yudao-cloud/blob/477be9dd49ab7223a972a6abdff0684d6423dec3/yudao-module-bpm/yudao-module-bpm-api/src/main/java/cn/iocoder/yudao/module/bpm/enums/definition/BpmConditionOpCodeEnum.java#L17-L39","documentation":"BpmConditionOpCodeEnum.fromCode throws IllegalArgumentException when the condition operator code passed from a BPM simple-model condition node (e.g. Flowable expression builder UI) does not case-insensitively match any defined operator code ('==' , '!=', '>', '>=', '<', '<=', 'contains', '!contain', etc.). The code string comes straight from the JSON saved on the process definition, so a typo or a newer designer's operator will blow up server-side conversion.","triggerScenarios":"Saving/converting a simple-model BPMN whose condition node op is misspelled (e.g. 'not-contains', '===', 'CONTAINS ' with trailing space); importing a process definition JSON authored against a different (newer/older) yudao version that added operators this build lacks; hand-edited rule JSON.","commonSituations":"Frontend designer version newer than backend module (new operators not in the server enum); copy-pasting condition config between projects; whitespace/case drift in stored JSON after export/import.","solutions":["Use one of the codes defined in BpmConditionOpCodeEnum (check the enum constants: ==, !=, >, >=, <, <=, contains, !contain, etc.)","Align BPM frontend designer and backend module versions so the operator set matches","Trim/normalize the op string before calling fromCode"],"exampleFix":"// before\nBpmConditionOpCodeEnum op = BpmConditionOpCodeEnum.fromCode(\"not-contains\"); // throws\n\n// after\nString code = StrUtil.trim(rawOp);\nBpmConditionOpCodeEnum op = BpmConditionOpCodeEnum.fromCode(code);\n// ensure code is one of: \"==\", \"!=\", \">\", \">=\", \"<\", \"<=\", \"contains\", \"!contain\", ...","handlingStrategy":"validation","validationCode":"// before fromCode: whitelist the ops your designer emits\nSet<String> supported = Arrays.stream(BpmConditionOpCodeEnum.values())\n    .map(BpmConditionOpCodeEnum::getCode).collect(Collectors.toSet());\nif (!supported.contains(rawCode)) {\n    throw new IllegalArgumentException(\"op 必须是 \" + supported);\n}","typeGuard":"boolean isSupportedOp(String code) {\n    return Arrays.stream(BpmConditionOpCodeEnum.values())\n        .anyMatch(op -> op.getCode().equalsIgnoreCase(StrUtil.trimToEmpty(code)));\n}","tryCatchPattern":null,"preventionTips":["Derive the designer's operator dropdown from the backend enum contract","Keep BPM frontend and backend on the same release","Validate imported process JSON against the enum before deploying"],"tags":["bpm","flowable","condition","enum","validation"],"backgroundTag":null,"analyzedSha":"477be9dd49ab7223a972a6abdff0684d6423dec3","analyzedAt":"2026-08-14T13:35:31.121Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}