You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CodeEffects规则引擎:评估规则中+运算符的使用方法

How to Build a Rule with Custom Function Additions in CodeEffects Rule Editor

Got it, let's break down exactly how to create that rule where you sum multiple calls to your somefunc custom function and check if the total is greater than 1. Here's a step-by-step guide tailored to the CodeEffects editor:

Prerequisite Check

First, make sure your somefunc custom function is properly registered with the CodeEffects engine. It needs to return a numeric type (like int, decimal, or double)—the editor only allows the + operator for operands that can be mathematically added. If you haven't set this up yet, double-check your function's return type in your engine configuration.

Step-by-Step Rule Creation

  1. Open the CodeEffects Rule Editor and create a new Evaluation Rule (this is the right rule type for yes/no judgment scenarios like yours).
  2. In the rule's condition panel, click to add a new condition. Select the Compare Values condition type.
  3. Build the left-hand operand (the sum of your function calls):
    • Start by selecting your somefunc from the function list, then pick somevar1 as its input parameter. This adds somefunc(somevar1) to the operand area.
    • Click the Add Operator button (looks like a + icon in most editor themes) and choose the + arithmetic operator.
    • Repeat the first step: add somefunc again, select somevar2 as the parameter.
    • Add another + operator, then add somefunc with somevar3 as its parameter.
  4. Set the comparison operator to Greater Than.
  5. For the right-hand operand, simply enter the numeric value 1.

Final Rule Structure

Once you're done, your rule will look something like this in the editor's text view:

If (somefunc(somevar1) + somefunc(somevar2) + somefunc(somevar3)) > 1 Then
    // Define your action here (e.g., mark as "Eligible" or trigger a workflow)
End If

Quick Troubleshooting Tip

If the + operator doesn't show up when you try to add it, double-check two things:

  • Your somefunc returns a numeric type (not a string or boolean).
  • You're adding the operator between valid operands (not directly after a parameter or before a function call).

内容的提问来源于stack exchange,提问作者Satya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 08:41:51