UiPath Documentation
activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

工作流活动

上次更新日期 2026年4月16日

VerifyIsGreater

验证第一个表达式是否大于第二个表达式。

定义

命名空间: UiPath.Testing.API

程序集: UiPath.Testing.Activities.Api(在 UiPath.Testing.Activities.Api.dll 中)

VerifyIsGreater(object, object, string)

bool VerifyIsGreater(
       object firstExpression,
       object secondExpression
       string outputMessageFormat = null
)
bool VerifyIsGreater(
       object firstExpression,
       object secondExpression
       string outputMessageFormat = null
)

firstExpression对象:验证流程中的第一个表达式。

secondExpression对象:验证流程中的第二个表达式。

outputMessageFormat String : 输出消息的格式。支持的参数包括:

  • {LeftExpression}
  • {LeftExpressionText}
  • {RightExpression}
  • {RightExpressionText}
  • {Result}

有关更多信息,请查看“配置outputMessageFormat部分。

返回值

如果第一个表达式大于第二个表达式,则为True ,如果第一个表达式等于或小于第二个表达式,则为False

配置输出消息格式

outputMessageFormat参数可以配置受支持的参数,这些参数充当验证操作中所用值的占位符。在这些占位符中,系统会自动填充在运行时调用编码自动化 API 时定义的变量或值。

对于 Orchestrator 编码自动化 API,您可以在创建输出消息时实现以下支持的参数:

  • {LeftExpression}:表示您为 firstExpression 参数提供的首个表达式的值。
  • {LeftExpressionText}:表示您为 firstExpression 参数插入的首个表达式的文本。
  • {RightExpression}:表示您为 secondExpression 参数提供的第二个表达式的值。
  • {RightExpressionText}:表示您为 secondExpression 参数插入的第二个表达式的文本。
  • {Result} :表示编码自动化 API 的返回值,即验证结果。

以下示例说明了如何使用“验证为大于”编码自动化 API,其中包括配置outputMessageFormat参数:

// Initialize variables for the expressions to be verified
var expression1 = 7;
var expression2 = 6;

// Employ the VerifyIsGreater coded automation API, with the last string parameter being the outputMessageFormat
testing.VerifyIsGreater(expression1, expression2, "{LeftExpression} should be greater than {LowerLimitText}, and the result to this is {Result}");
// Initialize variables for the expressions to be verified
var expression1 = 7;
var expression2 = 6;

// Employ the VerifyIsGreater coded automation API, with the last string parameter being the outputMessageFormat
testing.VerifyIsGreater(expression1, expression2, "{LeftExpression} should be greater than {LowerLimitText}, and the result to this is {Result}");

在提供的示例中,大括号中的占位符在运行时替换为相应的变量名称及其值,从而提供自定义的输出消息。

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新