Icon

JKISeason2-17@obito_​od

Just Knime It season2-17@obito_od

Just KNIME It! Season2
Challenge 17: Better Workflows with Error Handling and Logging
@obito_od回答例










Just KNIME It! season2-17 Knime ver. : 4.7.4 方針Benckmark、Catch Erros、Extract Contents Propertiesで必要情報を取得してcsvにappendモードで記載していく。エラーを起こしたnode番号を特定しやすくするため、もとのworkflowfはcomponentにしておく。その場合Catch Errosから出力されるFailuenodeには親Component名が入り、FailureNodeMessageに[エラーを起こしたnode名]:[親ComponentのNodeID]:[エラーを起こしたnodeNo.]: [FailureNodeMessage]の書式で記載されるのでそちらから掘り出す。→エラーを起こしたnode名とnodeIDは分けない方が良いように思うので一つのcolumnに入れたままにする 説明このチャレンジのゴールは、エラー処理とロギングで堅牢なソリューションを構築することの重要性を再認識してもらうことです。これらはワークフロー開発におけるベストプラクティスであり、忘れられがちだが、最終的には大きな違いを生む。具体的には、任意のワークフローを選択し、以下の要素を追加する:エラー処理:エラー処理:Try & Catch構文を使う;ロギング:ワークフロー名、ユーザー名、実行の開始と終了を抽出する。次に、これらのメタデータと、失敗したノードの名前(もしあれば)とそのメッ セージを 1 行に含むテーブルを作成し、このテーブルを CSV ファイルに書き出す。ワークフローが再度実行されると、CSV ファイルのログテーブルに新しい行が追加されることを確認する。オプションとして、ログファイルにさらにカラムを追加することができます。例えば、実行ステータス(成功または失敗)に応じたカスタムメッセージのカラムなどです。ワークフロー名、ユーザー名、実行の開始と終了を入力として受け取り、カスタムメッセージを設定し、ログファイルを更新するロギングコンポーネントを作成することもできます。 Description: The goal of this challenge is to remind you of the importance of building robustsolutions with error handling and logging. These are best practices in workflowdevelopment that are often forgotten, but make a big difference in the end -- especially if theapplication is critical or if you are working with a team. Concretely, you will pick any workflowof your choice and add the following elements to it: Error handling: Use the Try & Catch construction;Logging - Extract the workflow name, username, start and end of the execution. Next, createa table containing these metadata as well as the name of a failing node (if any) and itsmessage in one row, and write this table to a CSV file. Make sure that once the workflow isexecuted again, a new row is appended to the log table in the CSV file. Optionally, you canadd more columns to your log file, e.g., the column with a custom message depending onthe execution status - success or failure. You can also create a logging component thattakes workflow name, username, start and end of the execution as input, allows configuringthe custom message, and updates the log file. 元のWF(componentにしておく) メタ情報取得table rowに転換フィルタリングTryCatchLog記載appendmode実行成否判定良い感じに並び替え場面分け用feed後処理の場面分けTOP :FailureBottom:Successnode名の切り分け場面分け終了column名変更カラム追加column追加用table親ComponentのnodeIDをdigるフィルタリングvariable化親componentID削除開始終了Node 491Extract ContextProperties Variable toTable Row Column Filter Try (VariablePorts) Catch Errors(Var Ports) CSV Writer Rule Engine Column Resorter Errowを起こすダミーWF Rule EngineVariable CASE Switch Start Cell Splitter CASE Switch End Column Rename Column Appender Table Creator Timer Info Row Filter Table Rowto Variable String Manipulation Benchmark Start(Flow Variable) Benchmark End(Flow Variable) Column Appender Just KNIME It! season2-17 Knime ver. : 4.7.4 方針Benckmark、Catch Erros、Extract Contents Propertiesで必要情報を取得してcsvにappendモードで記載していく。エラーを起こしたnode番号を特定しやすくするため、もとのworkflowfはcomponentにしておく。その場合Catch Errosから出力されるFailuenodeには親Component名が入り、FailureNodeMessageに[エラーを起こしたnode名]:[親ComponentのNodeID]:[エラーを起こしたnodeNo.]: [FailureNodeMessage]の書式で記載されるのでそちらから掘り出す。→エラーを起こしたnode名とnodeIDは分けない方が良いように思うので一つのcolumnに入れたままにする 説明このチャレンジのゴールは、エラー処理とロギングで堅牢なソリューションを構築することの重要性を再認識してもらうことです。これらはワークフロー開発におけるベストプラクティスであり、忘れられがちだが、最終的には大きな違いを生む。具体的には、任意のワークフローを選択し、以下の要素を追加する:エラー処理:エラー処理:Try & Catch構文を使う;ロギング:ワークフロー名、ユーザー名、実行の開始と終了を抽出する。次に、これらのメタデータと、失敗したノードの名前(もしあれば)とそのメッ セージを 1 行に含むテーブルを作成し、このテーブルを CSV ファイルに書き出す。ワークフローが再度実行されると、CSV ファイルのログテーブルに新しい行が追加されることを確認する。オプションとして、ログファイルにさらにカラムを追加することができます。例えば、実行ステータス(成功または失敗)に応じたカスタムメッセージのカラムなどです。ワークフロー名、ユーザー名、実行の開始と終了を入力として受け取り、カスタムメッセージを設定し、ログファイルを更新するロギングコンポーネントを作成することもできます。 Description: The goal of this challenge is to remind you of the importance of building robustsolutions with error handling and logging. These are best practices in workflowdevelopment that are often forgotten, but make a big difference in the end -- especially if theapplication is critical or if you are working with a team. Concretely, you will pick any workflowof your choice and add the following elements to it: Error handling: Use the Try & Catch construction;Logging - Extract the workflow name, username, start and end of the execution. Next, createa table containing these metadata as well as the name of a failing node (if any) and itsmessage in one row, and write this table to a CSV file. Make sure that once the workflow isexecuted again, a new row is appended to the log table in the CSV file. Optionally, you canadd more columns to your log file, e.g., the column with a custom message depending onthe execution status - success or failure. You can also create a logging component thattakes workflow name, username, start and end of the execution as input, allows configuringthe custom message, and updates the log file. 元のWF(componentにしておく) メタ情報取得table rowに転換フィルタリングTryCatchLog記載appendmode実行成否判定良い感じに並び替え場面分け用feed後処理の場面分けTOP :FailureBottom:Successnode名の切り分け場面分け終了column名変更カラム追加column追加用table親ComponentのnodeIDをdigるフィルタリングvariable化親componentID削除開始終了Node 491Extract ContextProperties Variable toTable Row Column Filter Try (VariablePorts) Catch Errors(Var Ports) CSV Writer Rule Engine Column Resorter Errowを起こすダミーWF Rule EngineVariable CASE Switch Start Cell Splitter CASE Switch End Column Rename Column Appender Table Creator Timer Info Row Filter Table Rowto Variable String Manipulation Benchmark Start(Flow Variable) Benchmark End(Flow Variable) Column Appender

Nodes

Extensions

Links