- はじめに
- UiPath Agents の利用を開始する
- LangGraph を使用した UiPath Agents の利用を開始する
- Studio Web でローコード エージェントを構築する
- UiPath エージェントにツールを追加する
- Getting Started with UiPath Maestro Flow
フローを検証する
価格ウォッチ フローが正しく構築され、エラーや警告が表示されないことを確認します。
手順 3 - フローを確認する
以下の手順では、UiPath CLI (uip) を使用してフローを検証し、フローで検出される一般的な警告とエラーをいくつかカバーします。このセクションでは、CLI を使用してフローの設定方法を確認し、検証する方法について説明します。「 フローのテスト 」セクションに進んで、後でこの方法を希望する場合は、後で戻ってください。
3.1 - ノードと接続を確認する
次のコマンドを実行して、ノードを一覧表示します。
uip maestro flow node list PriceWatch/PriceWatch.flow --output table
uip maestro flow node list PriceWatch/PriceWatch.flow --output table
ノード リストには、正確に次の 6 つの ID が含まれている必要があります。
Id | Type | Label
----------------|---------------------|-----------------
start | core.trigger.manual | Manual trigger
fetchRate1 | core.action.http.v2 | Fetch rate
reshapeRate1 | core.action.script | Reshape rate
belowThreshold1 | core.logic.decision | Below threshold
endAlert1 | core.control.end | End alert
endNoAction1 | core.control.end | End no action
Id | Type | Label
----------------|---------------------|-----------------
start | core.trigger.manual | Manual trigger
fetchRate1 | core.action.http.v2 | Fetch rate
reshapeRate1 | core.action.script | Reshape rate
belowThreshold1 | core.logic.decision | Below threshold
endAlert1 | core.control.end | End alert
endNoAction1 | core.control.end | End no action
次に、次のコマンドを実行して、ノード間の接続 (エッジ) を確認します。
uip maestro flow edge list PriceWatch/PriceWatch.flow --output table
uip maestro flow edge list PriceWatch/PriceWatch.flow --output table
エッジ リストには 5 つのエッジが含まれている必要があります。また、Decision ノードはソースとして 2 回、true ポートに 1 回、falseに 2 回表示する必要があります。出力エッジが 1 つある Decision ノードは、このフローで最も重大な構造的欠陥であり、次のセクションではそのチェック方法について説明します。
Id | Source | Target
-------------------------------------------|-----------------------|----------------------
start-output-fetchRate1-input | start:output | fetchRate1:input
fetchRate1-default-reshapeRate1-input | fetchRate1:default | reshapeRate1:input
reshapeRate1-success-belowThreshold1-input | reshapeRate1:success | belowThreshold1:input
belowThreshold1-true-endAlert1-input | belowThreshold1:true | endAlert1:input
belowThreshold1-false-endNoAction1-input | belowThreshold1:false | endNoAction1:input
Id | Source | Target
-------------------------------------------|-----------------------|----------------------
start-output-fetchRate1-input | start:output | fetchRate1:input
fetchRate1-default-reshapeRate1-input | fetchRate1:default | reshapeRate1:input
reshapeRate1-success-belowThreshold1-input | reshapeRate1:success | belowThreshold1:input
belowThreshold1-true-endAlert1-input | belowThreshold1:true | endAlert1:input
belowThreshold1-false-endNoAction1-input | belowThreshold1:false | endNoAction1:input
ID が異なる場合は、以降のページで式を適応させるのではなく、今すぐ修正してください。ID を変更するには、「 ノード ID の名前の変更方法」で説明されている手順に従います。
3.2 - 警告とエラーを確認する
validation コマンドはファイル全体を読み取って検証します。フローをデプロイする前にこのコマンドを実行して、潜在的な間違いを明らかにすることを習慣として使用します。次のコマンドを使用します。
uip maestro flow validate PriceWatch/PriceWatch.flow
uip maestro flow validate PriceWatch/PriceWatch.flow
Warningsフィールドのない"Status": "Valid"が表示されることを確認します (Fileフィールドには、オペレーティング システムとユーザー名に応じて、.flow ファイルの完全な絶対パスが含まれます)。
{
"Result": "Success",
"Code": "FlowValidate",
"Data": {
"File": "/home/user/tutorial-maestro-flow-price-watch/PriceWatch/PriceWatch.flow",
"Status": "Valid"
}
}
{
"Result": "Success",
"Code": "FlowValidate",
"Data": {
"File": "/home/user/tutorial-maestro-flow-price-watch/PriceWatch/PriceWatch.flow",
"Status": "Valid"
}
}
Warningsが表示されない場合は、次の手順に進んでフローをテストしてください。
以下に示すような問題を回避するため、フローを実行する前に validate コマンドを実行することを強くお勧めします。uip maestro flow debug と uip maestro flow publish はどちらも正常に完了し、警告が表示され、エラーがある場合にのみ失敗します。継続的インテグレーション/継続的デプロイ (CI/CD) ワークフローを設定する場合は、publish コマンドの前に uip maestro flow validate を追加して、警告のあるパッケージがパブリッシュまたはデプロイされないようにしてください。
一般的な警告
注意すべき 2 つの一般的な警告の種類とその修正方法を次に示します。
-
入力変数に
triggerNodeIdがありません。つまり、その変数はトリガー入力変数ではなくグローバル変数として設定されています。グローバル変数は任意のノードが読み取って設定でき、フローを手動でトリガーする際には、指定する必要がある値として表示されません。- [variables.globals[baseCurrency].triggerNodeId] Input variable "baseCurrency" is read via `$vars.start.output.baseCurrency`, but it has no "triggerNodeId". At runtime the trigger "start" output will not contain "baseCurrency", so the value resolves to null (a downstream node may fault, e.g. "Cannot read property '…' of null"). Set "triggerNodeId": "start" on the "baseCurrency" global.- [variables.globals[baseCurrency].triggerNodeId] Input variable "baseCurrency" is read via `$vars.start.output.baseCurrency`, but it has no "triggerNodeId". At runtime the trigger "start" output will not contain "baseCurrency", so the value resolves to null (a downstream node may fault, e.g. "Cannot read property '…' of null"). Set "triggerNodeId": "start" on the "baseCurrency" global.この問題を修正するには、まずグローバル
baseCurrency変数を削除してから、startトリガー ノードを編集して、そのノードにbaseCurrency変数を追加します ( 手順 2.1 参照)。 -
MISSING_OUTPUT_MAPPING- 出力変数を設定しず、null値とともに返す終了ノードです。値が設定されていないと、出力変数を必要とする下流のシステムやフローでエラーが発生する可能性があります。- [nodes[endAlert1].outputs.watchResult.source] [MISSING_OUTPUT_MAPPING] "End alert" is missing output mapping for "watchResult"- [nodes[endAlert1].outputs.watchResult.source] [MISSING_OUTPUT_MAPPING] "End alert" is missing output mapping for "watchResult"
各終了ノードには、フローで作成される出力変数ごとに 1 つのフィールドがあります。これにより、すべての可能な終了ノードが同じ出力を返しますが、出力の設定方法は個々の終了ノードごとに設定されます。これについて考えると便利です。トリガー ノードの入力変数と終了ノードの出力変数は、API 呼び出しの要求オブジェクトや応答オブジェクトと同様に、このフローに必要なコントラクト値であるということです。
出力マッピングが終了ノードに設定されていない場合、VS Code のキャンバスでノードのプロパティを表示すると、 "End" is missing output mapping for "<name>" を示す赤い警告で強調表示されます。これは、 uip maestro flow validate に表示される警告と同じ MISSING_OUTPUT_MAPPINGです。
debug コマンドを使用して フローをテスト できます。