Icon

20230723 Pikairos JustKNIMEIt Season 2 Challenge 17 Better Workflows with Error Handling and Logging

The goal of this challenge is to remind you of the importance of building robust solutions with error handling and logging. These are best practices in workflow development that are often forgotten, but make a big difference in the end -- especially if the application is critical or if you are working with a team. Concretely, you will pick any workflow of 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, create a table containing these metadata as well as the name of a failing node (if any) and its message in one row, and write this table to a CSV file. Make sure that once the workflow is executed again, a new row is appended to the log table in the CSV file. Optionally, you can add more columns to your log file, e.g., the column with a custom message depending on the execution status - success or failure. You can also create a logging component that takes workflow name, username, start and end of the execution as input, allows configuring the custom message, and updates the log file.

Challenge 17: Better Workflows with Error Handling and LoggingDescription: The goal of this challenge is to remind you of the importance of building robust solutions with error handling and logging. These are best practices in workflow development that areoften forgotten, but make a big difference in the end -- especially if the application is critical or if you are working with a team. Concretely, you will pick any workflow of your choice and add thefollowing elements to it: Error handling: Use the Try & Catch construction;Logging - Extract the workflow name, username, start and end of the execution. Next, create a table containing these metadata as well as the name of a failing node (if any) and its message in onerow, and write this table to a CSV file. Make sure that once the workflow is executed again, a new row is appended to the log table in the CSV file. Optionally, you can add more columns to your logfile, e.g., the column with a custom message depending on the execution status - success or failure. You can also create a logging component that takes workflow name, username, start and endof the execution as input, allows configuring the custom message, and updates the log file. List of DatesSome Correctbut SomePurposefullyIncorrectFailureStart Tryand CatchSuccessExtract MonthFrom DateConvert DateFrom Stringto DateFormatEnd Try andCatchExtractPropertiesList of DatesAll CorrectTop Port = SuccessBottom Port = FailureEnd SwitchSelectWhether youWant to Simulatea Successor a FailureConvert Variablesto TableRenameColumnsGet ExecutionTimeAppend ExecutionTime ColumnWrite CSVAppend NewRowsRead CSV Table Creator ConstantValue Column Try (Data Ports) ConstantValue Column Extract Date&TimeFields String to Date&Time Catch Errors(Data Ports) Extract ContextProperties Table Creator CASE Switch Start CASE Switch End Single SelectionWidget Variable toTable Row Column Rename Create Date&TimeRange Column Appender CSV Writer CSV Reader Challenge 17: Better Workflows with Error Handling and LoggingDescription: The goal of this challenge is to remind you of the importance of building robust solutions with error handling and logging. These are best practices in workflow development that areoften forgotten, but make a big difference in the end -- especially if the application is critical or if you are working with a team. Concretely, you will pick any workflow of your choice and add thefollowing elements to it: Error handling: Use the Try & Catch construction;Logging - Extract the workflow name, username, start and end of the execution. Next, create a table containing these metadata as well as the name of a failing node (if any) and its message in onerow, and write this table to a CSV file. Make sure that once the workflow is executed again, a new row is appended to the log table in the CSV file. Optionally, you can add more columns to your logfile, e.g., the column with a custom message depending on the execution status - success or failure. You can also create a logging component that takes workflow name, username, start and endof the execution as input, allows configuring the custom message, and updates the log file. List of DatesSome Correctbut SomePurposefullyIncorrectFailureStart Tryand CatchSuccessExtract MonthFrom DateConvert DateFrom Stringto DateFormatEnd Try andCatchExtractPropertiesList of DatesAll CorrectTop Port = SuccessBottom Port = FailureEnd SwitchSelectWhether youWant to Simulatea Successor a FailureConvert Variablesto TableRenameColumnsGet ExecutionTimeAppend ExecutionTime ColumnWrite CSVAppend NewRowsRead CSV Table Creator ConstantValue Column Try (Data Ports) ConstantValue Column Extract Date&TimeFields String to Date&Time Catch Errors(Data Ports) Extract ContextProperties Table Creator CASE Switch Start CASE Switch End Single SelectionWidget Variable toTable Row Column Rename Create Date&TimeRange Column Appender CSV Writer CSV Reader

Nodes

Extensions

Links