DataTable変数の代わりにDataRow変数を回すメリット

UiPath Studio 2023.4.0 Community Editionを利用中の初心者です。

以前の職場で、INPUTファイル(Excel)を「範囲を読み込み」アクティビティで読み込んでDataTableに値を取得し、DataTableの上の行から順番に処理していくロボットは
添付画像のFrameworkの上で処理していました。
このFrameworkでは、黒丸の「1件分の業務処理」シーケンスの中で、DataTableの中のDataRow1行分の処理を行います。
また、黒丸の「処理対象レコードを取得」シーケンスの中で

dr_TransactionItem=dt_TransactionData.Rows(int_TransactionNumber)

という構文でDataTableから1行分のDataRow変数の値を取得しています。

通常DataTable変数は、ForEachRowアクティビティを使って回しますが、このFrameworkでは、どうしてわざわざプログラマが意識してDataTable変数から1行分のDataRow変数を抽出してDataRow変数を回すんだろうと不思議に思っていましたが、本日、DataRow変数を回すと、DataRow変数の処理が失敗した場合に、このFrameworkだと1行分の処理の再試行が簡単にできることに気づきました。
DataTable変数の代わりにDataRow変数を回すメリットは他に何かありますか?

@gorby

  1. Yes as you said exceptions and all are easy to seggregate per tranasaction
  2. We can use flows instead of a sequence which gives better readability and again seggregation of each task
  3. If processes are large it is very diffucult to handle in for loop…there would be so many nested workflows and need to go into everythingn…here it looks more organised and granular

Basically RE Framework is also created on the same line…where different state machiens are used to seggregate each work that bot does and under those we have localized workflows to do each activity

And more over what you are having in picture is one way of doing for loop only it is just that this is done using workflows and giving conditions on your own

Hope this helps

Cheers

こんにちは

ForEachRowアクティビティの場合もDataTableから1行分のDataRowを取り出して処理していますのでやっていることはほぼ同じかと思います。ただしForEachRowアクティビティは直接フローチャートやステートマシンの構造に組み込めないので、これらでロジックを組むときは自然とDataTableからDataRowを取り出す必要性が出てくるかと思います。

やっていることは同じだが、DataTableを回す方が楽なのに、どうしてわざわざ1行分のDataRowを取り出して処理している理由が分からず質問をさせていただきました。

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.