activities
latest
false
重要 :
このコンテンツの一部は機械翻訳によって処理されており、完全な翻訳を保証するものではありません。
ワークフローに関するアクティビティ
Last updated 2024年10月22日

Create Comparison Rule

UiPath.Testing.Activities.CreateComparisonRule

説明

Create Comparison Rule allows you to create comparison rules designed to match and exclude specific parts of the text during document or text comparison. The rule can use various matching techniques, such as regular expressions (regex) or wildcards. These rules allow pattern identification, such as dates, IDs, or dynamic content, that should be ignored.

プロジェクトの対応 OS

Windows - レガシ | Windows | クロスプラットフォーム

構成

デザイナー パネル
  • Rule Name - Represents the rule identifier. This identifier is also used as the placeholder value when excluding specific portions of a text or document.
  • Comparison Rule Type - Indicates the specific rule type for identifying and omitting specified segments from the text or documents during comparison. Available rule types include:
    • RegexRule - Allows you to create a regular expression rule.
    • WildcardRule - Allows you to create a wildcard rule.
  • Pattern - Specifies the particular sequence or structure used in creating the comparison rule. This pattern should correspond to the text or the section of a document you wish to omit. Depending on the Comparison Rule Type, you can input either a regex or wildcard pattern.
プロパティ パネル

入力

  • Use Placeholder - Decide whether to replace the text, which gets excluded by the rule you created, with a placeholder holding the rule's name.
  • エラー発生時に実行を継続 - アクティビティでエラーが発生した場合でも、オートメーションを継続するかどうかを指定します。このフィールドでは Boolean 値 (TrueFalse) のみがサポートされています。既定値は False です。その結果、フィールドが空白の場合にエラーが発生すると、プロジェクトの実行が停止します。値を True に設定すると、エラーの発生に関係なくプロジェクトの実行は継続されます。

出力

Comparison Rule - The result of the comparison rule.

This example consists of creating a comparison rule of type regex that excludes any date formats from the texts or documents that you are comparing. In this scenario, we'll configure the activity as follows:

  1. In the Rule Name field, enter a name for the rule.
    In this example, we are using ExcludeDate as the name.
    Note: If you choose to display a placeholder value instead of the excluded text (using the Use Placeholder property), then ensure that the rule name is representative for the text you are excluding.
  2. From the Comparison Rule Type dropdown list, select RegexRule.
  3. In the Pattern field, enter the regular expression sequence that represents all date formats.
    In this example, use the following regex for representing date formats: @"\b(\d{2}[-\/]\d{2}[-\/]\d{4}|\d{4}[-\/]\d{2}[-\/]\d{2})\b".
    If you'd like to use a wildcard, you can use the following pattern ??-??-????, where ? stands for a single character. This pattern can match dates that follow the MM-DD-YYYY format, but it can also match strings like ab-cd-efgh.
  4. For the Use Placeholder field, select True.
    This ensures that in the files we generate after comparing texts or documents, excluded date formats will appear as the rule name: ExcludedDate.
  5. For the Comparison Rule field, create a new variable using the ctrl + k keyboard shortcut.
  • 説明
  • プロジェクトの対応 OS
  • 構成

このページは役に立ちましたか?

サポートを受ける
RPA について学ぶ - オートメーション コース
UiPath コミュニティ フォーラム
Uipath Logo White
信頼とセキュリティ
© 2005-2024 UiPath. All rights reserved.